Firecracker won the argument about how to safely run untrusted code. AWS built it to isolate Lambda and Fargate tenants, open-sourced it, and now it's the substrate under a growing list of sandbox APIs aimed at AI agents and code execution. That's good news — the isolation question is roughly settled — but it makes buying harder, not easier, because 'we use Firecracker' has become table stakes rather than a differentiator. This is a 2026 roundup of the Firecracker-based (or Firecracker-capable) sandbox APIs worth knowing, judged by the criteria that actually separate them once the isolation model is a given.
The field here: PandaStack (our project — open-source Firecracker microVMs, self-hostable), E2B, Modal, Fly.io Machines, and AWS Lambda as the archetype where Firecracker was born, plus the option of running Firecracker yourself. Rather than crown a winner, we'll set the selection criteria first, then give each platform an honest section — strengths and trade-offs — with a per-platform quick-compare line. The general roundup that includes non-Firecracker options (gVisor, Kata) is Best Code Execution Sandboxes for AI Agents (2026); this one stays inside the Firecracker family.
Why Firecracker is the shared foundation
Firecracker is a minimal Rust virtual machine monitor (VMM) that boots stripped-down Linux guests in tens of milliseconds. The reason it dominates untrusted-code workloads: each sandbox is a real hardware-virtualized microVM with its own guest kernel, isolated by KVM. Guest code never touches the host kernel directly — the exposed surface is the small, better-audited VMM and a handful of virtio devices, not the full Linux syscall interface a shared-kernel container exposes. For code your AI agent wrote itself (untrusted by definition), that's the right default. The deeper background is in What is a microVM? Firecracker, isolation, and why agents need it and Firecracker vs Docker: which one runs untrusted code?.
But 'built on Firecracker' tells you almost nothing about the product wrapped around it. Two platforms can share the exact same VMM and still differ completely on boot path, forking, self-hostability, egress control, and pricing shape. Those wrappers are the whole decision. So before comparing anyone, work out which of the following criteria is forcing your hand.
The selection criteria
Every platform here will run a Python script and hand you stdout. The differences that decide fit live in a handful of places — rank them by which matters to you, because the right answer flips depending on which one you lead with:
- Isolation model — all are microVM-class here, so this is mostly a given; the nuance is jailer/seccomp hardening and per-sandbox network isolation on top of the VM boundary.
- Cold-start / create latency — how long create() blocks inside your agent loop, and whether the figure reflects a true cold boot, a snapshot resume, or a warm pool.
- Snapshot and fork support — whether copy-on-write forking and snapshots are first-class primitives (huge for tree-search and agent rollouts) or absent.
- Self-host option — can you run the whole thing on your own KVM hosts, or is it hosted-only? And is 'self-host' genuinely open-source or a proprietary control plane?
- Pricing model — metered CPU/memory/creations/egress, per-second vs wall-clock, and crucially how idle time is billed.
- SDK ergonomics — how clean the create/exec/filesystem loop is, and whether the same code can target hosted and self-hosted.
- Network egress control — whether you can restrict a sandbox's outbound access at the network layer, which matters the moment your threat model includes exfiltration.
PandaStack
PandaStack is an open-source (Apache-2.0) Firecracker platform you can self-host on any Linux box with /dev/kvm. Its defining design choice is that there is no warm pool of idle VMs: every create restores a baked Firecracker snapshot on demand — a snapshot that already contains a booted kernel, a running guest agent, and an open network stack — so 'starting' a sandbox is really 'restore memory pages and resume.' That lands at 179ms p50, roughly 203ms p99 (restore itself ~49ms), with the only slow path being the first-ever spawn of a brand-new template, which cold-boots in about 3s and bakes the snapshot every create after uses. Forking is first-class and copy-on-write: same-host forks run 400–750ms, cross-host 1.2–3.5s, which is the primitive that makes 'warm the environment once, fork it N times' cheap for agent rollouts and tree-search.
Each sandbox is its own Firecracker microVM with its own guest kernel and per-sandbox networking (its own Linux netns, veth pair, and tap from 16,384 pre-allocated /30 subnets per agent), so egress control is a network-layer knob rather than an afterthought. Beyond raw sandboxes it bundles managed PostgreSQL (each database its own microVM; create takes 30–90s), git-driven app hosting, and serverless functions on the same substrate. The honest trade-off: self-hosting is real operational weight — KVM hosts, an agent fleet, networking, snapshot storage. If you have no infra appetite, a hosted-only provider is genuinely less work, and that's a legitimate reason to look elsewhere. There's a hosted PandaStack too, and the same binaries and a configurable SDK base URL mean identical code targets either.
from pandastack import Sandbox
# One microVM per untrusted run: create, exec, read a result back out.
with Sandbox.create(template="code-interpreter", ttl_seconds=300) as sbx:
# Write model-generated code into the guest filesystem.
sbx.filesystem.write("/workspace/analyze.py", (
"import pandas as pd\n"
"df = pd.DataFrame({'city': ['NYC', 'SF', 'LA'], 'pop_m': [8.3, 0.87, 3.9]})\n"
"df.sort_values('pop_m', ascending=False).to_json('/workspace/out.json')\n"
"print('rows:', len(df))\n"
))
result = sbx.exec("python3 /workspace/analyze.py", timeout_seconds=30)
print("exit:", result.exit_code)
print("stdout:", result.stdout)
# Pull the artifact back as bytes.
out = sbx.filesystem.read("/workspace/out.json")
print(f"pulled {len(out)} bytes")
# sandbox is destroyed on block exit- PandaStack — Isolation: Firecracker microVM, own guest kernel, per-sandbox netns. Self-host: yes, Apache-2.0, on your own KVM hosts. Snapshot/fork: first-class CoW (400–750ms same-host). Best fit: teams that want to own an open-source Firecracker substrate end-to-end and lean on fast forking.
E2B
E2B is a focused, mature sandbox platform built on Firecracker microVMs, aimed squarely at AI code execution. Its strength is being deliberately narrow — a clean sandbox primitive with well-worn SDKs and good documentation, hosted-first so you get zero infrastructure to operate on day one. Its core is Apache-2.0 and self-hostable, which puts it in the same open-source camp as PandaStack, though most teams adopt the hosted service. If you want a battle-tested default that does one thing well and don't need the surrounding platform (managed databases, app hosting), E2B is a strong pick. The trade-off is that focus: if your product also needs a per-tenant database or a place to host the app on the same substrate, you'll be assembling that yourself. Verify current isolation details, snapshot/persistence semantics, and licensing against E2B's own docs, since those evolve — see PandaStack vs E2B: Choosing an AI Sandbox Provider for the head-to-head.
- E2B — Isolation: Firecracker microVM (confirm current details in their docs). Self-host: yes, Apache-2.0 core, though hosted-first. Snapshot/fork: supported; check current semantics in their docs. Best fit: teams wanting a focused, mature hosted sandbox with an open-source escape hatch.
Modal
Modal is a hosted serverless compute platform oriented around AI/ML — GPU jobs, batch inference, and a Sandbox primitive for running untrusted code. Worth a caveat up front for a Firecracker roundup: Modal's own security docs describe gVisor (a user-space kernel that mediates guest syscalls), not Firecracker, as its isolation model. It's included here because it's a common contender in the same buying conversation, and gVisor is a meaningful step up from a plain container — just a different bet from a hardware-virtualized microVM. Modal's strength is when the sandbox is incidental to a larger scale-out compute story: if your real workload is GPU-heavy ML and you want it fully managed with the sandbox as one feature among many, Modal fits. The trade-off is that it's hosted-only (no self-host path) and the isolation model differs from the microVM family, which matters if microVM-class isolation is a hard requirement. Confirm the current isolation backend in Modal's docs before deciding — see PandaStack vs Modal: which for AI code execution?.
- Modal — Isolation: gVisor per its docs (not Firecracker); verify current. Self-host: no, hosted-only. Snapshot/fork: check current docs. Best fit: scale-out AI/ML compute where the sandbox is incidental and full management is the goal.
Fly.io Machines
Fly.io Machines are fast-launching VMs that are widely reported to be Firecracker-based, consistent with Fly's broader platform, and they've become a popular substrate for building your own sandbox layer. The strength is a general-purpose VM primitive with a strong global-edge story and a persistence model where a Machine can hold state and scale to zero when idle — a genuinely different bet on the same isolation tech than snapshot-restore-on-every-create with no warm pool. If you're building a product where long-lived, stateful, per-user environments are the core requirement and you want them close to users geographically, Machines are a compelling foundation. The trade-off is that they're a lower-level VM primitive than a purpose-built sandbox API — you'll build the sandbox ergonomics (exec plumbing, artifact readback, fork orchestration) yourself, and it's hosted-only. Confirm the current isolation backend and persistence behavior on Fly's docs, since 'Firecracker-based' is reported rather than always front-and-center.
- Fly.io Machines — Isolation: widely reported Firecracker-based; verify on their docs. Self-host: no, hosted-only. Snapshot/fork: persistence-oriented (scale-to-zero); not a fork-first primitive. Best fit: long-lived, stateful, edge-local environments where you'll build the sandbox layer yourself.
AWS Lambda (the archetype)
Lambda is where Firecracker was born — AWS built the VMM specifically to isolate Lambda and Fargate tenants at scale, then open-sourced it. It's included here as the archetype, not because it's a general-purpose code-execution sandbox API: Lambda gives you a managed function runtime, not a create-a-VM-and-exec-arbitrary-commands primitive. The strength is obvious — it's proven at enormous scale, deeply integrated into AWS, and you never think about the microVM underneath. If your untrusted-code need actually fits the function-invocation shape (short, event-driven, bounded runtime, within Lambda's execution limits), it's a rock-solid managed option. The trade-off is fit: it's not designed as an interactive sandbox with a filesystem you push files into and pull artifacts out of, forking isn't a primitive you control, execution time and package-size limits constrain it, and the Firecracker layer is entirely opaque to you. For agent loops that want a real shell and a persistent-ish environment, a purpose-built sandbox API is the better shape. Verify current Lambda limits and isolation guarantees in AWS's own documentation.
- AWS Lambda — Isolation: Firecracker (opaque to you); the original use case. Self-host: no, hosted-only AWS. Snapshot/fork: not a user-facing primitive. Best fit: short, event-driven, bounded function invocations rather than interactive agent sandboxes.
Self-hosting Firecracker directly
You can also skip the platforms and run Firecracker yourself — it's Apache-2.0, well-documented, and the SDKs exist. This is the maximum-control option: you own every decision about kernels, rootfs, networking, and snapshot storage. The catch is that Firecracker is a VMM, not a platform. Everything the products above wrap around it — a control-plane API, a scheduler, per-sandbox network allocation, snapshot/fork orchestration, a guest agent for exec and filesystem access, lifecycle and reaping — is yours to build and operate. That's a real engineering investment, and most teams underestimate it. It's the right call when you have specific requirements no platform meets and the appetite to build the layer yourself; for almost everyone else, adopting a platform (open-source so you still own the substrate, or hosted so you own nothing) is the better trade. PandaStack exists precisely because we built that platform layer and decided to open-source it — see Best Open-Source Sandboxes for Running Untrusted Code for the OSS building blocks.
- Self-hosted Firecracker — Isolation: microVM, fully under your control. Self-host: yes, it's a VMM you run. Snapshot/fork: native Firecracker snapshots, orchestration is yours to build. Best fit: teams with specific needs no platform meets and the engineering appetite to build the platform layer.
How to actually choose
The isolation model is roughly settled across this family — microVM-class isolation is the correct foundation for untrusted agent code, and the Firecracker-based options already clear that bar (Modal being the gVisor exception). So decide on the criteria above the isolation boundary. If self-host or open-source ownership is non-negotiable, that shortlists you to PandaStack, E2B, or rolling your own. If forking into many parallel branches is your core pattern, weight first-class CoW forking heavily. If you need long-lived stateful environments, a persistence-first design fits better than snapshot-restore-per-create. If the sandbox is incidental to a bigger managed-compute story, a broader hosted platform may win. And if your need is genuinely function-shaped, the archetype itself might be enough.
The bottom line
There's no single best Firecracker sandbox API — there's a best one for your constraints, and the field agrees on the thing that matters most (hardware-virtualized isolation for untrusted code) while diverging on everything above it. PandaStack's bet, for the record, is an Apache-2.0 Firecracker core you run end-to-end on your own hardware — snapshot-restore on every create (179ms p50), first-class CoW forking (400–750ms same-host), per-sandbox networking, and managed services on one substrate. E2B is the focused hosted-first sibling; Modal is the gVisor-based managed-compute play; Fly.io Machines are the persistence-and-edge foundation you build on; Lambda is the proven function-shaped archetype; and rolling your own is maximum control at maximum operational cost. Start from the criterion forcing your hand, shortlist two, and benchmark them against your real workload before committing.