Blog / 31 October 2026
Deep dive · 31 October 2026 · 7 min read
Firecracker vs gVisor vs Kata Containers: which isolation for AI agents?
Firecracker, gVisor and Kata Containers all put something stronger than a plain container between untrusted code and the host, but they are different kinds of thing. Firecracker is a virtual machine monitor that boots microVMs on KVM; gVisor is a kernel that runs in user space and answers the program's system calls itself; Kata Containers is a container runtime that starts each pod in a lightweight VM, and Firecracker is one of the hypervisors it can use.
01What is each one, in a sentence?
They answer the same question, how to run code you do not trust on a Linux host, at different layers. Firecracker is a building block you program against. gVisor and Kata are runtimes that slot into Docker, containerd or Kubernetes in place of the default runc, so the workload still arrives as an OCI container image.
All three are Apache-2.0 licensed. Firecracker came from Amazon Web Services and runs Lambda and Fargate. gVisor is written in Go. Kata Containers is stewarded by the Open Infrastructure Foundation.
- Firecracker: a VMM that runs in user space and uses KVM to create microVMs, with 5 emulated devices and a separate jailer process as a second line of defence.
- gVisor: in its own words, an application kernel that implements a Linux-like interface and runs in user space; its Sentry intercepts system calls and a Gofer process handles file access. It ships as the OCI runtime
runsc. - Kata Containers: lightweight virtual machines that feel and perform like containers, compatible with the OCI image format and the Kubernetes CRI, run by the
containerd-shim-kata-v2runtime with akata-agentinside each VM.
02Firecracker vs gVisor vs Kata at a glance
The table below compares them on the four things that usually decide the choice. It is built from each project's own documentation, read on 31 October 2026. Start-up figures are each project's own claims, not a benchmark we ran.
Kata's row depends on which hypervisor you configure. Its docs list Cloud Hypervisor, Firecracker, QEMU, Dragonball and StratoVirt, and mark only QEMU as supporting GPUs and confidential-computing technologies such as Intel TDX and AMD SEV-SNP.
- Boundary. Firecracker: hardware virtualization; the guest has its own kernel. gVisor: the Sentry, a user-space kernel, in front of the host kernel. Kata: hardware virtualization; one VM per pod with its own guest kernel.
- Syscall path. Firecracker: system calls go to the guest's Linux kernel, and only device I/O crosses to the host. gVisor: every system call is handled by the Sentry, which uses a smaller set of host calls. Kata: as Firecracker, through whichever hypervisor it runs.
- Platform. Firecracker: x86_64 and aarch64 Linux with read/write access to
/dev/kvm. gVisor: x86_64 and ARM64 Linux 5.6 or later; the Systrap platform works without virtualization support. Kata: Linux hosts with hardware virtualization; its architecture document assumes physical hardware. - Start-up. Firecracker: under 125 ms per its project page. gVisor: no kernel to boot, so a sandbox starts like a process. Kata: a VM boot, with the time set by the hypervisor and guest kernel you pick.
03Is gVisor a VM?
Not in the usual sense, and its docs say so: gVisor describes itself as not a VM in the everyday sense of the term, and as a third approach that keeps many of a VM's security benefits with a lighter footprint. It can be read as a merged guest kernel and VMM, or as seccomp on steroids. There is no guest operating system and no virtual hardware; the Sentry reimplements the Linux system call interface in a host process.
That design has two documented costs. gVisor does not implement every system call, /proc file or /sys file, so some software fails in ways it would not on Linux. And it warns of higher per-system-call overhead and possibly poor performance for system-call-heavy workloads. Fly.io's comparison makes the same point for agent loops: installs, git and test runs make many small file and network calls, which is where the extra layer shows.
gVisor can still use KVM. Its platform docs describe a KVM platform that runs best on bare metal and the Systrap platform, the default since mid-2023, which is the better choice inside a VM or on a machine without virtualization support. That flexibility is why it appears in Kubernetes environments where nested virtualization is not available.
04Firecracker vs Kata: a VMM or a runtime?
The comparison people search for is a little lopsided, because Kata can use Firecracker. Firecracker on its own gives you an API socket to configure a machine, attach a kernel, a root filesystem and network devices, and start it. Everything above that, images, networking, lifecycle, snapshots and multi-tenant scheduling, is yours to build, which is what services such as AWS Lambda, Fly.io and E2B did.
Kata starts from the container world instead. You keep your OCI images and your Kubernetes manifests, select Kata as the runtime class, and each pod gets a VM. Choosing Kata does not mean choosing Firecracker: the hypervisor is a configuration setting, and the trade-offs in the table follow from it.
05Which isolation for untrusted code from AI agents?
No single answer fits every team, and the three are often combined with other controls rather than chosen alone. A few questions narrow it. Does the agent run syscall-heavy work such as package installs, compilers and test suites, or short CPU-bound snippets? Do your hosts expose KVM, or are they cloud VMs without nested virtualization? Do you already run Kubernetes and want isolation through a runtime class, or are you building your own service?
Whichever you pick, the isolation primitive does not decide what the sandbox can reach or which credentials it holds. Network egress rules, where API keys live and how you undo a bad change come from the system around the VM or the Sentry, and those matter as much as the kernel boundary when an agent has been prompt-injected.
- Building a sandbox service on KVM hosts: Firecracker gives the smallest VMM to build on.
- Kubernetes, hosts without usable KVM, short CPU-bound jobs: gVisor, through
runscand a runtime class. - Kubernetes with VM-level isolation per pod: Kata, with the hypervisor chosen for the features you need.
06None of the three runs natively on a Mac. What do Mac users do?
Firecracker needs /dev/kvm, gVisor needs Linux 5.6 or later, and Kata runs on Linux hosts. macOS has no KVM; it offers Apple's Hypervisor and Virtualization frameworks instead. So on a Mac, all three run only inside a Linux VM, and Firecracker or Kata inside that VM also needs nested virtualization, which Apple supports from macOS 15 on Macs with the M3 chip or later.
Mac users therefore pick one of three routes: a Linux VM through a tool such as Lima, with nested virtualization switched on when the chip allows it; a tool that builds its sandboxes directly on Apple's Virtualization framework, such as Apple's own Containerization package, or Docker Desktop, whose Linux VM runs on Apple's Virtualization framework or Docker's own VMM; or a remote Linux host with KVM. Our companion post on Firecracker and Apple silicon walks through each.
Takeaways
- Firecracker is a VMM, gVisor is a user-space kernel, and Kata is a runtime that starts each pod in a VM.
- Kata can run on Firecracker, so the two are not strict alternatives.
- gVisor is not a VM: it trades some Linux compatibility and syscall speed for no guest kernel and no need for KVM.
- All three are Linux technologies; on a Mac they need a Linux VM, and Firecracker or Kata also need nested virtualization (M3 or later, macOS 15).
- The isolation primitive does not set network or credential policy; the sandbox around it does.
Where kosa8 fits
kosa8 sits in the microVM column: each agent gets a VM with its own kernel, on KVM with Cloud Hypervisor on x86-64 Linux and on Apple's Virtualization framework on Apple-chip Macs, so it runs natively on a Mac without nested virtualization. It is a local tool for one machine, not a Kubernetes runtime; for cluster isolation, gVisor and Kata are built for that. Around the VM, kosa8 adds a network closed except for your allow-list and keys that stay on the host.
Check yourself · +100 XP
Which of the three can run without hardware virtualization support on the host?
gVisor's default Systrap platform intercepts system calls with seccomp and works on machines without virtualization support. Firecracker needs /dev/kvm, and Kata starts a VM per pod through a hypervisor.
Questions people ask
Is gVisor a VM?
No. gVisor's docs call it an application kernel that runs in user space, not a VM in the everyday sense. Its Sentry handles the program's system calls itself; there is no guest operating system or virtual hardware.
Can Kata Containers use Firecracker?
Yes. Kata's hypervisor docs list Firecracker alongside Cloud Hypervisor, QEMU, Dragonball and StratoVirt. Only QEMU is marked as supporting GPUs and confidential computing.
Can I run Firecracker, gVisor or Kata on a Mac?
Only inside a Linux VM. Firecracker and Kata in that VM also need nested virtualization, which Apple supports from macOS 15 on M3 and later chips. Tools built on Apple's Virtualization framework run Linux sandboxes natively instead.
Sources
- Firecracker — Firecracker project
- Getting started with Firecracker — Firecracker docs
- Firecracker: Lightweight Virtualization for Serverless Applications (NSDI 2020) — USENIX
- What is gVisor? — gVisor docs
- Platform guide — gVisor docs
- Installation — gVisor docs
- Kata Containers — Kata Containers
- Kata Containers hypervisors — Kata Containers docs
- Kata Containers architecture — Kata Containers docs
- Firecracker vs gVisor — Fly.io
- isNestedVirtualizationSupported — Apple Developer
- Containerization — Apple (GitHub)
- Virtual Machine Manager for Docker Desktop on Mac — Docker docs
- Docker containers vs microVMs: which isolates an AI agent better? — kosa8 guides
- How do I run untrusted LLM-generated code safely? — kosa8 guides
Written by the kosa8 team. Every kosa8 command was checked against the CLI, and every claim about another product links to that product's own documentation. Spotted a mistake? Tell us.
Try it on your own machine
Give your next agent its own sealed machine.
One line installs kosa8 on your own machine. Every feature, plans from $29 a month.