Learning resourcesReviewed · E2B

E2B sandbox internet access guide

This E2B documentation page shows developers who use E2B sandboxes to run code how to block or limit those environments' outbound internet access; domain filters only cover HTTP on port 80 and TLS on port 443 and automatically allow a DNS server unless configured otherwise. It covers Python and JavaScript settings, changes to running sandboxes, and beta HTTPS header injection.

Researched 15 Nov 2026

In short.

This E2B documentation page helps developers who use E2B sandboxes to run code restrict those environments' outbound internet access, but DNS exceptions and settings that reset during updates require careful configuration. Outbound access starts enabled, allow rules override deny rules, and domain filtering applies only to HTTP on port 80 and TLS on port 443. The guide also covers beta HTTPS header transforms, proxy-held credentials and certificate handling after resume. Pricing, licensing and minimum SDK versions are unknown from this page. No examples were executed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected Internet access page at [https://docs.e2b.dev/network/internet-access.md], including outbound controls, domain and DNS behavior, wildcard matching, blocked TCP connections, beta transforms, limits, certificate handling and configuration updates. Linked pages, including the documentation index, public URLs, proxy setup, secrets, workload identity and external client documentation, are excluded. No code was executed, network behavior verified or security boundary independently assessed.

The overview

Identity

Internet access is an E2B documentation guide for developers who use E2B sandboxes to run code and need to control those environments' outbound internet connections [https://docs.e2b.dev/network/internet-access.md]. It explains how to permit, restrict and update connections initiated from a sandbox, with Python and JavaScript/TypeScript examples.

The resource is a feature guide rather than a complete introduction to E2B. Exposing a sandbox service through a public URL is a separate topic referenced by the page.

Assessment

The guide is useful for developers deciding which external services sandboxed code may contact. Its strongest practical detail is the explanation of exceptions: domain filtering automatically permits a DNS server, allowed destinations override deny rules, and network updates replace existing configuration.

Its documented controls should not be interpreted as proof of strict destination isolation. The page warns that shared infrastructure can expose additional destinations and that an apparently successful TCP connection does not establish that traffic reached its target. Security effectiveness for a particular application remains unassessed.

Users

The likely audience is developers operating E2B sandboxes, especially those executing sensitive or untrusted code while permitting access to selected APIs. Beginners get concrete configuration examples; experienced developers get details about DNS exceptions, hostname matching, TLS interception and configuration replacement.

It is particularly relevant when applications need a small set of external destinations or credentials added outside the sandbox. Readers needing account setup, installation instructions or a broader comparison of sandbox platforms will need additional information.

Capabilities

Developers can disable outbound internet access or configure exceptions using IP addresses, CIDR address ranges, domain names and wildcard domains. Running sandboxes support network updates without a restart. Domain filtering also supports choosing allowed DNS servers or permitting none.

Beta per-host transforms can add headers to matching HTTPS requests. Values can reference stored secrets through Secret.fill or workload identity tokens that the proxy supplies outside the sandbox. Registering a transform does not itself permit network access to its host.

The page also documents host-matching precedence, fixed transform limits, certificate trust configuration and behavior when a sandbox resumes.

Using it

Requirements

The examples assume access to E2B and its e2b SDK for Python or JavaScript/TypeScript. This page does not specify installation commands, authentication steps, supported language versions, minimum SDK versions or account-tier requirements.

Changing the sandbox's resolver configuration or hosts file uses commands run as root in the examples. Applications using HTTPS transforms must trust the E2B proxy certificate authority. Clients with separate certificate bundles may require explicit configuration.

Stored secrets and workload identity tokens require additional configuration described on linked pages; those setup details are not established here.

Mechanism

Outbound access is enabled by default. Setting allowInternetAccess or allow_internet_access to a falsy value is documented as equivalent to denying 0.0.0.0/0. Explicit allow rules take precedence over deny rules, which supports denying general access while permitting selected destinations.

Domain filtering inspects the HTTP Host header on port 80 or TLS Server Name Indication, the hostname supplied during a TLS connection, on port 443. Other ports use IP/CIDR filtering. UDP protocols such as QUIC/HTTP3 are not supported for domain filtering.

When a domain appears in the allow list, E2B also permits all traffic to 8.8.8.8 by default, not just DNS requests. An explicit deny entry for that address does not remove this exception. dnsServers or dns_servers can replace it with up to ten IPv4 addresses or an empty list.

HTTPS transforms work through TLS interception by the egress proxy. Exact host rules beat wildcard rules; the most specific wildcard wins, and matching rules are never merged. A wildcard such as *.example.com covers deeper subdomains but excludes example.com itself.

Setup

For workloads needing no external connections, the documented starting point is disabling internet access at creation. For restricted access, configure a deny-all rule and explicit allowed destinations. The guide recommends the allTraffic or all_traffic selector callback for expressing the deny-all address range.

Choose DNS behavior explicitly when allowing domains. A custom DNS list opens firewall access but does not change /etc/resolv.conf, which still points to 8.8.8.8. Using another resolver therefore also requires editing that file. With no DNS server permitted, the guide describes mapping required names to public addresses in /etc/hosts and clearing /etc/resolv.conf to avoid delayed lookup failures.

For HTTPS transforms, clients may need REQUESTS_CA_BUNDLE or NODE_EXTRA_CA_CERTS pointed at /etc/ssl/certs/ca-certificates.crt. Node.js reads its setting at process startup. Clients that cache certificates may need to reload trust or restart after resume because the proxy CA can change.

Treat every updateNetwork or update_network call as a complete replacement. Include all intended allow rules, deny rules, transforms and custom DNS settings on every update; omitted fields are cleared or reset to defaults.

Example

A documented Python pattern is to import Sandbox from e2b and call Sandbox.create(allow_internet_access=False) when no outbound access is needed.

Following the page's domain-filtering pattern, a configuration such as Sandbox.create(network={"allow_out": ["api.example.com"], "deny_out": lambda ctx: [ctx.all_traffic]}) permits the example hostname for HTTP on port 80 and TLS on port 443 while denying other destinations, subject to the documented DNS exception and shared-endpoint limitations. api.example.com is a placeholder.

Adding "dns_servers": [] removes the automatic DNS-server allowance. Programs still need a way to resolve permitted names, such as the hosts-file configuration described in the guide. These examples were not executed, and no live connection result is established.

Assessment & evidence

Limitations

Domain names are supported in allow lists only, and domain filtering requires a deny-all rule. Shared infrastructure such as CDNs or object storage can permit access to additional destinations on the same endpoint. The page recommends dedicated endpoints or restrictions enforced through a user-operated proxy for stricter isolation.

The catch-all domain wildcard matches numeric HTTP Host values as well as named hosts. HTTPS requests to an IP address without TLS SNI remain blocked unless an IP allowance exists. Traffic to permitted DNS-server addresses remains open across protocols.

Transforms apply only to intercepted HTTPS traffic. Broad wildcard transform rules can send injected credentials to every matching destination. Rules allow ten domains per sandbox, one transform rule per domain and twenty headers per rule. Domain keys are limited to 128 characters, header names to 64 and header values to 2,048. The limits are fixed; exceeding them fails creation or update.

Transform callbacks must be synchronous and return a plain transform object. A bare wildcard, ports in rule keys, malformed wildcard keys and duplicate keys differing only by case are rejected. Per-host transforms remain in public beta.

A blocked TCP connection may appear open inside the sandbox even though no packets reach the destination. Application-level responses are needed to assess reachability. Creation-only options, including allowPublicTraffic, maskRequestHost and httpsPorts, cannot be changed on a running sandbox.

Reasoning

The documented behavior supports using an explicit, complete network configuration rather than relying on the term allow list alone. A permitted domain can coexist with unrestricted traffic to a resolver, while a later partial update can remove restrictions or restore default DNS access.

Proxy-side secret and token substitution can keep credential values outside sandbox code. It does not remove the need to restrict matching hosts, scope credentials and validate destinations. This follows from the page's warnings about broad wildcards and shared endpoints.

For practical verification, an expected HTTP response or successful TLS handshake is more informative than a socket-open result. No execution evidence establishes how these controls behave for a particular workload.

Alternatives

Within the documented options, disabling outbound access is the simplest fit for a workload needing no external services. IP/CIDR rules accommodate destinations or protocols outside domain filtering's supported ports. Domain rules suit hostname-based HTTP and HTTPS access, with the documented DNS and shared-endpoint caveats.

The page points to routing permitted traffic through a user-operated SOCKS5 proxy [https://docs.e2b.dev/network/byop.md]. Its configuration, costs and effectiveness are outside this page. No competing sandbox products are compared.

Evidence

The source is the complete E2B Internet access documentation page [https://docs.e2b.dev/network/internet-access.md], captured at 2026-11-15T12:44:01.144Z. The captured source revision is sha256:c583af40b936c5b9d5d9de7a35372293d4e19a3e4b8a1c6ca143d442f3309c02.

The page supplies configuration examples, documented limits and operational warnings. It supplies no independent security evaluation, performance measurements or runtime test results. No code was executed, and linked documentation was not assessed.

Access & freshness

Costs

The page provides no sandbox pricing, network charges, subscription requirements or costs for transforms, secrets or workload identity. Total operating cost is unknown.

Per-host transforms are described as publicly available beta functionality without an access request. That statement does not establish that they or the underlying service are free.

Rights

No documentation license, code-example license, SDK license or redistribution permission appears in the supplied page. Reuse and redistribution rights are unknown.

Service terms, data-processing terms and contractual security commitments are also not established by this resource.

Freshness

The capture establishes the page's contents on 15 November 2026. The page gives no publication date, last-update date or SDK version pin, so compatibility with a particular installed release is unknown.

Per-host transforms are explicitly in public beta, with possible changes to features and interfaces. The page also says the apparent-success behavior of blocked TCP connections may change. Configuration details should therefore be checked against the SDK release used for deployment.

Actions

List the external hosts, ports and protocols the application requires, then choose disabled access, IP/CIDR rules or domain rules accordingly. For domain rules, decide explicitly whether a resolver should be reachable and account for all traffic allowed to that resolver's address.

Keep a complete network configuration for every update. Before relying on it, verify permitted and blocked application-level requests, DNS behavior, settings after updates and certificate handling after resume. For transforms, check exact and wildcard host coverage and keep credential scopes narrow.

Confirm supported SDK versions, authentication requirements, pricing and applicable licenses separately; this page does not establish them.

Evidence for this report

selected-page.txtselected · checked 2026-11-15