AI Agent Sandbox: A Boundary, Not a Guarantee

An AI agent sandbox isolates agent code from your host. Google and Docker this week spell out container limits, and what a boundary does not cover.

An AI agent sandbox is an isolated place where an agent can run code, use tools and keep a workspace without free access to your host, local network or credentials you did not share. A container is a common boundary for that job. It limits what the agent can see. It is not a promise that every action is safe.

This week the industry said the same thing in public. On 5 November 2026, Google's Open Source Blog explained why standard Linux containers share the host kernel and why that is a poor fit for untrusted agent code at scale. The same day, Docker published how Docker Sandboxes differ from containers: containers share a kernel, while its sandboxes are microVMs with their own guest kernel.

What is an AI agent sandbox?

An AI agent sandbox is the execution environment around the model. The model proposes steps. The sandbox decides where those steps can run, which files they can touch, which network destinations they can reach and which credentials they can use.

A useful definition has four walls:

  1. Kernel or process isolation. The agent does not run as your logged-in desktop user with your full home folder.
  2. Filesystem scope. Only the workspace (and any skills or mounts you chose) is visible.
  3. Network scope. Outbound traffic is limited, and your local network stays out of reach unless you deliberately open it.
  4. Credential scope. Long-lived keys and host passwords stay outside the environment whenever the design allows.

If any of those walls is missing, you still have an agent. You do not have a complete sandbox.

What did Google and Docker say about sandboxes this week?

Google: Agent Substrate, gVisor and the shared-kernel risk. In the 5 November 2026 Open Source Blog post, Google Cloud announced that it is donating Agent Substrate and gVisor to the Cloud Native Computing Foundation in Sandbox status. The security argument is direct: agents execute model-generated, untrusted code, commands and tool calls, so they must be isolated from the host and from network resources. Standard Linux containers share the host kernel, which Google calls an unacceptable security risk on multi-tenant nodes.

Agent Substrate pairs with gVisor (runsc), Google's open source application kernel written in Go. gVisor intercepts system calls in user space so untrusted code does not talk straight to the host kernel. For workloads that need hardware virtualization, Substrate also supports Cloud Hypervisor microVMs under the same API. Google also describes snapshot and restore of agent state in under 500 milliseconds so idle agents do not keep a full Pod warm all day.

The lesson for any team is simpler: "container" and "sandbox for untrusted agent code" are not the same sentence.

Docker: containers isolate apps; sandboxes isolate agents. In Docker's 5 November 2026 post, Srini Sekaran and Oleg Selajev draw a bright line. A container is an isolated process that shares the host kernel. Docker Sandboxes are dedicated microVMs with their own Linux kernel, filesystem, network and private Docker Engine, built for autonomous coding agents that behave more like a developer using a laptop than like a packaged app.

Docker's framing matches the Google warning. Containers were built to isolate applications. Coding agents clone repos, install packages, start databases, build images and act on instructions from files, web pages and tool output that nobody reviewed. That job needs a boundary the model cannot rewrite. In Docker's design, if an agent escapes a container inside the sandbox, it lands in a disposable microVM, not on the host.

Docker is also clear about what isolation does not hide. The agent can still reach whatever you share: the workspace, allowed network destinations, MCP servers and skills. A microVM does not protect you from a read-write mount you chose to give it.

Why is a container a boundary and not a guarantee?

Three reasons show up in both posts and in any honest local setup.

1. Shared kernel risk. Namespaces and cgroups change what a process can see. They do not give the workload its own kernel. A kernel bug or a misconfigured privileged path can turn one compromised container into host access. That is why Google points teams at gVisor or microVMs, and why Docker put a hypervisor under its agent sandboxes.

2. What you mount still crosses the wall. Shared workspaces, Docker sockets, credential files and MCP tools are intentional trust crossings. Docker's post calls out the classic /var/run/docker.sock mount: it hands control of the host Docker daemon to whatever is inside. An agent does not need a zero-day to probe that hole.

3. Network and credentials decide blast radius after a mistake. Even a perfect kernel boundary fails if the agent can send secrets to any host or act with your personal admin token. Deny-by-default egress and short-lived credentials are part of the sandbox, not extras.

So "AI agent in a container" is a useful starting phrase. "Agent isolation limits" is the follow-up every owner should ask next.

What else belongs in an AI agent sandbox?

