AI agents · OpenClaw · self-hosting · automation

Quick Answer

Egress Control for AI Agents: Stop Malicious Destinations

Published:

The short answer

An AI agent that can reach any host can send your data to any host. Prompt injection makes that a when, not an if. The egress control strategies that actually prevent agents from reaching malicious destinations, as of October 26, 2026:

  1. Deny by default. No outbound traffic unless a rule allows it.
  2. Allow named domains through a proxy that inspects SNI or the Host header — not DNS alone.
  3. Block private, link-local and metadata addresses (for example 169.254.169.254) so the agent cannot scan or pivot inside your network.
  4. One identity and one allowlist per agent, enforced on the proxy.
  5. Log allowed and denied connections to storage the agent cannot touch.

The tool that enforces them depends on where the agent runs. Our step-by-step guide to locking down agent egress covers the rollout; this page compares the tools.

The tools compared

ToolWhere it runsHow it enforcesPriceBest for
Anthropic sandbox-runtime (srt)Your laptop or server, no containerOS sandbox (macOS sandbox-exec, Linux bubblewrap, Windows WFP fence) + proxy domain allowlist; also filesystem rulesFree, open source (beta research preview)Local coding agents, MCP servers
Stripe SmokescreenA proxy you deployHTTP CONNECT proxy; hostname ACLs; refuses internal IPs; identifies clients by mTLS certificate for per-client ACLsFree, open sourceFleets of agents in your own infrastructure
OpenSandbox egress sidecarDocker or KubernetesPer-sandbox egress policy, dns+nft enforcement, deny-by-default; optional Credential VaultFree (Apache 2.0)Self-hosted agent sandboxes
E2BManaged cloud (or its open runtime)One Firecracker microVM per sandbox with an nftables egress firewall and SNI/Host-inspecting domain allow and deny listsHobby $0 with $100 one-time credit; Pro $150/month + usageHosted sandboxes for agent products

Prices and features from each project’s documentation and pricing page on October 26, 2026.

Anthropic sandbox-runtime — best for local agents

srt was built for Claude Code and released as an open-source research preview. You run srt "<command>" and the whole process tree gets the restrictions: outbound HTTP and HTTPS only to allowed domains, reads and writes only where you permit, Unix sockets controlled. Its README shows the canonical demo — curl anthropic.com succeeds, curl example.com is “blocked by network allowlist”, cat ~/.ssh/id_rsa fails with “Operation not permitted”. It is the quickest way to sandbox a local MCP server: replace the command in .mcp.json with srt and pass the original command as arguments. Because APIs may still change, pin a version.

Stripe Smokescreen — best central proxy

Smokescreen is the proxy Stripe uses for most of its own outbound traffic. Two properties make it a good agent egress gateway: it only connects to allow-listed hostnames, and it resolves each name and refuses non-public IP addresses, which stops an agent from being used to scan your internal network. Clients authenticate with mTLS, and Smokescreen checks each client’s requested destination against its own ACL — that is your one-allowlist-per-agent control. Centralising egress also gives you stable outbound IPs for partners to allowlist.

OpenSandbox — best self-hosted sandbox platform

OpenSandbox (Alibaba, donated to the Agentic AI Foundation on October 22, 2026) attaches an egress sidecar to every sandbox. The docs are explicit about two pitfalls: use defaultAction="deny" and allow every host you need, and run the sidecar in dns+nft mode, because DNS-only filtering can be bypassed by connecting to an IP directly. Its Credential Vault then injects real credentials into allowed requests while the sandbox only holds fakes — egress control and credential brokering in one place.

E2B — best managed option

If you would rather not run infrastructure, E2B gives every sandbox its own Firecracker microVM, cgroup and network namespace, with a per-sandbox nftables egress firewall and SNI/Host-inspecting allow and deny lists. Sandboxes bill per second (about $0.000014 per vCPU-second and $0.0000045 per GiB-second of RAM); Hobby is free with a one-time $100 credit and 20 concurrent sandboxes, Pro is $150 a month for 100 concurrent sandboxes and 24-hour sessions.

The mistakes that defeat egress control

  • Allowing whole platforms. github.com, *.googleusercontent.com or a pastebin let an injected agent upload data to an account the attacker controls. Allow API paths, not platforms, where the proxy supports it.
  • Trusting DNS. See OpenSandbox’s warning above; enforce at the packet or proxy layer.
  • Forgetting the metadata endpoint. A cloud agent that can reach the instance metadata service can often fetch the instance’s credentials.
  • Logging where the agent can write. An agent that can edit its own logs can hide what it did.
  • Handing the agent the secret. Egress control limits where data goes; a broker limits what the agent can steal. Use both — see best tools for brokering secrets to AI agents at runtime.

How to choose

  • A coding agent on your machine: sandbox-runtime.
  • Many agents in your VPC or cluster: Smokescreen as the single egress gateway, with mTLS per agent.
  • You run agent sandboxes on Kubernetes: OpenSandbox with dns+nft and Credential Vault.
  • You are building an agent product and want sandboxes as a service: E2B; compare others in best AI agent sandboxes.

Last verified: October 26, 2026.

Sources