E2B Code Sandboxes

Open-source secure cloud sandboxes for running AI-generated code. Each sandbox is an isolated VM an agent can spin up, execute code in, and tear down. 12.4K GitHub stars as of 2026-05-31.

What it is

E2B gives AI agents a safe place to run code they write. An agent calls the SDK to start a sandbox - an isolated cloud VM with a filesystem, network, and common runtimes - executes arbitrary code or shell commands inside it, reads back stdout/stderr/files, and disposes of it. Because the code runs in an isolated VM rather than on the host, an agent can execute untrusted, model-generated code without risking the calling environment. The project describes itself as an "open-source, secure environment with real-world tools for enterprise-grade agents." Source: e2b-dev/E2B README, https://github.com/e2b-dev/E2B, 2026-05-31

Core capabilities

  • Sandbox SDK - Python and TypeScript SDKs to create, run code in, and manage sandboxes programmatically.
  • Fast startup - sandboxes are built on lightweight microVM isolation so an agent can create them on demand mid-run.
  • Stateful sessions - a sandbox persists across multiple tool calls, so an agent can install a package, then run code against it.
  • Custom templates - prebuild sandbox images with specific dependencies so recurring agent tasks skip setup.
  • Self-hostable - the core is open source, so the runtime can run on a team's own infrastructure. Source: e2b-dev/E2B, https://github.com/e2b-dev/E2B, 2026-05-31

Where it fits

E2B is the execution backend for the code-interpreter pattern: a LangGraph node or an OpenAI Agents SDK Sandbox Agent that needs to run generated Python hands the code to E2B and gets results back. It overlaps with Modal Labs sandboxes (Modal is a broader compute platform; E2B is sandbox-focused and OSS) and with Val Town (lighter, TS-function focused). For local AWS-shaped emulation rather than code execution, see Floci. Security scanners like Security and Review Skills address a different layer - finding bugs in code, not executing it.

E2B's isolation primitive is the Firecracker microVM — each sandbox is a hardware-isolated guest, which is why it's safe to run untrusted model-generated code. That places E2B squarely in the "microVMs, not containers" camp surveyed in Containers Are Not a Security Boundary; it bets most agent execution stays stateless (contrast persistent machines). Source: emirb.github.io/blog/microvm-2026, 2026-06-21


Timeline