Bring your own proxy is currently in private beta.
If you’d like access, please reach out to us at support@e2b.dev.
- Give all sandbox traffic a stable, allowlistable source IP. E2B does not offer static egress IPs on any plan, see Egress IP ranges.
- Reach a corporate network, a VPN, or internal services that only accept traffic from your own network.
- Log or inspect sandbox egress in your own infrastructure.
How it works
- Tunneling happens on the host, after filtering. Your allow and deny lists are evaluated first, so a connection that
denyOutblocks never reaches your proxy. See Internet access for the filtering rules. - TCP only. UDP based traffic, including DNS and QUIC or HTTP/3, is not tunneled. It leaves the sandbox the usual way and stays subject to your allow and deny lists.
- Domain matched connections use remote DNS. When a connection is allowed by a domain entry in
allowOut, E2B hands the hostname to your proxy (SOCKS5ATYP=domain) rather than an IP, so your proxy does the final resolution. - Per-host request transforms still apply. Header injection and workload identity token resolution happen before the connection is dialed through your proxy.
- The proxy hostname is re-resolved at dial time and the resolved address is pinned for that connection, so a DNS change cannot redirect a connection that is already being established.
- Egress fails closed. If the proxy is unreachable, or the address does not speak SOCKS5, outbound connections from the sandbox fail instead of falling back to a direct connection. Make sure the proxy is reachable from the public internet before you point sandboxes at it.
Configuring a proxy
Passnetwork.egressProxy / network["egress_proxy"] when you create the sandbox:
api.example.com, and the traffic that is allowed goes through your proxy:
Fields
The proxy has to be reachable from E2B’s infrastructure. A hostname that does not resolve, or that resolves to a private or otherwise internal address range, is rejected at creation time, before the sandbox exists.
Updating a running sandbox
updateNetwork / update_network sets or replaces the proxy on a sandbox that is already running, with no restart:
Reading the current configuration
The sandbox info reports the active proxy undernetwork: