Skip to content

EgressAddressPolicy

Namespace AgentPrism · Assembly AgentPrism.Core.dll

The address rules one outbound surface applies to its targets.

public readonly struct EgressAddressPolicy : IEquatable<EgressAddressPolicy>

IEquatable<EgressAddressPolicy>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Not to be confused with TenantEgressPolicy, which decides which model providers a tenant may call. This type decides which addresses a socket may connect to.

The two flags are separate because webhook delivery already carries a narrower loopback allowance: AgentPrismWebhookOptions.AllowInsecureHttp means “this is a local development setup” and opens loopback only, while AgentPrismEgressOptions.AllowPrivateNetworkTargets opens the entire private network. Collapsing them into one flag would trade production security for development convenience.

The address rules one outbound surface applies to its targets.

public EgressAddressPolicy(bool AllowPrivateNetworkTargets, bool AllowLoopback)

AllowPrivateNetworkTargets bool

Whether connecting to a private network address is allowed.

AllowLoopback bool

Whether loopback (127.0.0.0/8, ::1) is allowed even while AllowPrivateNetworkTargets is disabled.

Not to be confused with TenantEgressPolicy, which decides which model providers a tenant may call. This type decides which addresses a socket may connect to.

The two flags are separate because webhook delivery already carries a narrower loopback allowance: AgentPrismWebhookOptions.AllowInsecureHttp means “this is a local development setup” and opens loopback only, while AgentPrismEgressOptions.AllowPrivateNetworkTargets opens the entire private network. Collapsing them into one flag would trade production security for development convenience.

Whether loopback (127.0.0.0/8, ::1) is allowed even while AllowPrivateNetworkTargets is disabled.

public bool AllowLoopback { get; init; }

bool

Whether connecting to a private network address is allowed.

public bool AllowPrivateNetworkTargets { get; init; }

bool

Gets the policy that rejects every private network address.

public static EgressAddressPolicy Deny { get; }

EgressAddressPolicy

public void Deconstruct(out bool AllowPrivateNetworkTargets, out bool AllowLoopback)

AllowPrivateNetworkTargets bool

AllowLoopback bool

public override bool Equals(object obj)

obj object

bool

public bool Equals(EgressAddressPolicy other)

other EgressAddressPolicy

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(EgressAddressPolicy, EgressAddressPolicy)

Section titled “ operator ==(EgressAddressPolicy, EgressAddressPolicy)”
public static bool operator ==(EgressAddressPolicy left, EgressAddressPolicy right)

left EgressAddressPolicy

right EgressAddressPolicy

bool

operator !=(EgressAddressPolicy, EgressAddressPolicy)

Section titled “ operator !=(EgressAddressPolicy, EgressAddressPolicy)”
public static bool operator !=(EgressAddressPolicy left, EgressAddressPolicy right)

left EgressAddressPolicy

right EgressAddressPolicy

bool