Treat the kernel boundary as wall one. Add the controls that still matter when the agent is confused or manipulated:

  • Least privilege tools. Give the job the connectors it needs. Do not hand it your whole stack "in case."
  • Approvals on irreversible actions. Sending mail, spending money, deleting data and changing access should still ask a human. See AI agent approvals without approval fatigue.
  • Evidence of done. Prefer a file, a test command with output or a report with links over a chat bubble that says the work finished.
  • A real stop and inspectable memory. Stop should end tool actions at the broker. Keep only notes you approved, with a source and a date.

Persistent workers make those controls more important, not less. For how named workers share work without sharing permissions, see what an AI agent team is and multi-agent orchestration.

How should a small team choose isolation?

Match the boundary to the trust level of the work.

Situation Reasonable default Why
Trusted internal script you wrote Hardened container or OS sandbox may be enough You control the code and its inputs
Coding agent that reads the web, issues and MCP output Stronger sandbox (gVisor, microVM or locked-down worker computer) The agent acts on untrusted instructions
Agent needs Docker, sudo or long sessions Private engine inside a microVM, or a worker without the host socket Avoid giving the agent your host daemon
Background jobs while you are away Narrow workspace, network limits and approvals on send/delete You are not watching every step; see always-on AI agents
Local desktop crew for a small business One isolated worker computer per agent; host mode only when you accept the tradeoff Scope first, then ask

Skip two common mistakes. Do not call host execution a sandbox. Do not assume a cloud computer removes the need to limit files, tools and credentials. Remote agents change where the machine lives. They do not replace least privilege inside it.

How YardCrew fits

YardCrew is a free desktop app for Mac and Windows that runs a team of persistent AI workers on your own computer. Its default answer to the sandbox question is a worker computer, not a slogan. As the architecture section and features page describe today:

  • Its own computer. By default each worker runs in its own Linux container. None of your folders, passwords or sign-ins are inside it, and a file reaches you only when you save it. It reaches public websites, while your computer and local network are blocked, and that block is checked on every start. YardCrew calls this a strong boundary, not a guarantee, and it has been tested with Colima on Apple Silicon.
  • Host mode is not a sandbox. If you choose host mode, anything outside the workspace asks you first. Host mode is trusted local execution.
  • Stop means stopped. Stop ends the worker's tool actions at the broker, not just in the window.
  • Handoffs without new access. Workers ask teammates through a visible task and a shared inbox folder. A message never grants new permissions.
  • Proof, not "done." Research ends in a report file. Coding tasks complete only with the real test command and its output.

Honest limits: YardCrew is an alpha. It runs on Macs with Apple Silicon and macOS 26 or later, and on 64-bit Windows 10 version 2004 or later and Windows 11. Workers use your ChatGPT plan through OpenAI's Codex and count toward that plan's limits. They run only while your computer is awake. The Mac app is signed and notarized by Apple, the Windows installer is unsigned, source is not public, YardCrew Cloud is planned but not available, and YardCrew is not affiliated with OpenAI. Read the FAQ or download YardCrew free.

Google and Docker spent this week reminding builders that agent isolation is infrastructure, not a checkbox. A container can be a strong boundary. It is still not a guarantee.

Sources

Frequently asked questions

What is an AI agent sandbox?

An AI agent sandbox is an isolated environment where an agent can run code, install tools and use a workspace without free access to your host machine, your local network or credentials you did not share.

Is a container enough as an AI agent sandbox?

A container is a strong process boundary, but it shares the host kernel. Google and Docker both say shared-kernel containers are a weak fit for untrusted agent code on multi-tenant or high-risk machines. Stronger options include gVisor or a microVM.

What does 'a strong boundary, not a guarantee' mean?

It means the sandbox limits where an agent can reach by default, but shared folders, allowlisted destinations, MCP tools and skills you mount still cross that wall. Isolation reduces blast radius. It does not replace least privilege or human review of risky work.

What is the difference between a container and a microVM sandbox?

A container isolates a process while sharing the host kernel. A microVM sandbox gives the agent its own guest kernel behind a hypervisor, so a container escape lands in a disposable VM rather than on the host.

Does host mode count as an AI agent sandbox?

No. Host mode is trusted local execution on your machine. Anything outside the workspace should ask you first. It is not a sandbox, because the agent is not sealed inside a separate computer with its own network and filesystem limits.

Back to all articles