Home / Guides

Guide

Containers vs microVMs for AI agents

An agent with root runs code nobody has reviewed. Where you run it decides how much that can hurt, and what the agent is able to do.

Updated 2026-11-29 · 5 min read

Coding agents now install packages, start databases, run test suites and open ports, usually with --dangerously-skip-permissions or its equivalent turned on. People run them in three places: their laptop, a container, or a virtual machine. This post compares the last two, because that is the choice every agent platform makes, us included.

The one-line difference

A container is a group of processes on the host's kernel, fenced off with namespaces and cgroups. A microVM has its own kernel, running on virtual hardware provided by a small hypervisor such as Firecracker. Every other difference follows from that.

ContainermicroVM
KernelShared with the hostIts own
Security boundarySyscall surface of the host kernelHypervisor and a few virtual devices
systemd, cron, real servicesAwkwardJust works
Docker insideNeeds privileged mode or tricksJust works
Start timeMillisecondsSeconds to boot, milliseconds from a snapshot
Memory overheadAlmost noneA guest kernel per VM
Snapshot running memoryPossible (CRIU), fragileBuilt into the hypervisor

Isolation: the agent is the untrusted code

With a container, every syscall the agent makes goes straight to the host kernel. A kernel bug becomes a way out of the container and onto the host, next to everyone else's containers. With a microVM, the agent's syscalls go to its own kernel. To escape, it has to break the hypervisor through a handful of emulated devices, which is a much smaller target. Firecracker was built by AWS for exactly this: running strangers' code side by side for Lambda.

If you are the only person on the machine, this matters less. If you are renting machines to strangers, as we are, it is the whole game.

Agents want a whole computer

The less obvious reason is capability. Ask an agent to "set up Postgres and run the migrations" and it will reach for apt install and systemctl start. Ask it to "test the Docker build" and it needs a Docker daemon. In a container, both are workarounds. In a VM, they're Tuesday:

root@me:~# systemctl is-active docker postgresql cron
active
active
active

Every workaround is a place where the agent gets stuck, retries, burns tokens, and finally asks you for help.

Snapshots: the part that changes the economics

Agents are idle most of the time: waiting for you, for CI, for the next prompt. Paying for idle hours adds up, but stopping the machine throws away its memory. Because a microVM's whole state is a memory file plus a small state file, the hypervisor can save it and restore it. We wrote up how we put a VM to sleep in 3 seconds and wake it in 0.04, with every process still running.

Where containers still win

For agents that run unreviewed code for hours, want root, and sit idle in between, we think a microVM is the right shape. That's why every Yurt VM is one.

Questions

Is a container enough to sandbox an AI agent?

For your own trusted code on your own machine, often yes. For unreviewed code from an agent with root, a VM puts a separate kernel between the agent and the host, which is a much smaller attack surface.

Can you run Docker inside a microVM?

Yes. A microVM has its own kernel, so Docker, systemd and other services run as they would on a normal server.

Are microVMs slower to start than containers?

A cold boot takes seconds, a container starts in milliseconds. Restoring a microVM from a memory snapshot takes milliseconds too.

Sources

  1. Firecracker, read 2026-11-29
  2. Claude Code security, read 2026-11-29

Give your agent its own computer. Full root, its own IPv6, and it sleeps with its memory when idle. Plans from $20/month, paid back as VM time.

curl -fsSL https://getyurt.dev/install | sh

Keep reading