Google Cloud Sandboxes Explained: One Map of Every Way to Run Agent Code on Google Cloud
By Fabio Douek
Human-led, AI-assisted. Research and implementation done with AI tools, led, tested and edited by me. How posts are labeled
Jump to section
- Overview
- The Map
- Seven options on one page
- How they layer
- Names that collide
- When each one shipped
- Isolation: Documented and Observed
- What the docs say, what I saw
- gVisor or microVM
- Claims and Conditions
- Where the Keys Live
- Choosing
- Google’s guide
- My flow across products
- Where You Can See and Click
- Pricing
- Verdict
- What works
- What doesn’t, yet
- Who should use what
Explain (TLDR) like I am...
Imagine a big playground with seven different sandpits. Some are fenced and looked after by the playground staff, some are inside your own backyard, and one is still only a drawing on a poster. Each has a different kind of fence around it.
I went and looked at the fences from the inside. Most are the same kind of fence, a few have little gaps, and each sandpit costs a different amount to keep open. The staff say some sandpits are very quick to open, and I checked which ones really are.
Google Cloud offers six ways to run untrusted code, and a seventh is announced but unavailable. They differ in who operates them, the isolation technology, the launch stage, and where credentials are held. Several are still in preview, and the documentation does not always name the isolation in use.
The material points are these. Performance figures in Google's announcements omit hardware and method. Credential protection varies by product and in one case stops at the response. Treat each option as a separate vendor-controlled commitment and check its stage before relying on it.
The presenting question is how to run code an AI agent wrote without letting it harm the host. There are six treatments on Google Cloud, and a seventh in development. The isolation layer looked the same in nearly every one I examined, a userspace kernel called gVisor, with one stronger microVM option on GKE.
The side effects differ. Some options leak a secret through a mounted file or a reflecting service, some bill while idle, and several quoted speed claims held only under favorable conditions. Choose by the patient's workload, not by the brochure.
Choosing a sandbox can feel overwhelming when there are seven names, two of them nearly identical, and every page says it is the safe one. A map helps: it shows who looks after each one and who is left holding the responsibility when something goes wrong.
What I noticed after testing five of them is that the reassurance usually ends at a boundary nobody mentioned. A secret in a file, a default network that is more open than expected. Naming those edges out loud makes the decision calmer.
Think of seven stages for the same band. Some are venue-run, with their own crew. Some are a stage inside your own studio, and some are a rig you assemble and tune yourself. One is a poster on the wall for a venue that has not opened.
The sound check matters more than the program. Under the hood most use the same amp, gVisor, but the quoted warm-up times only hold if you play the way the promoter assumed. I listed the ones I measured and what each one costs per night.
The story is a decision, not a feature. Google has six sandbox options for agents and a seventh announced, and no single page compares them. This post puts them on one map: owner, isolation, stage, price and where the keys live.
The proof points come from five hands-on tests. One workload, 1,000 runs a day, costs about 15 dollars a month on the managed API and about 147 dollars a month at the floor on GKE with Substrate. The positioning follows: managed for simplicity, GKE for density and control.
Overview
Google Cloud now has six ways to run code you don’t trust, and a seventh announced. They have different owners, different isolation, different bills, and names that collide: “Agent Sandbox” is a GKE feature, “Agent Sandboxes in Gemini platform” is something else, and “Cloud Run sandboxes” is a third thing. This post, part 1 of 6 in the Google Cloud Sandboxes series, puts them on one map.
I wrote it last. Part 2 tested the sandbox behind Managed Agents in the Gemini API, part 3 the Agent Platform sandboxes, part 4 Cloud Run sandboxes, part 5 GKE Agent Sandbox with Pod Snapshots and the gVisor and microVM runtimes, and part 6 Agent Substrate on GKE. I ran nothing new for this post, and it has no companion code. Every “observed” cell below comes from one of those tests, and the table says which. On November 14, 2026 I re-checked what can go stale: list prices, launch stages, and whether Agent Compute Engine is available yet.
Five things stood out when I put the results side by side:
- Everything I could fingerprint is gVisor.
uname -rprinted4.19.0-gvisorin Managed Agents, in Agent Platform Code Execution and Shell, inside Cloud Run sandboxes, in GKE Agent Sandbox and in Substrate. The only real VM kernel I saw was GKE’smicrovmruntime (6.6.94). The docs name the technology for some of these and not for others. - Google’s speed numbers come without conditions, and they landed on both sides. Cloud Run’s “500 ms average” was 153 ms on my instance, but the host started only about five sandboxes a second. Substrate’s “sub-500ms resume” was about 120 ms with enough CPU and over a second without. Agent Platform’s “under a second” was 1.0 to 2.4 seconds warm and 142 seconds for the first sandbox in a project.
- The secrets story differs per product and has a hole in most. Managed Agents injects credentials at an egress proxy, and a reflecting service sent one back. On Cloud Run an environment variable stayed out and a mounted secret was readable. On GKE a directly created Sandbox got a token from the metadata server.
- Only two options have a console path to create anything. The GKE gVisor node-pool checkbox and the AI Studio Playground. Everything else is
gcloud,kubectlor an SDK, and no console lists a running sandbox. - The same workload costs about $11 to $16 a month on the Agent Platform API or Cloud Run sandboxes, and $147 or more at the Substrate floor. GKE Agent Sandbox on Autopilot is $8 only if you accept pods that take minutes to start. The cluster options pay off at density, or when you already run the cluster.
The Map
Seven options on one page
| Option | Who runs it | Unit of isolation | Stage on Nov 14, 2026 | You pay for | Console | Tested in |
|---|---|---|---|---|---|---|
| Managed Agents (Gemini API) | Google, all of it | A Linux sandbox per environment, driven by Google’s Antigravity agent | Public Preview since May 19 | Model tokens only during the preview | AI Studio Playground runs an agent; no sandbox view | Part 2 |
| Agent Platform sandboxes (Code Execution, Shell, Computer Use, custom containers) | Google, a managed API | A “gVisor-isolated container” in a Google-managed tenant project | Shell and Computer Use GA Sept 9; Code Execution, custom containers, templates, snapshots: no GA note | $0.085 per vCPU-hour and $0.009 per GiB-hour while the sandbox exists | None for sandboxes (quotas, logs, billing) | Part 3 |
| Cloud Run sandboxes | Google runs Cloud Run; you run the service | A child sandbox inside your own instance | Preview since July 8; gcloud beta only | Nothing extra; you pay for the instance | Setting visible, read-only | Part 4 |
| GKE Sandbox (RuntimeClass) | You (node pools) | A pod, on gVisor or a microVM | gVisor GA; microVM GA since Oct 7 (1.37.0-gke.4713000+) | Nodes | gVisor checkbox only | Part 5 |
| GKE Agent Sandbox (+ Pod Snapshots) | You | One stateful pod per Sandbox | Agent Sandbox GA (launch blog May 21; release note Nov 12); Pod Snapshots GA May 6 | Nodes, the cluster fee, Cloud Storage; no extra charge for the software | None | Part 5 |
| Agent Substrate on GKE | You | An actor on a worker pod (gVisor, or a Cloud Hypervisor microVM per WorkerPool) | GA on GKE Standard 1.37+ since Nov 9 | Nodes, the cluster fee, a 500 GiB disk, Cloud Storage; no extra charge for the software | None for actors | Part 6 |
| Agent Compute Engine | A single-tenant microVM per agent | Announced Oct 22; not available | Not published | n/a | Not tested |
Stages are from Google’s release notes and docs as of November 14, 2026. “No GA note” means I found none, not that Google said it is still in preview.
How they layer
Google’s own layering story, in its launch posts, is: the open-source stack is gVisor, then Agent Substrate, and on GKE the order is GKE Sandbox, Agent Sandbox, Substrate, and AX on top. Two caveats on the picture. Substrate needs GKE Sandbox switched off on its worker node pools, because it brings its own runtime, so it builds on Agent Sandbox’s ideas and not literally on the RuntimeClass. And the right-hand column is a description of ownership, not of construction: I found evidence that Agent Platform sandboxes run on GKE in Google’s tenant project (the CMEK page mentions a GKE node boot disk, and in part 3 an error message named the open-source Agent Sandbox resource), but Google doesn’t state it. I also don’t say that Managed Agents runs on Agent Compute Engine. Google doesn’t say that either.
Names that collide
| Name | What it is | Easy to confuse with |
|---|---|---|
| Agent Sandbox | The GKE feature, from the Kubernetes SIG Apps project: Sandbox, SandboxTemplate, SandboxWarmPool, SandboxClaim | ”Agent Sandboxes in Gemini platform”, the name Google’s Agent Compute Engine announcement uses for the Agent Platform sandboxes |
| Agent Platform sandboxes | Code Execution, Shell, Computer Use and custom containers behind one API | GKE Agent Sandbox |
| Cloud Run sandboxes | The sandbox binary Cloud Run mounts into your container | Cloud Run’s second-generation execution environment, which the docs call a microVM; the sandbox is a child inside it |
| GKE Sandbox | The node-pool RuntimeClass (gvisor, microvm) | Agent Sandbox, which uses it |
| Agent Substrate / AX | Substrate is the layer; AX is an agent runtime that runs on it | Treating them as one product. I ran AX in an earlier series, before part 6 |
| Agent Runtime, Agent Platform | Agent Engine was renamed Agent Runtime, and Vertex AI is now the Gemini Enterprise Agent Platform; “Agent Engine Code Execution” became “Agent Platform Code Execution” on April 22, 2026 | Old docs, blog posts and SDK names |
| Managed Agents | Exists in the Gemini API (part 2) and as a Managed Agents API on Agent Platform | Each other: Google’s docs disagree on the default network between the two |
When each one shipped
Six of these fourteen events happened in the last ten weeks, so some of what you read about these products is a release note old. My research notes from November 11 listed Pod Snapshots’ stage as “not stated”; the GKE release notes of May 6 call it generally available, so I corrected it here. Cloud Run sandboxes were also extended to jobs and worker pools (still Preview) on August 5.
Isolation: Documented and Observed
What the docs say, what I saw
| Option | Docs name | Seen from inside | Tested in |
|---|---|---|---|
| Managed Agents | ”Isolated at the OS level”; no technology named | 4.19.0-gvisor, Ubuntu 24.04, root, 10 CPUs | Part 2 |
| Agent Platform: Code Execution, Shell | ”gVisor-isolated container” | 4.19.0-gvisor, dmesg says “Starting gVisor…” | Part 3 |
| Agent Platform: Computer Use, custom containers | Same words | Not fingerprinted (a browser; images that serve only HTTP) | Part 3 |
| Cloud Run sandboxes | Not stated; the host is a gen2 “microVM” | Host: Linux 6.9.12, later 6.18.60; sandbox: 4.19.0-gvisor with runsc mounted | Part 4 |
GKE Sandbox, gvisor | gVisor | 4.19.0-gvisor | Part 5 |
GKE Sandbox, microvm | Kata + Cloud Hypervisor | 6.6.94, a real Linux boot log in dmesg | Part 5 |
| Agent Substrate | gVisor, or Cloud Hypervisor per WorkerPool | 4.19.0-gvisor (a microVM WorkerPool was not tested) | Part 6 |
| Agent Compute Engine | A “hardware-isolated Cloud Hypervisor boundary” | Not available | none |
Two cautions on reading the “seen” column. The kernel string only proves gVisor is in the path, not that nothing is below it: gVisor reports a synthetic kernel version. And the hypervisor CPU flag is no help either, because in Cloud Run it was set on both the host and the sandbox, since gVisor passes /proc/cpuinfo through.
gVisor or microVM
The only place I could put them side by side was GKE, on one cluster (part 5):
| gVisor | microVM | |
|---|---|---|
| Kernel the pod sees | 4.19.0-gvisor | 6.6.94, a real Linux |
| Cold create to Ready (10 sandboxes, image on the node) | 0.98 s median | 3.98 s median |
| Extra cost per pod | none declared | 250 mCPU and 130 MiB of overhead |
| Pod Snapshots | work | refused, with a clear message |
| Metadata server | token returned (a directly created Sandbox) | token returned |
| Where you can create it | Console checkbox or gcloud | gcloud only, Standard 1.37.0-gke.4713000+, x86, nested virtualization, no GPU or TPU |
Google’s guidance, on its GKE planning page, is microVMs for VM-level isolation and full Linux syscall compatibility, and gVisor for faster cold starts, lower memory overhead and accelerators. The measurements agree: the microVM started about four times slower and cost more per pod, in exchange for a real kernel. The surprise in the last-but-one row is that the runtime didn’t decide who could reach the metadata server. A NetworkPolicy did, in both cases. GPUs, which I didn’t test (no GPU budget), are documented only on the gVisor paths of GKE Agent Sandbox and Pod Snapshots. Substrate says GPU passthrough into actors isn’t supported, and I found no GPU support documented for Agent Platform sandboxes, Cloud Run sandboxes or the microVM runtime.
Claims and Conditions
Google’s pages quote numbers, almost always without the hardware, size or method behind them. That isn’t dishonest, but it means a number can’t be compared with another number. These are the ones I could test, with what the series measured:
| Google’s claim | Conditions Google gives | What I measured | Tested in |
|---|---|---|---|
| Cloud Run: 1,000 sandboxes started, run and stopped “with an average of 500ms latency” | The count and the average | 153 ms mean for 1,000 sequential on 2 vCPU / 4 GiB (186 ms in an earlier run). The host started about 5 per second at any concurrency, so at 100 in flight each took 21 s and 500 ms matches about 3 in flight | Part 4 |
| Agent Platform: sandboxes created and running code “in under a second”; “up to 2 minutes” cold | None | Create alone 1.0 to 2.4 s from warm (median 1.6 s), plus 0.5 to 1.1 s for the first execute; 142 s for the first sandbox in a new project; a Shell sandbox “about 20 s” in the docs, about 19 s without a template and 1.6 to 3.0 s with one | Part 3 |
| Agent Sandbox: “300 sandboxes per second, per cluster”, “90% of allocations completing in 200 milliseconds” | Neither hardware nor pool size | 300 per second not tested (one node). Controller p90 220 to 233 ms on a warm pool of 2 or 10, just above 200 ms; 0.28 s median from my laptop; a burst of 20 on a pool of 10 sent the overflow to cold creates that took 21 to 32 s | Part 5 |
| Pod Snapshots restore in “a few seconds” (3 to 5 s on the planning page) | None | 2.1 to 2.7 s to the first reply with no volume; 3 to 12 s with a PersistentVolumeClaim attached | Part 5 |
| Substrate: “sub-500ms resume operations at over 500 suspend/resume activations per second”, “over 1,000 dormant agents per host” | No node size | About 120 ms through the router at a 250m or larger CPU limit, and 1.1 s at 50m; 500 per second not tested; 156 idle sandboxes on two 4 vCPU nodes before Substrate refused the next, with CPU bookings as the ceiling | Part 6 |
| Managed Agents: credentials reach services “without the secret ever entering the agent’s environment” | None | True for the request: the sandbox held a placeholder. A trusted service that echoed the request put the real value back into the sandbox | Part 2 |
| Cloud Run: sandboxes have no access to “the parent workload, environment variables, secrets, or the Google Cloud metadata server” | None | Environment variables and the metadata server: yes. A secret mounted as a file and a root-only 0600 file were readable | Part 4 |
| GKE Sandbox: gVisor pods “can’t access cluster metadata on the node OS level” | Nothing about Workload Identity | A directly created gVisor Sandbox reached the metadata server and got a token; a Sandbox from a template could not | Part 5 |
One more number to handle with care: “200,000 agents” appears only in the Agent Compute Engine governance post, and there it is attributed to Substrate. It is not an Agent Compute Engine figure, and I didn’t test it.
Where the Keys Live
The cleanest design keeps the secret outside the sandbox and adds it on the way out. Here is what each option does, as documented and as observed:
| Option | Mechanism | What I saw |
|---|---|---|
| Managed Agents | An egress proxy swaps a __GEMINI_CRED_<id>__ placeholder for the stored value, only for trusted domains and the declared location | The sandbox held only the placeholder; the wrong domain or location was refused. A reflecting trusted service returned the secret into the sandbox and the model’s context (part 2) |
| Agent Platform sandboxes | Nothing to inject: no host metadata, an unprivileged appuser under a tenant identity, per Google’s docs | No metadata server even with internet access on, no secret-like environment variables, no sudo. “Internet access” is one switch with no allowlist (part 3) |
| Cloud Run sandboxes | No injection; no parent environment variables, secrets or metadata by default | Environment variables stayed out; a mounted secret was readable; --env TOKEN=... values are written to Cloud Logging (part 4) |
| GKE Agent Sandbox | No gateway (“doesn’t include a gateway for out-of-sandbox credential injection”); warm-pool pods share one ServiceAccount | A templated Sandbox could not reach the metadata server; a directly created one could (part 5) |
| Agent Substrate | An egress gateway injects credentials outside the actor; per-actor SPIFFE certificate | I ran the egress gateway but did not test credential injection with an API key (part 6) |
| Agent Compute Engine | Announced: “service credentials are injected in egress outside the microVM”, integrated with Agent Gateway; “zero credentials held inside the sandbox” | Not available |
The pattern: two options inject credentials (Managed Agents, Substrate), and I could verify only one. For the rest, keep the secret out of everything the sandbox can read, which includes files mounted into the host on Cloud Run and the pod’s service account on GKE.
Choosing
Google’s guide
Google has one formal decision guide, and it covers GKE only: Plan an architecture for AI agent workloads on GKE. It says to use Agent Substrate “for most AI agent workloads, especially stateful, CPU-based agents that frequently suspend and resume”, and Agent Sandbox for continuously active agents, GPUs or TPUs, a full PodSpec, Arm nodes or Autopilot. Across products, the Architecture Center names Cloud Run sandboxes or Agent Platform Code Execution for Cloud Run, and GKE Sandbox for GKE, and no Google page compares all of them.
My flow across products
This one is mine, not Google’s. It comes from what the six parts found:
- You want a hosted agent and accept that a model decides what runs: Managed Agents. Start every environment with an explicit
networkallowlist. - Your code calls a sandbox API and you run no infrastructure: Agent Platform sandboxes. Set a
ttlon everything; a Code Execution sandbox created without one had no expiry set in my test. - Your agent already runs on Cloud Run: Cloud Run sandboxes. Size the instance for the app plus every concurrent sandbox, and keep secrets out of the host image.
- You run GKE, with many mostly idle CPU agents that must keep state: Agent Substrate. Set the sandbox size on purpose, because the wake time followed the CPU limit.
- You run GKE and need a pod per agent, GPUs or TPUs, Autopilot, Arm or a full PodSpec: Agent Sandbox, with Pod Snapshots if you suspend. Create sandboxes from templates so the network policy applies.
- You only need kernel isolation for a pod: the GKE Sandbox RuntimeClass directly. A managed microVM per agent, Agent Compute Engine, is not available yet.
Where You Can See and Click
Console support matters because it decides whether anything you start is visible to the person on call. In the series:
| Option | What the console shows |
|---|---|
| Managed Agents | AI Studio’s Playground can run an agent. Usage charts cover tokens; no list of environments or logs from inside one (they exist only in the API) |
| Agent Platform sandboxes | The Agent Runtime page says “No agent instances” while the sandboxes exist. Quotas, audit logs and billing are the only views |
| Cloud Run sandboxes | The Sandbox launcher setting on a revision, read only; the sandbox.log stream in Logs Explorer. No create path (gcloud beta) |
| GKE Sandbox | A real “create” path: the gVisor checkbox on a node pool. The console doesn’t support microvm |
| GKE Agent Sandbox | No row for the managed add-on. Pod Snapshots show up as objects in Cloud Storage |
| Agent Substrate | Workloads in ate-system, three dashboards the installer creates, snapshot objects in the bucket. No view of actors |
| Agent Compute Engine | n/a |
The console can create something in only two places, the GKE gVisor node-pool checkbox and the Playground. The installer for Substrate must run on a local machine, not in Cloud Shell.
Pricing
One workload for everything: 1,000 runs a day for 30 days, each busy for 10 seconds on 2 vCPU and 1.5 GiB. That is 83.3 busy hours a month. Region us-central1, on-demand list prices that I re-checked on November 14, 2026, before any free tier except where noted:
| Option | Per month | What it assumes |
|---|---|---|
| Agent Platform Code Execution | about $15.29 | $14.17 for CPU and $1.13 for memory, busy time only. Sandboxes bill “while they exist”, so a forgotten one adds $0.184 an hour, about $4.40 a day at this size (part 3). Warm-pool and paused-sandbox pricing is not published |
| Cloud Run sandboxes, in a request-billed service (2 vCPU, 2 GiB, concurrency 1; the memory rounded up from 1.5 GiB) | about $10.68 | $15.91 without the free tier. The sandbox itself costs $0. An always-on instance-based service at the size I tested costs about $0.158 an hour, roughly $116 a month (part 4) |
| GKE Agent Sandbox on Autopilot | about $8.24 | Pods started on demand, which Google says can take several minutes to be ready. Autopilot rounds the memory up to 2 GiB for a 2 vCPU pod. With one warm pod always on: about $72.16 |
| Agent Substrate on GKE | about $147.17 floor, if one node can host it | One c3-standard-4 at $0.2016 an hour (my cluster in part 6 used two nodes, so one node is not tested), before the cluster fee, the 500 GiB disk Substrate’s database wants, and Cloud Storage. My two-node cluster ran at $0.61 an hour (about $445 a month); my part 5 cluster at about $0.40 an hour (about $290 a month) |
| Managed Agents | Tokens, plus tool usage | Compute is free during the preview. Part 2 ran on Gemini 3.8 Flash, $0.75 per million input tokens and $3.75 per million output tokens through December 31, 2026, and a one-command task cost about one cent. Since November 12 Google’s docs make Gemini 4 Hydrogen the agent’s default model, at $1.50 and $7.50 per million tokens, so expect that task to cost more by default (part 2) |
| Agent Compute Engine | No price | ”You don’t pay for idle VMs” is all Google says |
At this size, Agent Platform and Cloud Run sandboxes land within a few dollars of each other, and the GKE options carry a fixed floor that only pays off at density or when the cluster already exists. The comparison flips with the workload: Substrate’s pitch is many agents that sleep most of the time, which this example, 10 seconds of work per run, doesn’t capture. Cloud Run’s example also changes if concurrency goes above one, since sandboxes then share billed instance time.
Verdict
What works
The map is coherent once you draw it. There is a managed API for people who don’t want a cluster, a free add-on for people who already run Cloud Run, and a full GKE stack for people who need density and control. The isolation floor is consistent: gVisor in everything I could check, with a real microVM available on GKE. And in several parts something worked better than documented: pause kept more than the docs say, a sandbox started faster than Google’s figure, and the Substrate wake beat sub-500 ms.
What doesn’t, yet
The stages are uneven and several are young: Managed Agents, Cloud Run sandboxes and Agent Platform’s Code Execution have no GA, and one of the seven options does not exist yet. Names collide, so the docs of one product get read as another’s. No console lists a running sandbox. Google’s numbers carry no conditions, and the places where I could test a safety claim, each had an edge: a mounted secret, a reflecting trusted domain, a Sandbox created without a template, a restore on the wrong machine type that started cold with no error. The sandbox’s real boundary is as much about the defaults around it (network, identity, files, logs) as about gVisor or a microVM.
Who should use what
Pick by who you want operating it, then check that option’s one sharp edge. If you can’t decide, start with the managed API, set a ttl, and move to GKE when you have enough idle agents that the density argument starts to matter. Don’t plan around Agent Compute Engine until Google publishes an API, regions and a price. The six parts have the numbers: part 2, part 3, part 4, part 5 and part 6.