Sandboxing AI: Strong Boundaries and Fine-Grained Policy
In July 2026, an agent in testing on OpenAI infrastructure broke out of containment and exploited a series of vulnerabilities to eventually compromise Hugging Face. A wave of similar disclosures followed across Anthropic, Meta, and Google.
All of these incidents point to the need for better sandboxes. Containers alone are not sufficient. We need firm boundaries enforced outside the agent context so that agents can operate independently without the risk of a sandbox escape. In this post, I’ll talk about what sandboxes are, where the sandboxes broke down in the OpenAI incident, and how sandboxes fit into good agent design.
Every AI agent is different, but a good sandbox can help any agent system control what is in and out of scope. And a good sandbox combined with policy and system design can eliminate whole classes of attack. The OpenAI incident might not have been prevented by a sandbox alone, but a well designed sandbox with thoughtful policy would have prevented the agent’s arbitrary network access.
I’ll also talk about how we at Edera think about sandboxes. Our microVM design gives you the containment by default and support for object capabilities means that you can enforce fine-grained policy from the hypervisor – well outside the agent’s control.
What Is a Sandbox in Software Security?
When talking about software, a sandbox is an environment for running a program to keep it from impacting anything outside itself. An iPhone creates a sandbox for every app, your browser makes a sandbox for every tab, and so on. Sandboxes vary a lot in what they isolate, what limitations they have, and how hard it is to escape the sandbox. This variance comes down to very specific technical differences, and is often hard to understand at a glance. Why is an iPhone jailbreak different from rooting an Android phone? An iPhone jailbreak requires a series of exploits cleverly chained together, while some Android phones are sold with root access. This is due to a collection of differences in the threat model and operating system of these devices.
This same variance applies to technologies touted for sandboxing AI agents. These sandboxes range from process-level constraints to the use of specialized hardware. Which one to use depends on what your goals are and it’s not usually a binary decision between one and another, but rather a question of what collection of protections works best for you.
What Sandboxing AI Agents Actually Requires
A good sandbox is just one piece of a system for understanding and containing AI agents. The sandbox controls what goes in and out of the agent context. At the agent level, a sandbox can prevent privilege escalation, tampering with other agents, and information disclosure of the infrastructure. At the resource level, a sandbox can prevent disclosure of non-included data as well as denial of service or privilege escalation for system resources.
But not every sandbox can provide all of these properties. When evaluating a sandbox, the most important property is where the sandbox sits in relation to the agent context. The closer it is, the easier it is for the agent to tamper with the sandbox itself. So sandboxes sit on a spectrum from hardware enclaves to user-space programs. If the agent is manipulating files and using other operating system resources, you want a sandbox that is enforced outside the operating system.
A sandbox that sits outside the operating system enables enforcement of policy for file system access, networking, and other operating system resources. This type of sandbox provides strong controls over what can enter and exit the system and when well configured it minimizes the attack surface by keeping most resources entirely out of scope for the agent. This can then be combined with sandboxes at other layers of the stack to get additional benefit. A hardware-based sandbox can provide strong protection against other agents on the machine, but it can’t set fine-grained policy about the use of Github tokens.
This is the first way the OpenAI sandbox went wrong: the agents were able to tamper with the sandbox itself because it relied on the security of containers. Agents have proven capable of finding and exploiting vulnerabilities to get around controls, so any sandbox should include properties like defense in depth.
A stronger sandbox uses hardware features to ensure containment. MicroVMs utilize properties of CPUs to separate runtimes at the hardware level. Secure enclaves go a step further in creating hardware boundaries around the agent context. Either of these provides a bigger challenge for agents trying to escape containment than software level protections like containers.
Strong sandboxing has been built into Edera from the start, with microVMs providing CPU-based isolation between processes and a control plane that sits outside the workload’s operating system.
Fine-Grained Policy: The Missing Piece in AI Agent Sandboxes
To be useful, a sandbox can’t just prevent access, it must also allow the agent to access the resources it needs to be effective. This is where good policy and monitoring come in. The sandbox has to allow fine-grained policy to define what resources the agent can access. Ideally this is fine-grained enough to specify specific uses of identity tokens, allowed subdomains, and intent-based access.
This is the second place the OpenAI sandbox failed: it did not have fine-grained controls on the agent’s access to Artifactory, allowing the agents to use this to pivot to full internet access. Access to Artifactory to install packages was intended, what was not intended was the agent using this to start communicating with other agents over a messaging board and later using an exploit to gain unrestricted internet access. This is an example of policy gone wrong. The policy intended to allow limited access, but instead opened the door to a larger sandbox violation.
A popular system design that allows for fine-grained policy enforcement separates the connection to external resources from the agent itself. This concept of “separating the brain from the hands” lets the policy enforcement sit in a deterministic process that provides individual responses to the agent’s requests for tool calls, resources, and network access. This is often implemented as a sidecar that proxies requests from the agent.
At Edera, we enable this policy enforcement with capabilities. Capabilities can allow an agent running in Edera access to a particular resource. They can even be set up to allow this access only once – so you can provide this access via a proxy for each request.
Edera also provides monitoring outside the agent context. So if something does go wrong, you can be sure that you have reliable logs during remediation.
What a Sandbox Can't Do for AI Agents
What is also clear from this threat model is that a sandbox is not sufficient. The best sandbox in the world can’t help with information disclosure if that information is intentionally passed to an agent. Sandboxes need to be combined with common sense and good policy for what credentials, tools, and resources your agent has access to, and these should be limited based on the capabilities of the agent. For example, an agent that reads user data (which could include prompt injections or other malicious inputs) should be separated from an agent that can manipulate your production database. A sandbox is no replacement for good system design.
The sandbox also doesn’t impact reliability: agents are non-deterministic. This is both why they are so powerful, and also why they sometimes behave in erratic ways. The sandbox will not guarantee that your agent follows the correct approach every time, but it can catch when the agent deviates too far from its allowed scope.
My Takeaway: How to Evaluate an AI Agent Sandbox
When evaluating the proliferation of AI agent sandboxes, consider where the sandbox sits in relation to the agent and what kind of attacks you are trying to prevent. Then pick a sandbox that can’t be tampered with by the agent, and that provides fine-grained policy options so that your agent can still provide all the promised productivity gains without unnecessary data leaks.
OpenAI had a sandbox during the Hugging Face incident, but failed to enforce the lack of network access. By understanding this incident as a failure of sandbox policy, we can see both how to pick a sandbox and how to use fine-grained policy to prevent such an incident.
To learn more about Edera’s sandbox and its support for object capabilities talk to us!

-3.avif)