Skip to main content
By default, a sandbox’s public URL is reachable by anyone who knows it. For sensitive workloads, you can require callers to authenticate with a per-sandbox token before any request reaches the services inside.

Restricting public access to sandbox URLs

By default, sandbox URLs are publicly accessible. You can restrict access to require authentication using the allowPublicTraffic / allow_public_traffic option:
When allowPublicTraffic / allow_public_traffic is set to a falsy value, all requests to the sandbox’s public URLs must include the e2b-traffic-access-token header with the value from sandbox.trafficAccessToken / sandbox.traffic_access_token.

Running a firewall inside the sandbox

If you are using custom iptables or firewall rules inside a sandbox, keep E2B’s own connectivity open or the sandbox will lose contact with the SDK:
  • All loopback (lo) traffic.
  • Inbound TCP to port 49983 (the envd control channel).
  • Inbound TCP to port 49999, if you use the Code Interpreter template.
  • Established and related connections, if you filter outbound traffic.