OpenSandbox network architecture has two distinct control planes. The egress plane enforces per-sandbox outbound policy through a sidecar that runs alongside the sandbox container, intercepting DNS queries and blocking connections to disallowed destinations. The ingress plane routes external HTTP traffic into sandbox instances running on Kubernetes, giving callers a stable URL for each sandbox port. Together, these two planes let you precisely control what a sandbox can reach on the internet while also making sandbox-hosted services accessible from outside the cluster.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/opensandbox-group/OpenSandbox/llms.txt
Use this file to discover all available pages before exploring further.
Egress Policy
The egress sidecar runs in the same network namespace as the sandbox container. It operates a DNS proxy on127.0.0.1:15353, redirecting all port-53 traffic through iptables rules. Allowed domains are resolved normally; denied domains return NXDOMAIN. In dns+nft mode, resolved IP addresses for allowed domains are also added to an nftables allow set with TTL, enforcing policy at the network layer as well.
The egress sidecar requires
[egress].image to be set in the OpenSandbox server configuration. Without this setting, sandboxes created with a network_policy will fail to start. Contact your platform administrator if you receive an error about a missing egress image.Creating a Sandbox with a Network Policy
Pass anetwork_policy object at sandbox creation time to attach the egress sidecar and define the outbound allowlist. Any domain not listed in egress rules is blocked by default when defaultAction is "deny".
network_policy parameter structure as JSON:
- FQDN:
api.github.com - Wildcard subdomain:
*.pypi.org - IP address:
10.0.0.5 - CIDR range:
10.244.0.0/16
Getting and Patching Egress Rules at Runtime
You can inspect and modify a sandbox’s egress policy after creation without restarting the sandbox.Default-Deny Behavior
WhendefaultAction is set to "deny", any domain not explicitly listed in the egress rules is blocked. Blocked connection attempts fail with a DNS NXDOMAIN response for denied hostnames. In dns+nft mode, packets to non-allowed IPs are dropped at the network layer even if DNS resolution somehow succeeds.
The sidecar also supports static deny.always and allow.always rule files baked into the egress image. These files have higher priority than any user-defined network_policy and cannot be overridden at runtime — useful for platform-wide enforcement of cluster-internal CIDR isolation.
Kubernetes In-Cluster Services
WhendefaultAction is "deny", reaching a Kubernetes Service requires both DNS and network layer allowances:
Ingress Gateway
The ingress gateway routes external HTTP and WebSocket traffic into sandbox instances running on Kubernetes. It provides a stable, authenticated URL for each sandbox port without requiring the sandbox Pod to be directly reachable from outside the cluster.How It Works
Every sandbox container runsexecd on port 44772. execd bundles a lightweight reverse proxy that intercepts requests with the /proxy/{port} prefix and forwards them to 127.0.0.1:{port} inside the same container. This means a single host port (or ingress rule) per sandbox is sufficient to reach all container ports.
The ingress gateway supports two routing modes:
| Mode | How routing works |
|---|---|
| Header mode | The gateway reads a sandbox-ID header and dispatches to the correct pod |
| URI mode | The sandbox ID is embedded in the URL path for clients that cannot set custom headers |
Getting Endpoint URLs
Useget_endpoint() to retrieve the public URL for a specific port on a running sandbox:
Single-Host Routing
In single-host (Docker bridge) mode, onlyexecd’s proxy port (44772) is published on the host. All sandbox container ports are reachable through the proxy path:
get_endpoint(port=X)returns{public_host}:{host_proxy_port}/proxy/{X}- HTTP, Server-Sent Events, and WebSocket traffic all share the same mapped host port
- No additional ports need to be published, simplifying firewall management
If
execd’s proxy port (44772) or the optional 8080 host mapping is missing, get_endpoint() responds with HTTP 500 and a message stating which mapping was unavailable.Full Example: Egress Policy with Credential Vault
The following example combines a network policy with Credential Vault to run Claude Code inside a sandbox. Onlyapi.anthropic.com and registry.npmjs.org are reachable; all other outbound traffic is denied.
Runtime Compatibility
The egress sidecar uses an iptablesnat table REDIRECT rule for DNS interception. This is supported by runc (default) and all Kata Containers variants (kata-qemu, kata-clh, kata-fc), but not by gVisor — gVisor’s netstack does not implement the nat table. The OpenSandbox server returns HTTP 400 if you request network_policy together with secure_runtime.type = "gvisor".
For full runtime compatibility details, see the Secure Runtimes guide.