e2b-dev/runtime

The runtime behind every E2B stack: Cloud, Enterprise, and your own machine.

What it solves

E2B Runtime provides a secure, isolated environment for AI agents to execute untrusted code. It eliminates the slow boot times of traditional virtual machines by using snapshot-based restoration, allowing agents to have their own dedicated Linux machines that can be paused, resumed, and forked almost instantly.

How it works

The system uses Firecracker microVMs that boot from pre-booted templates stored in object storage. Instead of booting a kernel from scratch, it restores a VM snapshot. Memory pages are loaded lazily via userfaultfd and the root filesystem uses a copy-on-write overlay, ensuring only necessary data is fetched.

Architecturally, it separates the control plane (API) from the data plane (orchestrator and edge router), so sandbox traffic bypasses the API for lower latency. Inside each VM, a specialized agent called envd provides a REST and Connect RPC API for managing processes, filesystems, and port forwarding.

Who it’s for

  • Agent developers who need precise control over their execution environment and the ability to run the same runtime locally and in production.
  • Platform teams requiring agent execution within their own cloud accounts to avoid "black box" infrastructure.
  • Infrastructure engineers interested in high-performance VM snapshotting, lazy memory restore, and Firecracker orchestration.

Highlights

  • Hardware-isolated sandboxes: Each session gets a Firecracker microVM with its own network namespace and egress firewall.
  • Instant Pause and Resume: Sandboxes can be paused (diffed against the template and stored) and resumed transparently when traffic arrives.
  • Sandbox Forking: Ability to checkpoint a live sandbox and start up to a hundred new instances from that state.
  • Custom Templates: Build environments from Docker images and build steps with cached layers.
  • Integrated Observability: Full OpenTelemetry export for lifecycle events and host metrics into ClickHouse.

Related

  • Project
  • Project
  • Project
  • Project