Network policies are available on the Developer, Team, and Enterprise plans, including deny-by-default policies and credential brokering. A sandbox created without a policy on these plans has unrestricted egress.On the Free plan, every sandbox uses a managed allowlist: egress is denied by default, except to package registries, Git hosts, container registries, OS package mirrors, and model provider APIs. You can’t set your own policy on Free.
default to deny. On top of this, you can apply additional deny and allow rules to whitelist certain targets. For example:
Domain filtering
Domain rules match hostnames, which the firewall reads from HTTP and TLS traffic on any port. Once a policy has a domain rule, connections that don’t carry a hostname, such as SSH or database connections, are blocked unless you allow their IP address or CIDR, even withdefault: "allow". HTTP/3 is blocked when domain filters or drain_on_pause selectors are in place. For HTTPS, the firewall reads the server name (SNI) from the TLS ClientHello and passes an allowed connection through still encrypted. For plain HTTP, it checks the Host header and the URI authority of every request. If the name is denied, the connection or request is rejected.
Plain allow and deny domain rules do not decrypt TLS, so they need no extra certificate in the sandbox.
TLS inspection
Some rules act on the HTTP requests themselves, so the egress proxy has to decrypt them. It terminates TLS only for hosts that match one of these:- An allow rule with a
transformthat adds headers (credential brokering). - An allow rule with a
forward_url(egress forwarding). - A
drain_on_pauseselector.
SSL_CERT_FILE, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, and AWS_CA_BUNDLE pointing at the system bundle (/etc/ssl/certs/ca-certificates.crt), which includes the Archil CA, and NODE_EXTRA_CA_CERTS pointing at the Archil CA (/usr/local/share/ca-certificates/archil-egress.crt). Values you set yourself take precedence, so a custom bundle must include the Archil CA.
Free plan allowlist
On the Free plan, every sandbox uses a managed policy: egress is denied by default, except to these destinations:- Package registries for Python (PyPI), JavaScript (npm, Yarn, jsDelivr, unpkg), Rust (crates.io), Go (the Go module proxy), Ruby (RubyGems), and Java (Maven Central).
- Git hosts: GitHub, including release and raw file downloads, GitLab, and Bitbucket.
- Container registries: Docker Hub, GitHub Container Registry, and Quay.
- OS package mirrors for Debian, Ubuntu, and Alpine.
- Model provider APIs: Anthropic, OpenAI, Google Gemini, Mistral, xAI, Groq, DeepSeek, Together AI, Fireworks AI, Cohere, and OpenRouter.
getNetwork returns the exact hostnames, and the API marks the policy with managed: true. The allowlist uses plain domain rules, so it does not decrypt TLS or install the Archil CA.
You can’t set your own policy on the Free plan. Creating a sandbox with a network.egress policy, or updating a sandbox’s network, fails with sandbox_network_plan_required (HTTP 403). After you upgrade to Developer or above, sandboxes created on Free keep the managed allowlist until you replace their policy.
Credential brokering
For HTTP egress, we also support defining rules for transforming requests. This means that secret credentials can live outside the sandbox, so untrusted workloads cannot access them directly. For example, you can add API keys to outgoing HTTP requests so your sandbox never sees them:Egress forwarding
Useforward_url on an allow rule to send matching requests to your own gateway. Applications inside the sandbox keep using the original API hostname, while your gateway can apply logging, usage limits, or request filtering before contacting the upstream service.
https://api.openai.com/v1/responses?trace=1 is sent to https://gateway.example.com/archil/v1/responses?trace=1. Archil appends the original path and query to the gateway URL’s path prefix and streams the request body and response. Your gateway decides whether to call the original upstream or return its own response.
The transform adds your gateway token before forwarding, so the gateway can authenticate the request without exposing the token to code inside the sandbox.
Archil also overwrites these headers on forwarded requests:
Use these headers to identify the original destination and sandbox. Authenticate with the gateway token;
the metadata headers alone do not prove that a request came from Archil.
Forwarding works with domain allow rules for HTTP on port 80 and HTTPS on port 443. HTTPS clients must trust the
Archil egress CA. Deny rules still take precedence. See
Create Sandbox for URL restrictions and
Dynamic Updates to change an existing sandbox’s policy.
Dynamic Updates
A running sandbox’s complete network policy can be replaced withupdateNetwork, and getNetwork returns the current policy. A new policy applies to new connections; existing connections stay open. For example you can:
- initially pull data from an S3 bucket
- deny all egress while an agent is running
- run a verifier and upload evaluation results
Draining requests before pause
To let in-flight requests to selected hosts finish before a sandbox pauses, list them indrain_on_pause when creating
the sandbox:
* matches anywhere, "*" selects every
host, and a leading *. excludes the apex domain. Selectors do not grant network access. When the sandbox pauses, new
requests to selected hosts are held and active HTTP(S) responses, including streams, get up to ten minutes to finish
before the snapshot is taken. Draining covers ports 80 and 443; clients should retry stale connections after resume.
Set selectors at creation, since connections opened before a policy update are not intercepted.