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 domain or IP is reachable.

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.
UDP and QUIC (HTTP/3) are not supported for domain-level filtering. Domain rules apply only to TCP traffic on ports 80 and 443. Use IP/CIDR rules if you need UDP filtering.

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: