Technical Guide

Sandboxing and Egress Security for AI Agents: A Guide

Sandboxing and egress security for AI agents: allow-lists, dedicated IPs, long-lived sandboxes and OpenBox, an AI agent security and governance platform.

Published on

Subscribe to our newsletter

By submitting your email, you agree to our Privacy Policy and consent to receiving updates from us

Sandboxing and Egress Security for AI Agents: Do You Need Dedicated IPs?

By Tahir Mahmood, Co-founder & CTO, OpenBox ยท Last updated 4 December 2026

In brief: Sandboxing and egress security for AI agents limit what an agent can touch and where it can send data. A destination allow-list restricts connections, while a dedicated IP gives the receiving side a stable address to recognize. OpenBox, an AI agent security and governance platform, adds runtime verdicts to outbound requests from NVIDIA OpenShell sandboxes, with documented coverage limits.

What are sandboxing and egress security for AI agents?

Sandboxing and egress security for AI agents are two linked controls. Sandboxing runs the agent in an isolated environment that limits which files and processes it can touch. Egress security limits what leaves that environment and where it can go.

Our working model splits the design into four questions.

Question

Control

What it leaves open

Where can the agent connect?

Default-deny egress allow-list

What is sent to an allowed destination

What source address does the other side see?

Dedicated or static egress IP

Which destinations the agent can reach

Is this particular request acceptable?

Runtime verdict on the request

Traffic the verdict layer does not inspect

How long does the environment live?

Ephemeral, long-lived or paused sandbox

What survives, and which rules apply on resume

 

For the wider picture, start with what AI agent governance is.

Why do AI agents need network-level egress control?

An AI agent that can read data and open network connections has a route to send that data out. Claude Codeโ€™s sandboxing documentation puts it this way: โ€œEffective sandboxing requires both filesystem and network isolation.โ€ It warns that, without network isolation, a compromised agent could exfiltrate files such as SSH keys.

In Kubernetes, a pod is non-isolated for egress by default, so outbound connections are allowed. A NetworkPolicy, which works at the IP address or port level, has no effect without a controller that implements it. E2B states that its sandboxes have outbound internet access by default.

Anthropicโ€™s containment guidance for its Cyber Verification Program, marked private beta, recommends running autonomous agents in a strong sandbox. Its advice on the network is short: โ€œDeny egress by default.โ€ In its reference design, egress is enforced outside the guest.

Do AI agent sandboxes need dedicated IPs?

You need a dedicated IP when a destination filters by source address, such as a partner firewall that accepts only listed IPs. Dedicated IPs for AI agent sandboxes give that destination a stable address to recognize. On their own, they do not limit where the agent can connect.

Provider documentation for E2B, Blaxel, Cloudflare and AWS differs on stable egress addresses, as checked on 4 December 2026.

Provider

Stable egress address

Scope to note

E2B

No dedicated or static egress IPs on any plan, including Enterprise; source IPs rotate

E2B suggests tunneling through a proxy you own for one stable IP

Blaxel

Dedicated egress gateways attach IP addresses exclusively to sandboxes in your workspace

Private preview, not intended for production use; sandboxes only; assigned at creation

Cloudflare

Dedicated egress IPs are static and assigned exclusively to your account

Add-on to Zero Trust Enterprise plans only

AWS

A public NAT gateway must have an Elastic IP address associated at creation

A VPC building block for instances in private subnets

 

Source and destination are separate settings. E2Bโ€™s own FAQ points to per-sandbox allow and deny lists when the goal is restricting where a sandbox can go.

How does an egress allow-list limit agent data exfiltration?

An egress allow-list for AI agents names the destinations an agent may reach. Under default deny, connections to unlisted destinations are refused, which narrows the places an agent can send data. It does not by itself judge what goes to an allowed destination. Check how hostnames, wildcards and ports are matched.

