Google's agent sandbox: isolation is easy, idling is the hard part

Google's Agent Compute Engine puts every AI agent in its own microVM with no credentials inside. The engineering story is idle accounting and a credential boundary, not the hypervisor.

Google's agent sandbox: isolation is easy, idling is the hard part

Google Cloud published a deep dive in late October on Agent Compute Engine: one hardware-isolated microVM per AI agent session, no credentials stored inside the sandbox, VM isolation at container speed and density. InfoQ summarised it on 22 November. Preview is "in the coming months," according to the Google Cloud blog.

Most coverage stopped at "sandboxing is good, Google sandboxed harder." That misses what the post actually contributes: a measurement of how agents spend their time, and a boundary most teams still do not draw.

The split everyone converges on

Each agent is two parts: the harness, or "brain," which calls the model and decides what happens next, and the sandbox, or "hands," which runs the code, shell commands and browser the model asks for. The harness lives entirely outside the execution boundary; the untrusted guest only runs commands the harness dispatched and streams output back.

Every serious platform lands here: a coding agent runs code nobody reviewed, behind a prompt that may carry injected instructions. Assume the workload is hostile and has root.

The consequence Google exploits is subtler than the isolation. Because the harness dispatches every tool call, the platform knows exactly when the sandbox is idle — not "low CPU," but genuinely between commands. A generic VM has to infer that from CPU graphs. An agent platform is told.

Most agents are waiting, most of the time

That is Google's own finding. Measuring typical sessions, agents spent most of their lives waiting: for the model to return the next step, for the user to reply. At any moment only a small portion of open sessions were running code.

This breaks the cost model in both directions. Keep a warm always-on VM per stored session and you pay for vast idle capacity. Tear it down between turns and you destroy working state, forcing a slow rebuild — possibly a different answer — on the next message.

Google's answer is application-aware checkpointing: when the sandbox reports no in-flight commands, the host checkpoints the microVM, preserving memory and files while holding zero active host resources, then resumes on the next tool call. Density comes from deduplication: every agent on a host shares one base OS, runtime and browser, so pre-warmed snapshots map into physical memory with copy-on-write clones, and a microVM allocates RAM only for pages it dirties.

What it costs to build

Google's post carries no latency or density numbers. An independent engineer at antonau.tech built the pattern on Firecracker in roughly 2,200 lines of Go and published measurements on 6 November:

  • 64 idle forks of a 512 MiB VM cost about 3 MiB of host memory each.
  • On bare metal, snapshot restore answers in 25 ms at p50 versus 642 ms cold boot; 64 forks started at once are ready in about 150 ms.
  • Resume from pause: 1.5 ms p50. Wake from hibernate: 21 ms. Entering hibernate: 880 ms, mostly writing 512 MiB to disk.
  • Under nested virtualization on a Mac mini, twelve concurrent forks never became ready at all.

The last two are the practical ones. That 880 ms entry cost makes pause versus hibernate a policy decision, not a feature flag: pause for gaps of seconds, hibernate for gaps of minutes. The nested failure is a warning about where you benchmark: nearly all restore time was spent inside the guest. If your agents run inside containers inside VMs, a common CI setup, your numbers will not resemble a bare-metal blog post.

The credential boundary is the part to copy today

Google keeps API keys and OAuth refresh tokens outside the sandbox, using an external Agent Gateway to authenticate requests and inject the secrets a tool call needs. In the Firecracker reproduction the guest has no network card at all; its only path out is a vsock to a host-side proxy holding the credentials.

Three properties follow:

  • An agent with root cannot read a secret it needs, because the secret never enters guest memory.
  • Rotation happens host-side: no sandbox rebuild, no agent quietly keeping the old key.
  • Every tool call is attributable. Google describes the boundary as producing a deterministic audit trail correlating harness-initiated calls with expected compute activity inside the sandbox — correlation by construction, not by joining logs after an incident.

Google also encrypts snapshots and block volumes at rest and requires dedicated or customer-managed cryptographic tokens to attach or restore them. That closes a hole teams forget: a snapshot is a full image of everything the agent touched, including whatever it read while holding elevated access. Path-based access to snapshots is not access control.

The checklist we would apply this week

You are probably not getting the preview. The design still transfers to Firecracker, Kata, gVisor or a plain VM pool:

  1. Split harness and executor. The process that talks to the model never holds a long-lived credential.
  2. Put a proxy between sandbox and network, with per-tool, short-lived scopes rather than one shared key.
  3. Define idle from the tool-call lifecycle, not from CPU. "No exec running" is a fact; "CPU under 5%" is a guess.
  4. Make pause versus hibernate explicit per workload, with different thresholds for chat and for long builds.
  5. Give each exec its own process group, so a dev server or watcher keeps the session marked busy and you never checkpoint a sandbox mid-build.
  6. Benchmark fork and restore on the host you will deploy, including the nested case, before committing to a density target.
  7. Encrypt snapshots at rest and gate restore behind an identity, not a file path.

Google's durable contribution is not the hypervisor. It is proving that idle accounting and a credential boundary decide whether an agent platform is affordable and defensible. The open-source pieces — Firecracker, Google's Agent Substrate, Alibaba's OpenSandbox, Meta's OpenEnv — are close enough that this is a decision for this quarter, not a wait.

If you are running agents against real internal systems, that boundary work is what to hire for. NetPy builds AI engineering and infrastructure for teams in India and abroad — netpy.in for delivery, cloud.netpy.in for the compute underneath it.