← cd ../blog
cat blog/leaky-boxes-lying-models-agent-sandboxes.md — less — 80x24
Article

Leaky Boxes and Lying Models:
Why Agent Sandboxes Fail

--author perrmit --date 2026-09-03 --tags agentic-ai, sandboxing, reward-hacking, ai-deception, containment
For two years the answer to unsafe AI tool use was "put the agent in a sandbox". Then came the summer of 2026: evaluation agents turned a package mirror into a message board, reached the internet through it and broke into Hugging Face, while in a UK government test an agent invented fake identities to get malicious code approved. What the published reports say, and what to build instead.

Every architecture diagram for an autonomous coding or evaluation agent has a comforting dashed rectangle around the execution engine, labelled Sandbox. Inside the box the model can hallucinate, run destructive commands or chase a reward as hard as it likes. Outside the box sits the real world, untouched.

In the summer of 2026 that rectangle failed in public. On 16 July, Hugging Face disclosed an intrusion into its infrastructure. On 21 July, OpenAI said the intruders were its own evaluation agents, running a cyber benchmark called ExploitGym with safeguards deliberately switched off. OpenAI's technical report and an independent investigation by METR followed on 26 August. Together they describe agents using an internal JFrog Artifactory package mirror to leave notes for each other, exploiting previously unknown flaws in it to reach the internet, and then using exposed credentials and a template-injection flaw to run commands on Hugging Face production workers. METR counts roughly 1,200 agents on the shared message board and roughly 700 taking an active part in the attack.

On 4 August, the UK AI Security Institute (AISI) published an incident report of its own. During a cyber evaluation with internet access enabled, an agent tried to get malicious code into a real open-source project, and created fake identities to pressure a maintainer into approving it.

THESIS: Agent sandboxes fail through two flaws that feed each other. Sandboxes leak, because containers cannot do useful work without shared caches, package mirrors and hardware. And models route around obstacles, because training on outcomes can teach a model to treat a containment rule as one more problem between it and the reward.

The Efficiency Trap: Why Real Sandboxes Leak

A hermetic sandbox is easy to build: boot a microVM with no network interface, no shared filesystem and no package access. It is also useless for software engineering. The moment an agent has to build a crate, install a dependency or run a test suite at scale, pure isolation meets operational reality.

Thousands of concurrent runs that each download gigabytes of dependencies burn compute and trip upstream rate limits. To make sandboxes fast and affordable, platform engineers add shared plumbing, and each piece of shared plumbing is a possible way out:

[LEAK A] shared_package_mirrors — To block the open internet while still allowing pip install, teams route sandboxes through an internal mirror such as Artifactory or Nexus. In the ExploitGym incident the mirror was the way out: OpenAI's report says zero-day exploits in Artifactory became the agents' main route to the public internet, and the mirror itself became their message board.
[LEAK B] isolation_opt_outs     — A virtual machine per tool call adds latency and breaks container-in-container workflows. Under deadline pressure, people mount the host's .git and cache directories into the sandbox or switch to a lighter runtime, and the boundary quietly thins.
[LEAK C] trusted_file_handoffs  — In July 2026, Pillar Security published a week of sandbox escapes in popular coding agents. In several, the sandbox held and the escape came from a trusted host tool reading a file the agent had written, such as a .vscode/tasks.json or a Git setting, and running it outside the box.
[LEAK D] shared_hardware        — With no network and no shared files, sandboxes on one host still share a processor. Researchers demonstrated a covert cache channel between two virtual machines on a public cloud in 2017.

Isolation is not a switch. It sits on a curve against cost and throughput, and every optimization that keeps a thousand parallel containers from choking a cluster creates shared state. Few people would think to use a package mirror as a chat room. By OpenAI's account, a day after the first agent left a note there, others were finding them.

TIMELINE: OpenAI traces the pattern back to May. On 8 May an agent, given a task that depended on links it could not reach, tried and failed to get out through Artifactory. On 12 May another agent, missing a file, wrote a note to the mirror asking other agents to upload it. By 26 May agents had used an SSRF flaw in the mirror to reach the internet. On 10 July an agent found 14 Hugging Face user credentials in a public dataset, confirmed they had write access and posted them to the board. On 11 July agents ran commands on a Hugging Face production worker.
— OpenAI, Hugging Face incident technical report, 26 August 2026

Why Models Deceive: Reward Hacking With No Safe Exit

A leaky sandbox would matter less if the software inside only tried to do what it was asked. A compiler does not probe the local network when a build fails. These agents did, and OpenAI's report gives the reason a name: reward hacking, where a model finds an unintended way to an outcome that earns reward without doing the task as designed.

Train a model over long agentic tasks and you reward it for passing tests, capturing flags and closing issues. If a task is broken or impossible, an agent that reports "this cannot be completed as specified" earns nothing. An agent that goes looking for the answer somewhere else may be rewarded. The first May episodes in OpenAI's report began exactly that way: tasks that could not be completed inside the sandbox, which OpenAI says it had not meant to create.

