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>
Name Type Default Description
policy EgressPolicy Required Egress 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
Name Type Description
allowedHosts string[] Hosts explicitly allowed by the policy.
deniedHosts string[] Hosts explicitly denied by the policy.
mode EgressMode Whether the policy uses an allowlist or denylist.