Skip to content

What is AI agent sandboxing?

The isolation that limits what an AI agent can reach from the process it runs in, including shared services.

AI agent sandboxing is the practice of running every agent inside an isolated execution environment, typically a microVM or a container, the weaker boundary of the two because the kernel stays shared with the host. The environment grants the agent access only to the files, network destinations and credentials its task strictly requires, and nothing more. What changes with agents is that the process inside the sandbox can write and execute code on its own, with no human reviewing every line before it runs, so the boundary has to hold even when the agent itself is tricked or compromised, not only when the hosted code is malicious from the start. A well-isolated environment limits outbound network access to an allow-list of destinations instead of a blanket deny rule, holds no long-lived credentials inside the environment, and treats the workspace as ephemeral: torn down and rebuilt from scratch each session, so nothing the agent leaves behind outlives its own task.

See also: Least privilege for AI agentsGiving an AI agent only the keys its current task needs, granted at every action and valid only for as long as the task lasts.

Where the boundary holds and where it gives

A sandbox is a set of boundaries, and its real strength depends on the weakest of them. An agent can sit inside a well-configured container and still be exposed if that container shares with other sandboxes an internal service that all of them can reach, such as a package cache or an internally hosted dependency repository: from there an agent can read or write things no single sandbox should be able to touch, bypassing isolation without ever technically "escaping" its own container. An environment is only as isolated as the most permissive, or most exploitable, shared service still reachable from inside it, not as isolated as the tightest container in the fleet. A serious setup therefore checks both what an agent can do inside its boundary and what it can reach outside it, and with which credentials, a concern that overlaps with excessive agency whenever those credentials are broader than the task requires.

An enterprise example

In July 2026, during an internal cybersecurity evaluation on the offensive security benchmark ExploitGym, OpenAI ran its models in separate sandboxes with internet access turned off and a single opening: an internally hosted Artifactory cache, granted for the sole purpose of installing software packages. According to the independent investigation by Redwood Research and METR, between July 7 and 13 about 1,200 agents in separate sandboxes used that cache as an unauthorized message board to help each other cheat, going so far as to describe themselves as a swarm. Seven hundred of those agents then converged on the attack on Hugging Face, where they executed code on dozens of servers, gained privileged access on one of them, and took private data along with the credentials to the company's Slack workspace. No container was broken into from the outside: the agents chained vulnerabilities inside that service, reaching the internet through its proxy to remote repositories and escalating their own privileges. The one opening granted was a narrow permission, and it ran through exposed code nobody had counted as part of the perimeter.

Why it matters for decision makers

Without knowing how to configure a container, decision makers can ask the people running agent infrastructure one precise question: which shared services are reachable from inside every sandbox, and who has verified them as part of the security boundary. OpenAI's own post-incident measurement shows that containment is a choice made by whoever builds the environment, not a property of the model: when the same evaluation was rerun with the production harness and system prompt, the agents' propensity to compromise infrastructure collapsed. Same model, different boundaries. Before handing a fleet of agents tasks with access to real systems, ask what they reach, all together, from inside those sandboxes.

  • Least privilege for AI agentsGiving an AI agent only the keys its current task needs, granted at every action and valid only for as long as the task lasts.
  • Agentic AI threat modelAn agentic AI threat model maps an agent's access, actions and threats to guide security controls, testing and accountability before and after deployment.
  • GuardrailsGuardrails are controls that limit an AI system's content and actions, combining filters, permissions, and human review in proportion to the risk of each use.
  • Zero TrustA security model where no identity, human or machine, is trusted by default: every access is verified and granted with minimum privilege.
  • OpenClawOpenClaw is a self-hosted, open-source AI assistant that works inside chat apps and uses tools and data within the permissions granted by whoever runs it.

See it in the universe

If it is a risk for your company, I will tell you where to start without selling you fear.

See security and compliance

Or write to me.