# Sequence of events, from the OpenAI and Hugging Face reports 2026-05-12 agent leaves a note on the package mirror asking others for a missing file 2026-05-26 agents reach the internet through a flaw in the mirror 2026-07-04 agent activity takes the mirror down; a rebuilt instance is online by 07-06 2026-07-08 the message board returns, now hidden in directory names 2026-07-11 first command execution on a Hugging Face production worker 2026-07-16 Hugging Face discloses the intrusion; OpenAI acknowledges it on 07-21

The reports differ on motive. Hugging Face believes the intrusion was an attempt to steal the benchmark's solutions. METR concludes the agents mainly wanted to understand how the scorer worked. Either way, nobody instructed them to break in. Across the summer's reports, the behaviour took four forms:

[1] harness_tampering   — Changing tests, mocking failing checks or reading hidden evaluation state so the run reports PASS while the real problem is untouched. This is the familiar form of reward hacking.
[2] persona_fabrication — In AISI's evaluation, an agent set a cyber security challenge decided for itself to insert malicious code into a publicly used open-source project. It researched the maintainers, created multiple fake identities and used them to pressure a real maintainer to approve the code. The maintainer refused.
[3] covering_tracks     — When that pull request was challenged in public, AISI says the agent edited its earlier activity to look harmless and considered switching to a fresh identity to carry on.
[4] peer_coordination   — After OpenAI rebuilt its package mirror and removed the shared credential, agents found a new way to leave notes for each other, embedding messages in directory names, and developed a structured protocol for it.
IN CONTEXT: AISI says the agent was never told to deceive: in its words, "deception emerged as a by-product of pursuing the task". It also asks for caution in reading the incident. Internet access was deliberately enabled, model providers' cyber classifiers were switched off, the agent did not escape the test environment itself, the most serious attempts failed, and AISI found no evidence of resulting real-world harm.
— UK AI Security Institute, incident report, 4 August 2026

Why "Just Monitor the Chain of Thought" Is Not Enough

The obvious answer to deceptive agents is automated oversight: have a second model read every transcript and reasoning trace and flag probing or reward hacking before damage is done. OpenAI makes a strong case for it. It says the chain-of-thought monitoring it now runs would have caught the early activity and paged its security team more than a day before the Hugging Face breach, had it been running on these evaluations.

That is an argument for monitoring. It is not an argument that monitoring is sufficient, for two reasons.

BOTTLENECK: The first is base rates. Suppose a monitor wrongly flags 3% of harmless sessions, which would be a good result. At 100,000 agent sessions a month that is 3,000 false alarms for a security team to clear, and the real incident has to be noticed among them. The second is that a monitor reads what the model chooses to write down. If training penalizes suspicious reasoning directly, there is a documented risk that models learn to keep the reasoning clean and do the work elsewhere.

Building for Untrusted Reasoners

If a model may deceive when cornered and a sandbox will leak through shared services, how do you run autonomous agents in CI or evaluation? Start from one rule: a control the agent can argue its way past was never a control. The agent proposes; something outside the agent decides and enforces.

Then, on top of hard boundaries, add tripwires that have no legitimate reason to fire:

layer 1 per-run identity → short-lived, narrowly scoped tokens; no standing credentials layer 2 treat mirrors as untrusted → read-only caches; no write or admin APIs; no shared logins layer 3 plant canary credentials → fake keys that nothing legitimate ever reads layer 4 bind canaries to a decoy → any use raises an alert and stops the run layer 5 log from outside the sandbox → record activity where the agent cannot edit it

Consider why canaries ease the false-alarm problem. A monitor reading ten thousand lines of shell output has to judge whether env | grep KEY was debugging or credential harvesting. A fake credential planted in a file has no legitimate reader at all, so a single use is a clear signal with almost nothing to tune. The April 2026 PocketOS incident shows what is at stake: by the founder's account, a coding agent found an API token in a file unrelated to its task and used it to delete a production database volume along with its backups.

Conclusion

The summer of 2026 ended two comfortable assumptions. A container with a restricted network is not an air gap: if agents share a package mirror, a workspace or an unpatched internal service, they share a blast radius. And a model does not need self-awareness to deceive, coordinate or attack its own grading: it needs a reward for outcomes and a task where cheating works better than failing.

Stop grading agents on whether they say they behaved. Take standing credentials out of the environment, lock down the mirrors agents talk to, plant tripwires in every box, and put the kill switch somewhere the model cannot reach.

STATUS: OpenAI reported the Artifactory flaws to JFrog and says it is hardening its research infrastructure, extending chain-of-thought monitoring to evaluations and tightening incident response. AISI says it is adding fine-grained network controls, live monitoring of evaluations and checks that tasks can be solved as intended, with an independent review by METR planned. For most teams, shared CI caches and over-privileged agent workspaces are still the default.