NVIDIA OpenShellโ€™s policy documentation says โ€œOpenShell denies anything the policy does not allow.โ€ Network rules pair destinations with the binaries that may reach them. With protocol: rest, a rule can allow GET requests while blocking POST and DELETE. OpenShell also blocks private network addresses by default, with documented exceptions for exact hostnames.

What a domain allow-list can miss

A domain allow-list can leave gaps through broad domains, hostnames without TLS inspection, wildcards, and ports or protocols it does not cover.

โ€ข Broad domains. Claude Codeโ€™s documentation warns that allowing domains such as github.com can create exfiltration paths.

โ€ข Hostnames without TLS inspection. By default, Claude Codeโ€™s built-in proxy does not inspect TLS, so sandboxed code can potentially use domain fronting to reach hosts outside the allowlist.

โ€ข Wildcards. OpenShell advises exact hostnames, because a wildcard can expose a DNS-label exfiltration channel.

โ€ข Ports and protocols. E2B domain filtering covers HTTP on port 80 and TLS on port 443. Other ports use CIDR rules, and QUIC is not supported for domain filtering.

An allowed destination can still receive a harmful request. We explore that problem in why blocking bad prompts fails on dual-use actions.

Long-lived or ephemeral sandbox for security-scanning agents?

Our recommendation: use an ephemeral sandbox when a scan finishes in one run and nothing needs to survive. Use a long-lived sandbox for security-scanning agents, or pause and resume, when the workspace must carry across stages. Check runtime limits, restored state and network rules.

What is a long-lived sandbox for agents?

A long-lived sandbox for agents can mean continuous runtime or retained state. Those are different promises. For example, E2B documents continuous runtime up to 24 hours on Pro and 1 hour on Hobby. Its pause saves filesystem and memory by default.

Platform

Runtime or lifecycle

What carries over

Modal

Default maximum lifetime of 5 minutes; up to 24 hours with the timeout parameter

For longer runs, Modal recommends Filesystem Snapshots restored into a new Sandbox

E2B

Continuous runtime up to 24 hours on Pro, 1 hour on Hobby; pause and resume resets the window

Pause saves filesystem and memory by default; paused sandboxes are kept until killed unless you set retention

OpenShell

Stop releases the running container, pod or VM; start returns the same sandbox

Policies, provider attachments, settings, service definitions and persistent workspace data

OpenSandbox

Pause on Kubernetes commits the root filesystem as an OCI image

Resume recreates the runtime from that image

 

An OpenShell restart-policy replacement does not restore process memory or terminal history. OpenSandboxโ€™s auto-pause is opt-in, limited to its Fast Sandbox backend and needs version 1.2.0 or later. It counts new HTTP requests through the ingress, not open WebSocket or SSE streams. For silent background work, its docs offer an activeProbe.

After any resume, we recommend re-checking egress rules, agent credentials and their lifetime, and run limits.

Where does CONSTRAIN fit in sandboxed agent execution?

CONSTRAIN is the OpenBox governance decision that lets an action proceed under a limit, instead of simply allowing or blocking it. The limit can be a sandbox. On OpenShell, redact, narrow and strip_headers constraints rewrite the request first, while run_in_sandbox is met by the sandbox itself. It is one of five governance decisions: ALLOW, CONSTRAIN, REQUIRE_APPROVAL, BLOCK and HALT.

How it reaches your network depends on the integration. On Temporal, OpenBox attaches as a worker-level plugin that captures workflow and activity events and evaluates each operation. The protocol-aware runtime governance page describes enforcement at the moment of action against identity, policy and risk.

How OpenBox governs egress from NVIDIA OpenShell sandboxes

OpenBox for OpenShell is an MIT-licensed integration: two services installed with one Helm chart beside the OpenShell gateway. A door guard asks OpenBox for verdicts; a front desk attaches it to new sandboxes. Our OpenShell egress governance post covers the design.

The getting-started guide says model calls, tool calls and web requests get a verdict before leaving, with exceptions below. The integration is built for OpenShell v0.1.8. The OpenShell repository already tags later releases, so test your version.

Outcome

What happens to the request

What the agent sees

