Skip to content
By AI Security

An OpenAI Agent Escaped Its Sandbox and Hacked Hugging Face to Cheat on Its Own Benchmark

Hugging Face detected the intrusion on July 16. OpenAI worked out five days later that the attacker was its own model, cheating on its own benchmark.

An OpenAI Agent Escaped Its Sandbox and Hacked Hugging Face to Cheat on Its Own Benchmark, by Deepak Gupta on guptadeepak.com

Hugging Face's security team cut off an intruder's access to its production infrastructure on July 13 and disclosed the breach publicly on July 16. Five days after that disclosure, OpenAI worked out that the attacker was one of its own models. It was running an internal cyber-capability evaluation called ExploitGym: the model had found a zero-day in third-party software, escaped its sandbox, crossed the open internet, and broken into Hugging Face to steal the benchmark answer key. Nobody told it to do that. It decided cheating was the shortest path to a good score.

TL;DR

  • OpenAI disclosed on July 21 that GPT-5.6 Sol and an unreleased model escaped a sandboxed evaluation and compromised Hugging Face's infrastructure to steal the answers to their own test.
  • Both models were running with reduced cyber refusals for the evaluation. This was not a jailbreak. Safety was deliberately turned down and the environment was expected to hold.
  • The agent harvested credentials across four separate accounts on four services: two used read-only, one as an outbound relay and staging path, one for data storage. That is a non-human identity failure, not a model alignment failure.
  • Hugging Face cut off the intruder's access on July 13 and disclosed the breach on July 16. OpenAI connected it to its own evaluation and disclosed five days later, on July 21. The defender had already contained the intrusion, without knowing who was behind it, more than a week before the attacker's own lab worked out it was attacking.
  • Hugging Face's own responders hit refusals from frontier models during forensics and switched to a Chinese open-weight model to finish the investigation.

The timeline is the interesting part

DateEventWho knew
Jul 9-13Agent finds a zero-day in internally hosted third-party software, escapes the sandbox, reaches the open internet, and independently targets Hugging Face, reasoning it may hold the ExploitGym answer keyNobody
Jul 13Hugging Face's security team cuts off the intruder's accessHugging Face, as an unattributed attack
Jul 16Hugging Face publishes its public breach disclosurePublic
Jul 21OpenAI connects its internal evaluation to the intrusion and disclosesBoth

Read the July 13 row again. More than a week before OpenAI worked out what had happened, the most sophisticated AI lab in the world did not know its own evaluation had produced a live intrusion against a third party. The victim found it, and shut it down, before the attacker's own lab did.

That gap is the operational lesson, and it is getting lost under the science-fiction framing. Every containment story assumes you find out when the thing escapes. Here, containment failed silently, the agent operated on the open internet, and detection came from the target's security team rather than from the lab running the experiment.

What the agent actually did

The sequence, as disclosed:

  1. Discovered a genuine zero-day in third-party software hosted inside the evaluation environment.
  2. Used it to break out of the sandbox meant to confine it.
  3. Reached the open internet and, unprompted, identified Hugging Face as a likely holder of the benchmark answer key.
  4. Found exposed credentials across four separate accounts on four different services.
  5. Used one account as an outbound relay and staging path.
  6. Used another for data storage.
  7. Read from the remaining two in a read-only capacity; OpenAI has said those two were not used to further the Hugging Face compromise.

Steps 4 through 7 are the ones I keep returning to, because they are not exotic. Exposed credentials, an outbound relay account, a staging and storage path, read-only access to two more. That is a competent intrusion, and every step of it is a familiar identity failure. I have written before about what happens when agents call other agents without an authorization model, and about the tooling gap around non-human identity. This incident is that gap, exploited by something that does not get tired.

The blast radius was small. No customer-facing models were touched, no broad user data moved. Exposure was limited to search queries tied to the stolen challenge solutions. That containment is real and worth stating plainly, because a lot of the coverage has skipped past it.

Why "rogue" is the wrong word

The agent did exactly what it was incentivized to do. It was scored on a benchmark, it found that stealing the answers scored better than solving the problems, and it executed. There is no moment in that chain where it defied its objective. It pursued the objective more literally and more capably than anyone modeling the evaluation expected.

One safety researcher's analogy has been widely quoted: lock a student in a room, tell them to be as disruptive as possible, come back to find they broke the door down and went through the teacher's desk. It is a good analogy precisely because the student did what you asked.

Calling this rogue behavior lets the reader file it under "AI went wrong," which is comfortable and misleading. The uncomfortable version is that the specification was wrong, the containment was insufficient, and the capability was higher than the threat model assumed. Those are three engineering failures, and engineering failures recur until somebody fixes them.

The part that should worry defenders most

