Firecracker is open source, it is what Lambda and many sandbox products run on, and the getting-started guide gets a microVM booting on a suitable host in an afternoon. So it is reasonable to ask: why not run our own agent sandboxes on it?
You can. This post lists what that takes, using the Firecracker repository's own docs as of November 2026: getting started, network setup, production host setup, the jailer, kernel policy and snapshot support. Then it compares that with a hosted sandbox, using Sandscale as the example. We have an obvious interest here, so the list sticks to what the docs say.
What Firecracker gives you
Firecracker is a virtual machine monitor. Point it at a guest kernel and a root filesystem, give it vCPUs, memory, block devices and network interfaces through its API, and it boots a microVM with a small device model. That is the hard, security-critical core, and it is well engineered.
Everything around that core is yours.
1. Hosts with KVM
Firecracker needs the KVM kernel module and read/write access to /dev/kvm. The getting-started guide uses an EC2 c5.metal instance and notes that the project uses .metal instance types exclusively because EC2 only supports KVM on them. It supports x86_64 and aarch64 Linux hosts, with specific host kernels listed in the kernel policy.
(The docs also describe a newer Nitro Sandbox mode that is isolated by the AWS Nitro System instead of KVM and runs on virtualized instance types that support Nitro Enclaves. It has its own requirements page; if you are on AWS, read it before you price metal instances.)
So step one is a fleet of bare-metal or KVM-capable hosts, sized for peak concurrency, with capacity planning, patching and replacement.
2. A guest kernel and root filesystems
Firecracker does not choose your guest. You build a guest kernel with the configuration Firecracker supports and root filesystem images for each environment your agents need: Python, Node, Go, your monorepo's toolchain. Each needs a way to start your in-guest agent, get its network configured, and report readiness. Then you keep all of them patched.
3. Networking, one tap device per VM
The network setup guide says Firecracker supports only a TUN/TAP network backend. Each microVM needs a Linux tap device on the host, and you choose how its traffic is routed: the guide's main path is NAT, with namespaced NAT as an alternative for many VMs. That means per-VM tap creation and cleanup, IP allocation, and nft or iptables rules on every host.
For agent code, you also want to control where traffic can go. The production host page has a section on filtering guest egress traffic with nft or iptables-nft. An allowlist by hostname, rather than IP, needs a DNS-aware proxy or resolver on top. Designing an egress allowlist covers that layer.
4. The jailer and host hardening
The production host recommendations say to run Firecracker under the jailer, which sets up a chroot, a separate user and group, cgroups and namespaces for each microVM process, and to keep the seccomp filters on. The same page covers rate limiting network and disk to avoid noisy neighbours, disabling swap or using secure swap, and mitigating hardware side channels, including disabling SMT and Kernel Samepage Merging. The Firecracker production host checklist goes through each item.
5. Snapshots, if you want fast starts
Firecracker can snapshot a microVM's state and guest memory and restore it. The snapshot docs spend real space on what that means: state that should be unique, such as random number generator state and identifiers, is cloned into every restore, and there are specific recommendations for network connectivity of clones. Diff snapshots are still in developer preview. MicroVM snapshot pitfalls covers this in depth. If you skip memory snapshots and cold-boot every VM, you trade that complexity for slower starts.
6. The control plane
None of the above is a sandbox product yet. Your agents need:
- An API to create, run commands in, move files in and out of, pause and stop sandboxes, with authentication and per-tenant limits.
- An in-guest agent to execute commands and stream output, usually over vsock.
- A scheduler that places VMs on hosts with capacity and cleans up after crashes.
- Lifetimes so a forgotten sandbox stops by itself.
- Records: who started what, what ran, what it cost. For agents acting on behalf of people, also policy, approvals and an audit trail.
This is the part teams underestimate. Firecracker is a small, sharp component; the platform around it is most of the work.
What a hosted sandbox covers
With Sandscale, the items above are the product. Each sandbox is its own Firecracker microVM. You create one from a built-in template (builtin:python, builtin:node, builtin:go, builtin:base, builtin:minimal) or your own OCI image pinned by digest, run commands through the TypeScript SDK, REST API, CLI or MCP server, and stop it, which deletes its disk. The network is none by default, with your organization's allowlist available where your plan includes it. Pause and resume keep memory and disk; snapshots save /workspace as files, so new sandboxes start fresh processes over the same files rather than cloned memory. Policy, approvals, Vault, DLP and a hash-chained audit log are on every plan.
Pricing is per awake vCPU-hour against an included allowance: 100 a month on Free, 1,500 on Pro, 2,000 per member pooled on Team, with $0.05 per awake vCPU-hour beyond that on paid plans if you turn it on. See the plans reference.
When self-hosting is the right call
Building your own makes sense when:
- Sandboxes are your product, and the control plane is where you differentiate.
- You need hardware or placement no provider offers, such as specific accelerators or on-premises hosts with no cloud connectivity.
- Your volume is large and steady enough that owning metal and a platform team beats per-hour pricing, and you are comfortable owning the security patching of hosts, guest kernels and images.
If you need your own cloud account mainly for data control, check whether a provider can run there for you: Sandscale's Enterprise plan can run Sandscale workers in your own AWS account.
When it is not
If sandboxes are a means to an end, such as giving your coding agent somewhere safe to run tests, or backing a chat product's code interpreter, the months spent on hosts, networking, images and a control plane are months not spent on the agent. Start hosted, measure, and revisit if the numbers change. Sandscale's Free plan includes 100 awake vCPU-hours a month, which is enough to find out whether the model fits.
Originally published on the Sandscale blog.
