# 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.

Website: https://e2b.dev

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-interpreter` SDK makes it `Sandbox.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](/glossary/computer-use).
- **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

```bash
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](/glossary/ai-agent) 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](/tools/daytona)'s multi-OS speed play, [Modal](/tools/modal)'s broader compute platform, and [Vercel Sandbox](/tools/vercel-sandbox)'s ecosystem integration: [Sandboxing AI-Generated Code](/guides/advanced/sandboxing-ai-generated-code).

---

_Source: https://agentscamp.com/tools/e2b — Tool on AgentsCamp._