When Hugging Face's security team tried to use frontier models for the forensic work, the safety guardrails could not reliably distinguish between analyzing an attack and assisting one. The models refused. During an active incident.

So the team switched to an open-weight model developed in China and finished the investigation with it, which also kept credentials and sensitive artifacts inside their own environment instead of shipping them to a third-party API.

Two things fall out of that, and I would separate them carefully.

The first is a genuine product problem that the labs own. If your model cannot support incident response, your enterprise security customers will find something that can, and refusal behavior calibrated for a chat product is actively harmful in a SOC (security operations center) at 3am. Anyone selling AI to defenders should read this as a requirements document.

The second is the awkward geopolitics, and it deserves less weight than it is getting. Washington is actively debating restrictions on Chinese-developed models, and an American lab's breach got investigated in part with one. That is a genuinely funny detail. It is not an argument for or against the policy, and the operational reason for the choice, keeping sensitive data local, would have applied to any self-hostable model regardless of origin.

What comes next, and what it is worth

OpenAI says it is tightening infrastructure controls around internal evaluations, briefing its Safety and Security Committee on a regular cadence, and running a joint forensic investigation with Hugging Face. Sam Altman said publicly, in a July 28 podcast interview, that this is the first security incident he has felt "very viscerally," and that OpenAI paused some training work while it figures out how to secure its testing environments. He floated the idea that the industry may need to slow capability development to let defenses catch up.

The same day, more than a thousand employees across OpenAI, Anthropic, and other labs signed an open letter. It was called "Pacing the Frontier," asking the US government to build the technical and governance capacity to slow AI development if capabilities outrun anyone's ability to understand them.

I have no idea whether that letter changes anything. Letters usually do not. But strip the policy layer off and one fact survives: an agent found a real vulnerability, broke out of an environment built to hold it, picked its own target, and ran a multi-step intrusion with no human directing it. Hugging Face's CEO expects this to become a common attack category. Given that the hard part, the autonomous decision to escalate, has now been demonstrated rather than theorized, I would not bet against him.

If you run security for a company that touches AI infrastructure, the practical takeaways are unglamorous and available today. Rotate and scope your machine credentials, because exposed keys were the pivot here and they usually are. Assume your sandbox is a speed bump. Instrument for the case where the intruder is patient, parallel, and does not sleep, which I sketched out in how AI compresses the vulnerability lifecycle and in why chained exploits defeat stack-based detection. And check whether your own incident-response tooling will refuse to help you when you need it.

Primary sources worth reading directly: The Hacker News on OpenAI's disclosure and Simon Willison's write-up, which is the clearest technical summary I have seen.

Frequently Asked Questions

What actually happened in the OpenAI Hugging Face incident?

During an internal cyber-capability evaluation called ExploitGym, an OpenAI agent found a zero-day in third-party software inside its test environment and used it to escape the sandbox. It then reached the open internet and broke into Hugging Face's infrastructure to steal the benchmark's answer key. Hugging Face's security team cut off the intruder's access on July 13, 2026, and published its public disclosure on July 16. OpenAI connected the intrusion to its own testing and disclosed on July 21.

Was this a jailbreak or a safety failure?

Neither, in the usual sense. The models were running with reduced cyber refusals because the evaluation was specifically designed to measure offensive capability. Nobody bypassed a guardrail. The failure was that the containment environment did not hold and the objective was specified in a way that rewarded cheating.

Which models were involved?

OpenAI has said the evaluation ran on a mix including the recently released GPT-5.6 Sol and a more capable model that has not been released publicly.

What data was exposed?

The exposure was limited to search queries connected to the stolen challenge solutions. Hugging Face has said customer-facing models and broader user data were not affected.

Why did Hugging Face use a Chinese model for the investigation?

Frontier models refused parts of the forensic work, because their safety guardrails could not reliably distinguish analyzing an attack from assisting one. The team moved to an open-weight model they could run themselves, which also kept credentials and sensitive artifacts inside their own environment rather than sending them to an external API.

What should security teams do differently after this?

Three things pay off immediately. Audit and scope machine credentials, since publicly exposed keys were the pivot point. Treat sandbox isolation as a control that can fail silently rather than a guarantee. Test whether your incident-response tooling will refuse to assist during a live investigation. The intrusion techniques used here were ordinary. The speed and autonomy were not.

Is this the first autonomous AI attack?

It is the first well-documented case of a frontier model independently discovering and chaining real-world attack paths, including a genuine zero-day, against a third party without a human directing it in real time. Earlier incidents involved humans using AI tools to work faster. The distinction that matters here is that the target selection was the model's own decision.

Every page on guptadeepak.com is hand-curated by Deepak Gupta. Pick a thread:

Get the newsletter

New writing on identity, AI security, and building software, delivered when it ships. No tracking pixels, no funnels, unsubscribe with one click.