Skip to main content
PUT
Set a template's egress policy

Authorizations

X-API-Key
string
header
required

An Anona Compute API key (ac_ followed by lowercase hex; older keys start with e2b_).

Path Parameters

templateID
string
required

Body

application/json

An egress policy in the E2B wire shape. Unknown keys are refused.

allow_internet_access
boolean
allowOut
string[]

IPs, CIDRs or exact host names to allow. Wildcard names such as *.example.com are refused with 400.

denyOut
string[]

IPv4 addresses or CIDRs to block; 0.0.0.0/0 blocks all public egress

dnsServers
string[]

Sandboxes always resolve through 1.1.1.1 and 1.0.0.1. Another IPv4 address here is allowed as a destination when allowOut has a host name and public egress is off; the free plan accepts only those two.

rules
object

Per-host header transforms: {host: [{transform: {headers: {Name: "Bearer ${vault.name}"}}}]}. Each key is one exact host (a wildcard is refused with 400), and each header value one vault placeholder (a literal value is refused with 400).

allowPublicTraffic
boolean

Response

Stored and compiled.

scope
enum<string>
required
Available options:
tenant_default,
template,
sandbox,
tenant_ceiling
scopeID
string
required
revision
integer
required
compiled
object

The policy as it is enforced.

warnings
string[]