Skip to main content
Each sandbox runs in its own Linux network namespace with a dedicated TAP device and veth pair. Outbound traffic passes through a Layer-7 TCP proxy that enforces your network policy before packets reach the internet.

Default behavior

By default, sandboxes have unrestricted outbound internet access. Any public domain or IP is reachable. Two things are always blocked, regardless of policy: cloud metadata endpoints, and private address ranges (RFC 1918, carrier-grade NAT, link-local), which sandboxes have no legitimate reason to reach.

Block all outbound traffic

ALL_TRAFFIC is a constant equal to "0.0.0.0/0". Adding it to deny_out blocks everything.

Domain allowlist

Allow only specific domains and block everything else.

Wildcard domain matching

Use *. prefix to match all subdomains.
When domain filtering is enabled, DNS queries to 8.8.8.8 are automatically allowed so that domain resolution works. You do not need to add it manually.

IP and CIDR rules

Use IP addresses or CIDR ranges directly when you know the destination IPs.

Combined domains and IPs

Domain and IP rules can be mixed in the same allow_out list.

Priority rules

Allow rules always take precedence over deny rules, regardless of order.
The evaluation order is:
  1. If the destination matches any allow_out entry, the connection is permitted.
  2. If the destination matches any deny_out entry, the connection is rejected.
  3. If no rule matches, the connection is permitted by default (unless deny_out=[ALL_TRAFFIC]).

SandboxNetworkOpts model

Host header masking

Use mask_request_host to override the Host header on all outbound requests. Useful when routing traffic through an internal proxy.

How enforcement works

Domain and IP rules are enforced at two layers:
  • Layer 3/4: IP and CIDR rules are applied as kernel-level DROP rules with no userspace proxy overhead.
  • Layer 7 (TCP proxy): For domain-based rules, all TCP traffic is redirected to the per-namespace proxy. HTTP Host headers and TLS SNI fields are inspected before forwarding.
Domain allowlists apply to TCP only (ports 80 and 443, inspected by SNI/Host). UDP and QUIC (HTTP/3) to the addresses a domain resolves to are dropped — a domain rule never permits UDP, because the proxy can only tell one site from another on a shared CDN address over TCP. To allow UDP to a destination, list its IP or CIDR in allow_out (an IP entry permits every protocol to that address).When a content scanner (PII, prompt injection, etc.) is enabled, outbound HTTP/3 (UDP/443) is blocked — including to IPs and CIDRs listed in allow_out — so requests fall back to TCP, where the scanners run. Other UDP is unaffected.

Block cloud metadata service

Cloud instances expose a metadata endpoint at 169.254.169.254. This is automatically blocked in all sandboxes to prevent SSRF attacks.

Inbound traffic (port proxy)

The network policy controls outbound traffic. For inbound HTTP access to ports inside a sandbox, see Port Proxy. Inbound access is gated by the allow_public_traffic field in NetworkPolicy (defaults to true).

Using SecurityPolicy network configuration

For richer network control integrated with PII scanning and audit logging, use NetworkPolicy inside a SecurityPolicy: