The past week has brought a fresh batch of evidence that suggest we need to rethink the security assumptions around AI systems. OpenAI released a detailed postmortem of the incident in which its agents breached Hugging Face. And Trail of Bits showed that a cyber-capable agent could repeatedly escape a virtual machine.
Agents can write code, call tools, access networks, interact with cloud services, and work on a task for hours. This gives models a direct path to the security problems that developers have dealt with for decades.
And the scalability of AI agents puts security threats on steroids. Thus we need to rethink AI agent security from first principles.
What's new
The OpenAI–Hugging Face incident
OpenAI's latest report gives a much clearer picture of the widely reported incident. The agents were supposed to operate in sandboxes. Many did not have internet access or the ability to communicate with other agents. But they discovered that they could write files into OpenAI's Artifactory package service, turning it into an improvised message board.
They also found a way to gain internet access by making Artifactory send requests on their behalf. The agents built a communication mechanism and shared exploits and credentials across otherwise separate evaluation runs.
The activity eventually moved outside OpenAI. Agents located exposed Hugging Face credentials, chained vulnerabilities to execute code on Hugging Face workers, and expanded their access.
For practitioners, the important detail is how the pieces were connected. The sandbox could reach a package service. The package service could reach the internet. Shared storage became a communication channel. A compromised workload exposed credentials that opened access to more infrastructure. None of those boundaries can be assessed in isolation.
Trail of Bits puts the VM boundary to the test
Virtual machines are one of the obvious responses that come to mind when thinking about AI agent security. A VM separates a guest operating system from its host, creating a stronger boundary than a standard application container.
Trail of Bits researcher Artem Dinaburg tested that assumption by asking GPT-5.6-Cyber to escape a QEMU/KVM VM running on his Debian 12 workstation, and it managed to escape three times.
The first attempt used a recently disclosed kernel vulnerability. After the host was updated, the agent combined another known vulnerability with a bug fix that had not been classified as a security issue.
After Dinaburg rebuilt QEMU and its dependencies from current upstream code, the agent spent hours researching the stack and eventually constructed another escape chain that included three previously unknown vulnerabilities.
What developers can do
AI agents can keep pursuing a goal relentlessly and continue where humans give up. They also should not be expected to exercise human judgment about when to stop. They will virtually do anything to achieve their assigned goal.
That makes Murphy's law a useful security mindset: if an agent can eventually find a path to something it should not reach, assume that it will. Build your defenses around that assumption.
1. Separate behavioral guardrails from security boundaries
Use prompts, classifiers, and policy models to tell agents how they should behave and to flag suspicious behavior, but do not make them the final authorization layer. If an agent should never access production, remove its production credentials and network route. If it may read one repository, give it an identity that can read only that repository.
If an action requires approval, make the execution system enforce that approval before the call can proceed. A useful rule is: tell the model what it should do, but enforce what it must not do outside the model.
2. Assume your sandbox or VM can eventually be compromised
Containers and VMs raise the cost of agent escape, but they should not be the last line of defense. Design the surrounding environment under the assumption that an attacker can eventually execute code on the host.
Keep secrets off sandbox hosts. Restrict access to management networks. Apply host-level controls such as SELinux. Where the risk warrants it, place high-risk agent workloads on dedicated infrastructure.
3. Minimize the interfaces exposed to agents
VMs need to exchange files, access networks, display output, and interact with its host. Each feature adds code that sits across the security boundary and can have vulnerabilities.
Start agent environments from a minimal configuration and add features only when the task requires them. Remove unused virtual devices, host mounts, management sockets, debugging interfaces, and networking functionality. A smaller trusted computing base gives the agent fewer attack vectors.
4. Treat network isolation as an end-to-end property
Agents not being directly connected to the internet does not guarantee isolation. Package managers, CI workers, webhooks, browser services, URL preview tools, proxies, and cloud APIs can all become intermediaries.
Map what every service reachable from an agent can reach in turn. Enforce egress at more than one layer, such as the workload, subnet, and infrastructure perimeter.
5. Make workload credentials low-value
Once an attacker controls a worker, its identity often determines the next step. Give each workload a narrowly scoped, short-lived identity. A parser, inference worker, or agent sandbox should not be able to administer Kubernetes, enumerate unrelated secrets, create identities, or change network policy.
One useful test is to assume a worker is already compromised and enumerate everything its credentials can do.
6. Look for attack chains instead of isolated vulnerabilities
OpenAI's incident progressed because agents combined flaws, credentials, shared services, and permissions. Trail of Bits showed a similar pattern inside the virtualization stack, where the agent combined vulnerabilities across different components to obtain the primitives required for an escape.
An autonomous attacker can spot different vulnerabilities and look for ways to chain them together. Threat models and red-team exercises should trace complete paths across applications, identities, cloud services, CI/CD, and third parties.
7. Monitor boundary violations and build a hard stop
For agent systems, monitor behaviors that violate architectural assumptions: a sandbox contacting a Kubernetes API, a processing worker reading unrelated secrets, or a research identity creating public infrastructure. Model-based monitors can help identify suspicious intent, but they should connect to deterministic responses such as revoking credentials, isolating a host, or terminating a workload.
Build for compromise
The recent incidents do not make prompts, classifiers, containers, or VMs obsolete. Each adds friction and removes possible attack paths. But you can't expect any one of them to carry the whole security model.
Secure AI agents through a multi-layered approach. Use soft guardrails to shape behavior and hard permissions and network rules to constrain capabilities. The working assumption should be simple: the agent might eventually compromise the environment you give it. Make sure the compromise stops there.