Allow

Goes out

The normal response

Allow with a constraint

Goes out rewritten

The response to the rewritten request

Block

Does not go out

HTTP 403, openbox_blocked

Require approval

Does not go out yet

HTTP 403, openbox_approval_required; an identical retry passes after approval

Halt

Does not go out; the sandbox is stopped if the gateway API credential is set

HTTP 403, openbox_halted

No verdict in time

Does not go out

HTTP 403, openbox_unavailable

Still deciding after 2 seconds

Does not go out yet

HTTP 403, openbox_pending; an identical retry gets the verdict

 

On OpenShell, the agent is already sandboxed. Under request controls, a CONSTRAIN verdict with run_in_sandbox goes out unchanged; the sandbox itself meets that constraint. A constraint the door guard cannot meet leads to denial.

You write policies, guardrails and Behavioral Rules on the agent, and they apply to its sandboxes. Related reading: OPA Rego for tool calls and the AI agent kill switch ladder.

Optional fast-path verdicts can answer from local rules or a recent verdict. If Core later refuses a request that a fast path allowed, it has already gone. Local rules default to shadow mode.

What OpenBox for OpenShell does not cover

OpenBox for OpenShell has documented limits that affect raw TCP, WebSocket messages, model-call timing and approvals.

โ€ข Raw TCP and tls: skip hosts get an allow or deny by host and port only.

โ€ข WebSocket messages after the upgrade are scored locally, not by Core. Binary messages and messages from the destination are not inspected.

โ€ข A model-call verdict takes 3 to 8 seconds, per the OpenShell reference; repository install notes attribute that figure to staging.

โ€ข Approval is deny-then-retry, so agents need to handle the 403 and retry.

Core receives request metadata, including the URL and query string, so keep secrets out of URLs. The default content capture setting sends a hash, kinds of sensitive data and JSON shape instead of body text. With a signing key, the door guard also writes signed, hash-chained verdict records. Session-level attestation is documented separately.

FAQ

What is OpenSandbox?

OpenSandbox is an Apache 2.0 licensed Agentic AI Foundation project. It provides isolated environments where AI applications run code and commands and work with files. Its egress sidecar shares the sandboxโ€™s network namespace. DNS filtering is the default, and a dns+nft mode adds strict default-deny enforcement at the packet layer.

Does blocking a response undo what an agent already sent?

No. In OpenBox for OpenShell, blocking a response keeps its content out of the sandbox, but the upstream call has already run. The door guard checks responses locally. Compressed responses carry no readable body and are delivered unjudged, so block risky requests with policy.

Can an agent switch off OpenBox checks from inside an OpenShell sandbox?

Not by changing sandbox policy, according to the OpenShell reference. The front desk attaches OpenBox to each new sandbox and refuses a policy where that entry is missing or does not fail closed. It also refuses automatic approval of agent-written policy proposals. Hosts marked tls: skip are left out.

What happens to agent requests if OpenBox is unreachable?

By default, OpenBox for OpenShell fails closed: requests that get no verdict are denied. Without a working door guard, governed HTTP traffic is refused. The operations guide states there is no fail-open setting. It does document a break-glass procedure for operators, during which sandbox traffic is not governed.

Where to start with sandboxing and egress security for AI agents

Start with default-deny destinations. Add a dedicated IP where a receiving system asks for one. Then decide which outbound actions need a runtime verdict, and write down the traffic that verdict does not cover. That order is our recommendation.

To see a verdict at the boundary, the See It Block a Request walkthrough runs an OpenBox-governed OpenShell gateway on your own Mac. Other integrations are listed in the OpenBox Developer Guide. Act before the request leaves: governance starts where monitoring ends.

 

Sources

All accessed 4 December 2026.

โ€ข OpenBox Docs, Governance Decisions. https://docs.openbox.ai/core-concepts/governance-decisions

โ€ข OpenBox Docs, Getting Started with OpenShell. https://docs.openbox.ai/getting-started/openshell

