Skip to content

Egress

Read and update runtime outbound network policy.

class EgressManager

This type is created by the SDK; do not construct it directly.

const manager = runtime.egress;

Return the cached egress policy.

EgressManager.get(): Promise<EgressPolicy>
  • Promise<EgressPolicy>

Replace the complete egress policy and return refreshed runtime metadata.

EgressManager.setPolicy(policy: EgressPolicy): Promise<RuntimeInfo>
NameTypeDefaultDescription
policyEgressPolicyRequiredEgress policy to apply.
  • Promise<RuntimeInfo>
await runtime.egress.setPolicy({
mode: "allowlist",
allowedHosts: ["api.github.com"],
deniedHosts: [],
});

Describes which outbound hosts a runtime may or may not reach.

interface EgressPolicy
NameTypeDescription
allowedHostsstring[]Hosts explicitly allowed by the policy.
deniedHostsstring[]Hosts explicitly denied by the policy.
modeEgressModeWhether the policy uses an allowlist or denylist.