MicroVMs
Firecracker vs Cloud Hypervisor for agent sandboxes
Firecracker vs Cloud Hypervisor for agent sandboxes: device models, memory snapshots, live resizing, and why the provider's API matters more than the monitor.
Firecracker is a deliberately small microVM monitor built for functions and containers. Cloud Hypervisor is a cloud VM monitor with CPU, memory and device hotplug. Both snapshot memory. For an agent sandbox, what matters is which of those features the provider's API actually gives you.
E2B and Vercel Sandbox run on Firecracker. Platinum runs on Cloud Hypervisor.
The two designs#
| Firecracker | Cloud Hypervisor | |
|---|---|---|
| Built for | Lambda- and Fargate-style workloads (AWS) | Modern cloud VMs (started at Intel, now a Linux Foundation project) |
| Devices | Minimal: virtio block, net and vsock | Virtio, plus PCI hotplug and passthrough |
| Memory snapshots | Guest RAM and device state | VM snapshot and restore |
| Memory changes while running | Balloon, within the boot allocation | Hotplug or virtio-mem, within reserved headroom |
| CPU changes while running | Not documented | Hotplug on x86, up to a boot-time maximum |
Sources, checked November 2026: Firecracker design, ballooning and snapshots; Cloud Hypervisor hotplug and snapshot/restore.
A small device model is not security on its own. Firecracker's design also relies on seccomp and its jailer, and leaves network filtering to the host.
Memory snapshots are not disk copies#
Firecracker saves guest memory and device state; the operator manages disks separately. Restored pages load on demand. Network connections may not survive a restore, and open vsock connections close. Cloud Hypervisor restores need coordinated storage and matching configuration.
For an agent, separate three operations:
| Operation | What comes back | Plan for |
|---|---|---|
| Stop and resume with memory | Heap, processes and disk | Reconnecting sockets, renewing tokens |
| Disk snapshot, then boot | Files | Restarting processes |
| Fork | Whatever the provider documents | A filesystem branch is not a process branch |
On Platinum, stop saves memory when it can and says so in memory_saved and restore. Snapshots, clones and forks are disk-only. Cloud Hypervisor's RAM snapshots do not change that API.
Ballooning is not hotplug#
Firecracker's balloon takes memory back from the guest and returns it, but only within the boot allocation. It never adds RAM, and a compromised guest driver can ignore it.
Cloud Hypervisor can add memory into headroom reserved at boot. With virtio-mem it can also remove memory, partially if the guest cannot free enough. CPU hotplug needs a boot-time maximum and a guest that brings the new CPUs online.
Platinum exposes live CPU and memory resize within the headroom set at boot. A shrink can return partial: true. An unsupported change returns 409 sandbox_not_resizable. A 202 means pending: read the new size back before starting the bigger job.
The provider's API decides#
| Provider | Monitor | What the docs promise |
|---|---|---|
| E2B | Firecracker | Pause and resume with full state |
| Vercel Sandbox | Firecracker | Persistent sandboxes that save on stop |
| Platinum | Cloud Hypervisor | Its own kernel per sandbox; stop reports whether memory was saved; forks are disk-only |
Two Firecracker services make different promises. The monitor alone tells you nothing about persistence.
Compare boot paths, not boot claims#
A monitor's boot time is not your agent's wait. A create can include placement, image fetch, guest init and a network round trip. A restore skips init but pays later in page faults. Compare the same endpoint (first command completed) on the same path (cold boot or restore). Platinum's sub-second starts are measured on its status page.
Which to pick#
- Building your own function runner with fixed resource shapes: Firecracker. The small device model, jailer and snapshots are a focused base.
- Operating cloud VMs that need hotplug: Cloud Hypervisor.
- Buying a sandbox service: ask what survives stop, what survives fork, what can change live, and what happens when recovery falls back to a fresh boot. See agent sandboxes compared, and the E2B and Daytona pages.