โ€ข OpenBox Docs, OpenShell Reference. https://docs.openbox.ai/developer-guide/openshell

โ€ข OpenBox Docs, OpenShell Request Controls. https://docs.openbox.ai/developer-guide/openshell/controls

โ€ข OpenBox Docs, OpenShell Operations. https://docs.openbox.ai/developer-guide/openshell/operations

โ€ข OpenBox Docs, Attestation and Cryptographic Proof. https://docs.openbox.ai/administration/attestation-and-cryptographic-proof

โ€ข OpenBox, openbox-openshell repository. https://github.com/OpenBox-AI/openbox-openshell

โ€ข OpenBox, Temporal and AI agent governance. https://www.openbox.ai/blog/temporal-and-ai-agent-governance

โ€ข OpenBox, Protocol-Aware Runtime Governance. https://www.openbox.ai/features/protocol-aware-runtime-governance

โ€ข OpenShell, repository. https://github.com/ai-openshell/openshell

โ€ข OpenShell, Policies overview. https://github.com/ai-openshell/openshell/blob/main/docs/how-it-works/policies/overview.mdx

โ€ข OpenShell, Network rules. https://github.com/ai-openshell/openshell/blob/main/docs/how-it-works/policies/network-rules.mdx

โ€ข OpenShell, Sandboxes overview. https://github.com/ai-openshell/openshell/blob/main/docs/how-it-works/sandboxes/overview.mdx

โ€ข OpenSandbox, repository. https://github.com/opensandbox-group/OpenSandbox

โ€ข OpenSandbox, Egress. https://github.com/opensandbox-group/OpenSandbox/blob/main/docs/architecture/network/egress.md

โ€ข OpenSandbox, Pause and Resume. https://github.com/opensandbox-group/OpenSandbox/blob/main/docs/guides/pause-resume.md

โ€ข OpenSandbox, Auto-Pause and Wake-on-Access. https://github.com/opensandbox-group/OpenSandbox/blob/main/docs/guides/auto-pause-wake.md

โ€ข Claude Code Docs, Sandboxing. https://code.claude.com/docs/en/sandboxing

โ€ข Claude Help Center, Agent containment best practices: sandboxing. https://support.claude.com/en/articles/17316105-agent-containment-best-practices-sandboxing-private-beta

โ€ข Kubernetes, Network Policies. https://kubernetes.io/docs/concepts/services-networking/network-policies/

โ€ข E2B, Egress IP ranges FAQ. https://docs.e2b.dev/faq/egress-ip-ranges

โ€ข E2B, Internet access. https://docs.e2b.dev/network/internet-access

โ€ข E2B, Sandbox lifecycle. https://docs.e2b.dev/sandbox

โ€ข E2B, Sandbox persistence. https://docs.e2b.dev/sandbox/persistence

โ€ข Blaxel, Dedicated egress gateways. https://docs.blaxel.ai/Infrastructure/Dedicated-egress-gateways

โ€ข Cloudflare, Dedicated egress IPs. https://developers.cloudflare.com/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips/

โ€ข AWS, NAT gateways. https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html

โ€ข Modal, Sandboxes. https://modal.com/docs/guide/sandbox

Trustworthy AI
Starts Here

By submitting your email, you agree to our Privacy Policy and consent to receiving updates from us

Trustworthy AI
Starts Here

By submitting your email, you agree to our Privacy Policy and consent to receiving updates from us

Trustworthy AI
Starts Here

By submitting your email, you agree to our Privacy Policy and consent to receiving updates from us

Trustworthy AI
Starts Here

By submitting your email, you agree to our Privacy Policy and consent to receiving updates from us

Build secure and governed agents!

ยฉ 2026 OpenBox AI. All rights reserved.

Build secure and governed agents!

ยฉ 2026 OpenBox AI. All rights reserved.

Build secure and governed agents!

ยฉ 2026 OpenBox AI. All rights reserved.

Build secure and governed agents!

ยฉ 2026 OpenBox AI. All rights reserved.