E2b
Open-source Firecracker-microVM sandboxes where AI agents safely execute untrusted code — stateful code interpreters with full Linux, pause/resume, and desktop VMs.
E2B is the category-defining agent sandbox: Firecracker microVMs your agent spins up to run untrusted code — stateful Python/JS interpreters with rich outputs, full Linux terminals, package installs, pause/resume persistence, and a Desktop Sandbox for computer-use agents. SDKs and the production infra are Apache-2.0 (self-hostable); the hosted cloud is freemium with per-second billing.
E2B named the category: when agents started writing code that had to run somewhere, "somewhere" needed to be disposable, isolated, and fast. E2B's answer — Firecracker microVMs behind a two-line SDK — became the default pattern, with Perplexity, Hugging Face, and Groq among the users its Series A announced.
Highlights
- Code-interpreter sandboxes — run LLM-generated Python/JS (Ruby and C++ too) with rich outputs including charts; the
e2b-code-interpreterSDK makes itSandbox.create()+run_code(...). - A full Linux VM per sandbox — terminal, package installation, filesystem, internet: agent workflows that need a real computer, not just an eval().
- Pause/resume persistence — full state preserved indefinitely; long-running agent jobs park and resume across the session caps.
- Desktop Sandbox — cloud Linux desktops with a GUI, purpose-built for computer-use agents.
- Open infrastructure — SDKs and the production cloud stack are Apache-2.0; self-hosting the real thing is supported, not theoretical.
- Per-second economics — pay for CPU/RAM by the second; a free Hobby tier (with one-time credits) covers development.
In an AI-assisted workflow
pip install e2b-code-interpreter # or: npm i @e2b/code-interpreter
# export E2B_API_KEY=...
# sbx = Sandbox.create(); sbx.run_code("import pandas as pd; ...")The integration point is the agent's "execute code" tool: generated code goes to the sandbox, stdout/results come back as observations — the agent loop with the dangerous part outsourced.
NOTE
Two SDK layers trip up first-timers: e2b is the base sandbox SDK; e2b-code-interpreter adds the run-code conveniences most agent builders want. (And the repo is uppercase E2B; packages are lowercase.)
Good to know
$21M Series A led by Insight Partners (July 2025). Hobby sessions cap at one hour (pause/resume or Pro for longer); sandboxes are Linux-only including desktops. How it compares to Daytona's multi-OS speed play, Modal's broader compute platform, and Vercel Sandbox's ecosystem integration: Sandboxing AI-Generated Code.
Frequently asked questions
- What is E2B used for?
- Giving agents a safe computer. The canonical case is the code interpreter: the LLM writes Python, E2B executes it in an isolated microVM and returns results (including charts), so generated code never touches your infrastructure. Beyond that: full Linux terminals for agent workflows, data analysis over uploaded files, and cloud desktops for computer-use agents.
- Is E2B open source?
- Genuinely, by sandbox-category standards: the SDKs AND the production cloud infrastructure are Apache-2.0 (e2b-dev/infra), so self-hosting the real stack is possible. The turnkey experience is their hosted cloud — free Hobby tier with one-time credits, then per-second compute billing and a Pro tier for longer sessions and more concurrency.
- How do sessions and persistence work?
- Sandboxes are stateful while running (Hobby caps sessions at 1 hour, Pro at 24), and pause/resume preserves the full filesystem and memory state indefinitely — so an agent can park a sandbox and pick it up days later. Two SDK layers exist: the base e2b SDK and e2b-code-interpreter with the run-code niceties.
Related
- Sandboxing AI-Generated Code: E2B vs Modal vs Daytona vs Vercel SandboxWhere should agent-written code run? The four sandbox platforms compared — isolation models, persistence, economics — plus the design rules that keep execution safe.
- DaytonaSub-90ms agent sandboxes — isolated computers with snapshots, volumes, Git and LSP tools, on Linux, Windows, or Android; AGPL self-host or managed cloud.
- ModalServerless AI infrastructure in pure Python — GPU functions with sub-second cold starts, secure sandboxes for agent code, batch jobs, and per-second billing.
- Vercel SandboxEphemeral Firecracker microVMs on Vercel for untrusted and AI-generated code — millisecond startup, Node and Python runtimes, persistent by default.
- Computer UseComputer use is an AI agent operating software through its real interface — reading the screen, moving the cursor, clicking, and typing like a person would.
- Agent EngineeringAgent engineering is the discipline of building reliable AI agents — designing the tools, context, guardrails, evals, and recovery paths around the model.