AI code-execution sandbox

E2B

E2B is a Firecracker-microVM sandbox that gives AI agents a secure, ~150ms-cold-start environment to run generated code, with pause/resume and filesystem snapshots.

Last verified 2026-07-26

E2B is an SDK-first, security-led option in the AI sandbox category. Each session is an isolated Firecracker microVM with per-second billing, memory-state pause/resume and snapshots. Its TypeScript and Python SDKs are well-documented and widely adopted, and it is an official OpenAI Agents SDK provider.

Key specs

IsolationFirecracker microVM
Cold start150ms
Price / vCPU-hr$0.05
Pricing modelPer-second usage + plan
GPUNo
Session limitUp to 24h
PersistencePause/resume with memory state, snapshots
LanguagesPython, JavaScript/TypeScript, any (custom templates)
MCP supportn/a
IntegrationsOpenAI Agents SDK, LangChain, Vercel AI SDK
DeploymentManaged cloud (self-host available)
Free tier$100 one-time credit (Hobby)
Pro plan$150/mo
BillingPer second

Strengths

  • Clean, well-documented TS/Python SDK
  • Strong Firecracker isolation
  • Pause/resume + snapshots
  • Official OpenAI Agents SDK provider

Trade-offs

  • No in-sandbox GPU
  • Pro plan starts at $150/mo

Best for: Teams that want the cleanest SDK and strong microVM isolation for agent code execution.

How E2B works

E2B runs each session inside its own Firecracker microVM, the same lightweight hardware virtualization used for serverless functions, so agent-generated code executes behind a real kernel boundary rather than in a shared-kernel container. Cold start is around 150ms. Sessions can run up to 24 hours, and you can pause one to keep its memory state or take a filesystem snapshot and resume later. Billing is per second. The TypeScript and Python SDKs are the main interface, and E2B is an official OpenAI Agents SDK provider, which makes it a natural pick when isolation for untrusted code is the priority.

Pricing in practice & watch-outs

Billing is per second at about $0.05 per vCPU-hour, so the bill largely follows active compute. The paid Pro plan starts at $150 a month, a real jump from the $100 one-time Hobby credit once you move past prototyping. The other limit is hardware: there is no GPU inside the sandbox, so accelerated inference has to run on a separate service and reach the sandbox over the network. For CPU-bound agent code execution the pricing is easy to reason about. For GPU work, E2B is not the tool.

Head-to-head

Alternatives to E2B

See the full E2B alternatives comparison →

Sources: E2B pricing ↗ · E2B docs ↗

Is E2B right for your workload?

Tell us your use case and we'll confirm the fit, flag anything to watch for, and get you real pricing from the E2B team. No spam.