TL;DR
AI agents run code and call tools, so a prompt injection can become a breach. Compare gVisor, Agent Substrate, OpenShell and plain containers, and pick by risk.
An AI agent is not a chatbot. It runs code, calls tools, reads files, and hits your internal APIs on your behalf. That means a prompt injection is no longer a funny screenshot. It is a path to your data, your credentials, and your production systems. Sandboxing is the layer that decides how far that path goes.
The short version: if your agent only calls hosted APIs with scoped tokens, plain containers with tight network policy are probably enough. If it executes untrusted code or touches sensitive data, you want a real sandbox. The three names that matter this month are gVisor, Agent Substrate, and OpenShell. They solve different parts of the problem, and picking the wrong one buys you complexity without the protection you actually need.
Why containers alone are a weak answer
A standard container shares the host kernel. That is fine for a web service you wrote and reviewed. It is a thin boundary for a process whose next instruction comes from a model output you did not write and cannot fully predict.
The failure mode is concrete. An agent asked to "summarize the invoices in this folder" follows a link in a document, or an instruction buried in a pasted email, and runs a command that reads a credential file or reaches an internal service. The container did nothing wrong. It ran what it was told to run.
So the question is not whether to isolate agents. It is how strong the isolation needs to be, and what you pay for it in latency, debugging pain, and operational load.
The options
Option 1: Plain containers with network policy
Your existing Kubernetes setup: one pod per agent run, a read-only root filesystem, no privilege escalation, a NetworkPolicy that allows only the egress the agent needs, and a short pod lifetime.
This is the baseline. It costs almost nothing extra, your team already knows how to run it, and it stops the casual accident. It does not stop a kernel exploit or a determined escape, and it does nothing about the agent reaching a service it was allowed to reach but should not have been.
Pick this when the agent's tools are narrow, its tokens are scoped, and the worst case is a wasted API call rather than a data breach.
Option 2: gVisor
gVisor puts a user-space kernel between the agent process and the host kernel. The agent's syscalls are intercepted and handled by gVisor's Sentry process instead of reaching the real kernel. A kernel vulnerability in the host no longer gives the agent a direct path out.
Google has shipped gVisor for years — it is the sandbox behind GKE's sandboxed pods, and the isolation layer Anthropic and OpenAI use for agent-generated code. On November 5, 2026, Google donated gVisor to the CNCF as a Sandbox project, alongside Agent Substrate and OpenRL. Governance moves to a maintainer model with non-Google maintainers joining, the project is on a path toward Incubation, and Google says neutral ownership should clear the way for upstream Linux performance patches that were declined while a single vendor owned the project.
The cost is real. Syscall interception adds latency, especially for I/O-heavy workloads, and some workloads behave differently under gVisor than on a plain kernel. Debugging gets harder: the thing between your agent and the kernel is now a second kernel you have to understand.
Pick this when agents execute untrusted code (generated code, code from fetched pages, plugin code) and a container escape would be a serious incident.
Option 3: Agent Substrate
Agent Substrate is the runtime layer. It runs stateful agents on Kubernetes as actors that suspend when idle and resume fast — Google claims sub-500 ms restores onto already-warm workers, which is a vendor claim, not a benchmark. Each agent runs inside gVisor or a Cloud Hypervisor microVM, so the sandbox is part of the runtime rather than something you bolt on.
It is further along than a donation headline suggests. Agent Substrate reached 1.0 and is generally available as a managed capability on GKE, and the open-source code — in public development since May 2026 — deploys on any conformant Kubernetes cluster. The caveats are specific: it supports only the two most recent Kubernetes minor releases, memory snapshots outside GKE are limited, open TCP connections do not survive a restore, and as a new CNCF Sandbox project its APIs are still settling.
Pick this when idle-agent density and cost are your real problem — many agents, mostly waiting — and you want the sandbox and the agent lifecycle handled together. Pilot it first. Sandbox is the CNCF's entry tier, not a maturity badge.
Option 4: OpenShell
OpenShell is NVIDIA's runtime for running agents — especially coding agents like Claude Code, Codex, and Copilot CLI — inside kernel-isolated sandboxes governed by declarative policy. It confines files, processes, and syscalls using Landlock and seccomp, denies outbound connections by default, filters requests per binary, and injects credentials into approved requests so the agent never holds the real secret. Policies are declarative, and the project is adopting Cedar as its policy language.
NVIDIA contributed OpenShell to the CNCF as a Sandbox project on November 10, 2026, at KubeCon North America. It is early — releases are still in the 0.1.x range — so treat it as a strong building block, not a finished control.
Pick this when your agents are coding agents running on developer machines or CI, and you want policy-governed execution with the credential boundary handled for you.
The comparison
| Option | Isolation strength | Latency cost | Ops burden | Maturity |
|---|---|---|---|---|
| Plain containers + NetworkPolicy | Low (shared kernel) | None | Low — you already run it | High |
| gVisor | High (user-space kernel) | Moderate, I/O-heavy workloads feel it most | Moderate — a second kernel to learn | High — now CNCF, heading to Incubation |
| Agent Substrate | High (gVisor or microVM per agent) | Low at runtime; built around fast suspend/resume | Moderate — new APIs, narrow Kubernetes version window | 1.0, GA on GKE; CNCF Sandbox |
| OpenShell | High (kernel isolation plus policy) | Low | Moderate — policy to write and enforce | Early — 0.1.x, CNCF Sandbox |
Trade-offs
Stronger isolation always costs something. gVisor costs latency and debuggability. Agent Substrate costs flexibility: a narrow Kubernetes version window and restore semantics your state handling has to respect. OpenShell costs policy discipline — a policy nobody maintains stops matching reality within a quarter.
The other trade-off is scope. Sandboxing the agent's process does not fix prompt injection. It limits the blast radius after the injection succeeds. You still need scoped tokens, least-privilege tool access, and output review for anything that moves money or data. A sandbox is a seatbelt, not a steering wheel. And once any sandbox is allowed to reach an API, the blast radius is whatever the injected credential can do — scope the credentials, not just the sandbox.
And there is a cost trade-off teams forget: the sandbox that is too heavy to debug gets disabled. An agent platform your engineers bypass is worse than a weaker sandbox they actually keep on, because it also removes the audit trail. Choose the strongest option your team will keep running.
Recommendation
For most teams shipping agents in the next month: start with plain containers hardened properly (read-only filesystem, no privilege escalation, strict NetworkPolicy, short-lived pods, scoped tokens), and add gVisor for the specific agents that execute untrusted code. That covers the real risk without betting your platform on a project whose APIs are still moving.
If idle agents are a real cost line — hundreds of sessions sitting warm, waiting on model turns — pilot Agent Substrate. It is already at 1.0; just keep it off your most sensitive agents until the APIs settle and the off-GKE snapshot story matures. If your agents are coding agents, evaluate OpenShell for the policy and credential handling, knowing you are adopting a 0.1.x project.
If you have a dedicated platform team and agents that touch sensitive data or run untrusted code all day, skip the baseline and go straight to gVisor. The latency cost is real but it is a known quantity; an escape is not.
When not to sandbox hard
Do not reach for gVisor or a new substrate when your agent only calls hosted APIs with scoped, short-lived tokens and never executes code. The risk is a bad API call, and the fix is token scope, not a kernel boundary.
Do not bet production on any CNCF Sandbox project — Agent Substrate or OpenShell — without a pilot. Sandbox is the entry tier by design, and both projects are still moving their APIs.
Do not treat OpenShell's policy layer as sufficient on its own. Policy decides what the agent may attempt; the credential it can reach decides what an attempt can actually do.
And do not sandbox and then skip the rest: scoped credentials, egress allow-lists, and logging of every tool call matter more than which sandbox you pick, because they decide what a compromised agent can actually reach.
What to do next
List your agents, and for each one write down the worst thing it could do if its next instruction came from an attacker instead of a user. If the answer is "call an API with a scoped token," harden the container and move on. If the answer is "read credentials, run code, or reach production data," put that agent behind gVisor this week and keep the rest on the baseline.
Related reading
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.