Drop-in E2B replacement built for production AI agents.
Keep your exact E2B Sandbox & Code Interpreter code with a 1-line import swap — then unlock CoW repo hot-forks, zero-egress governance, Time-Travel Replay with human takeover, 135-tool Hosted MCP, and RLVR Spot NVIDIA GPUs.
Switch from E2B in 1 line
Swap `e2b_code_interpreter` for `stateset_e2b_compat` (or `@stateset/e2b-compat` in TypeScript) or run the automated CLI codemod.
npx @stateset/sandbox-cli migrate --from e2b --mode compatBefore (E2B Python)
from e2b_code_interpreter import Sandbox
with Sandbox.create() as sbx:
res = sbx.run_code("print(sum(range(100)))")
print(res.text)After (StateSet 1-line drop-in)
from stateset_e2b_compat import Sandbox
with Sandbox.create() as sbx:
res = sbx.run_code("print(sum(range(100)))")
print(res.text)StateSet Sandbox vs E2B: architecture & capability breakdown
| Capability | StateSet Sandbox v2.18 | E2B |
|---|---|---|
| Warm start & live execution | ~419ms warm gVisor boot (1.03s median create -> first stdout in prod) | Fast warm templates, no CoW repo snapshots |
| Kernel & Network Isolation | gVisor + zero-egress K8s NetworkPolicies + Envoy allowlists | Firecracker microVM, manual egress rules |
| CoW Repo Build Caches | Native CSI VolumeSnapshot instant hot-forks | Manual template rebuilds |
| Ephemeral Service Sidecars | 1-click Postgres, Redis, Playwright, LocalStack + PR visual previews | Not built in |
| Multi-Agent Swarm Orchestration | 5 harnesses (Claude Code, Codex, Gemini, OpenCode, AGY) + Verify->Fix oracle + path leases | DIY orchestration |
| Time-Travel Replay & Takeover | Built-in asciicast + diff timeline + live human takeover (tko_) | Logs only |
| Enterprise Governance & Compliance | Policy-as-Code PR gates, Ed25519 SLSA v1.0 provenance, BYOC VPC Runner | Basic org controls |
| RLVR & Serverless Spot GPUs | Batch .map() on Spot T4 / L4 / A100 / H100 + pre-baked gpu-pytorch & gpu-rl templates + CSI model caches | CPU-first focus |
| Hosted Streamable HTTP MCP | 135-tool Hosted mcp.sandbox.stateset.app/mcp (RFC 9728 OAuth, 1-click Cursor & Claude Code) | Local stdio wrapper |
| Multi-Language SDK Parity | 10/10 zero-gap SDKs (TS, Python, Go, Rust, Ruby, PHP, Java, C#, Swift, Elixir) + 5 compat adapters | JS/TS & Python primary |
Frequently asked migration questions
How fast can I migrate existing E2B code to StateSet Sandbox?
Under 60 seconds. Install @stateset/e2b-compat (TypeScript) or stateset-e2b-compat (Python), set STATESET_API_KEY, and swap your import line — or run `npx @stateset/sandbox-cli migrate --from e2b --mode compat`.
Does StateSet Sandbox support persistent filesystems, pause/resume, and snapshots?
Yes. StateSet supports durable PVC-backed workspaces, CSI VolumeSnapshots, instant sandbox forking, and per-repo CoW build caches so coding agents never re-run cold git clone or npm ci.
Can I enforce zero internet egress or strict domain allowlists?
Yes. Zero-egress sandboxes are enforced at both Envoy ext-authz and Kubernetes NetworkPolicy level (`sandbox-pods-isolated`), with cluster/restricted DNS excluded for fully air-gapped runs.
Ready to benchmark StateSet against E2B on your real workload?
Sign up for $25 in trial credits, test live on gVisor in seconds, or compare all platforms side by side.
Explore RLVR & Post-Training Infrastructure
Batch .map() trajectory grading, pre-baked gpu-pytorch & gpu-rl templates, and Model-Weight CSI caches.
Connect 135-Tool Hosted MCP in 10 Seconds
Zero local server. RFC 9728 OAuth and 1-Click Add to Cursor, Claude Code, Windsurf, or AGY.