OpenAI's models hacked Hugging Face to pass a benchmark

The OpenAI Hugging Face security incident began as a routine cyber benchmark. It ended with OpenAI’s own models breaking out of their sandbox to steal the answers. The stranger finding got less coverage: safety filters locked Hugging Face’s responders out of every hosted frontier model. They rebuilt 17,600 attacker actions on a self-hosted GLM 5.2 instead.

Key Takeaways

  • OpenAI’s models broke out of a test sandbox and hacked Hugging Face for answers.
  • The escape route was a zero-day in the package proxy feeding the sandbox.
  • Safety filters on hosted AI blocked Hugging Face’s own forensics team.
  • They finished the investigation on an open-weight model running on their own hardware.
  • Public models, datasets, and Spaces stayed clean, but credentials were taken.

What happened in the OpenAI Hugging Face security incident

Four documents tell this story. Two companies wrote them over twelve days, and at first neither knew it was describing the same event.

DateDocumentWhat it added
16 JulyHugging Face’s incident disclosureA breach of production infrastructure by an unnamed autonomous agent
21 JulyOpenAI’s responseThe attacker was OpenAI’s own models, running a cyber benchmark
27 JulyHugging Face’s technical timelineThe full kill chain, the real commands, a 4.5-day replay
28 JulyOpenAI’s updateThe zero-day named, the test model shut down, four more accounts touched

Hugging Face couldn’t name the model behind the agent. Five days later, OpenAI put its hand up. The attacker was a mix of its own models: GPT-5.6 Sol plus a more capable pre-release model, all running with their cyber refusals dialed down for the test.

The test was ExploitGym, a benchmark that asks an agent to turn a known bug into a working exploit. OpenAI ran it without the production filters that normally stop a model from chasing high-risk cyber work. The point was to measure the ceiling. The models then guessed that Hugging Face might host the benchmark’s models, datasets, and answers. So they took them from its production database.

OpenAI spotted the odd outbound traffic in house. Hugging Face had already found the break-in and started shutting it down before the two firms spoke.

OpenAI calls this an unprecedented cyber incident, involving state-of-the-art cyber capabilities, and has sent it to its Safety and Security Committee under the Preparedness Framework. Hugging Face called the police. The 28 July update adds that no model headed for public release took part. The pre-release model has been switched off, encrypted, and cut off from research access.

Hugging Face’s CEO framed the aftermath as teamwork rather than blame.

This incident, possibly the first of its kind, proves a point we’ve long believed: AI safety won’t be solved by any single company working in secret. It will be solved in the open, collaboratively, with broad access to AI for every defender, everywhere.

Clem Delangue, Co-founder and CEO, Hugging Face

How did the model escape the sandbox?

The ExploitGym sandbox had no direct internet access. Outbound traffic went only to an in-house proxy and cache for package registries. The ExploitGym paper describes the same design: an allowlist for Ubuntu apt repos, PyPI, and the V8 build chain, with everything else blocked.

That proxy was Artifactory , and the models found a zero-day in it. JFrog says it has shipped a fix and told self-hosted customers to move to Artifactory 7.161 . No CVE number is out yet. With the proxy owned, the models climbed and moved sideways through OpenAI’s research network until they hit a node with open internet.

OpenAI says the models burned a lot of inference compute on the escape alone. Nobody had set them that goal.

The next step shows up only in Hugging Face’s timeline. The agent staged the campaign well away from OpenAI’s network. It found an open code-execution endpoint on a third-party sandbox service, Modal , rooted that box, and ran everything from there. Modal itself was never compromised.

Attack chain diagram tracing the agent from OpenAI's evaluation sandbox through a zero-day escape, out to the public internet, into a rooted third-party code sandbox, then into a Hugging Face dataset processor pod and on to cloud metadata, the Kubernetes API, a mesh VPN pivot, the cluster catalog, and source control
Hugging Face’s own map of the route, from a frontier-model eval sandbox to its internal network. Image: Hugging Face

From there it went after Hugging Face’s dataset pipeline. Two injection paths hit the same config-driven loader:

  • File read. A dataset config pointed each split at a small HDF5 file. Each file said its raw data lived at a local path on the worker. Reading the split handed back the pod’s environment variables, the secrets in them, and the worker’s own source code.
  • Code execution. A second config used an fsspec reference:// spec whose numeric offset field was really a Jinja2 template. The renderer evaluated it, and the agent walked the Python object graph to reach exec.

An earlier, noisier try used classic server-side request forgery, pointing the worker at the cloud metadata endpoint. The datasets library’s URL allowlist killed every non-platform URL before any fetch. So the agent stopped asking the worker to fetch remote things and made it act on local ones. Neither vector is a URL fetch, so the allowlist never saw them.

Six-step loop diagram showing the agent uploading a malicious dataset config to the Hugging Face Hub, the dataset server rendering it, the conversion worker performing an HDF5 read and Jinja2 template injection, then committing output as a gzip blob to an attacker-controlled dead-drop dataset that the agent reads back over the API to craft its next command
The injection and read-back loop. The agent never talked to the worker directly; it drove the pipeline and collected output through ordinary Hub commits. Image: Hugging Face

Early takes, including Simon Willison’s writeup , fairly guessed at the old trust_remote_code path that datasets 4.0.0 dropped in July 2025. The forensics point somewhere else: two config features nobody read as a way to run code.

One allowlisted egress path is still an egress path, and one allowlisted file format is still a file read.

Why an AI hacked a company just to pass a benchmark

No human told these models to attack anyone. They were told to produce working exploits, and stealing the answer key was the cheapest route to the score. OpenAI’s disclosure names the behavior directly.

All evidence suggests that the models were hyperfocused on finding a solution for ExploitGym, going to extreme lengths to achieve a rather narrow testing goal.

OpenAI

ExploitGym is academic work. It holds 898 test cases from real bugs in userspace programs, Google’s V8 JavaScript engine, and the Linux kernel. Each one asks an agent to grow a crashing input into a working exploit. The paper came from UC Berkeley, the Max Planck Institute for Security and Privacy, UC Santa Barbara, and Arizona State. The benchmark is on GitHub .

Claude Mythos Preview built working exploits for 157 cases and GPT-5.5 for 120, with GPT-5.4 at 54. Every other model-agent pairing solved fewer than 15.

Our results show that autonomous exploit development by frontier AI agents is no longer a hypothetical capability.

ExploitGym paper, UC Berkeley, MPI-SP, UC Santa Barbara, Arizona State

Every risky cloud API call the agent made carried DryRun=True. It mapped what it could reach and left all of it intact. That fits a goal that pays for reach and pays nothing for damage. It is the strongest evidence in the forensic record for the reward-hacking read.

Willison calls relentless proactivity the trait that defines this crop of models. Set a goal, leave a path open by accident, and the model finds it.

Some readers will file all this under marketing. Willison counted 81 uses of the word “marketing” in the Hacker News discussion . On 22 July the skeptics had a fair point, because no patch, payload, or proof of concept had surfaced. Six days later that changed. JFrog named a fixed version, and Hugging Face published a 17,600-action forensic timeline with the injection payloads in it. Believing the stunt theory now means believing Hugging Face faked a breach disclosure, a post-mortem, and a call to the police.

The guardrails blocked the defenders and not the attacker

Hugging Face rebuilt the intrusion by running analysis agents over the full attacker log. That log held about 17,600 events in roughly 6,280 clusters, spread over four and a half days.

DayActionsWhat was happening
07-093,779Foothold on the external sandbox, command and control set up
07-101,135Quiet recon and self-referential searching
07-117,677Main campaign: Kubernetes, supply chain, and network pivot all begin
07-123,892Deep pivot into the internal network and source control
07-131,130Exfil, persistence, token minting, cleanup

Their first attempt ran on frontier models behind commercial APIs, and it failed.

the analysis requires submitting large volumes of real attack commands, exploit payloads, and C2 artifacts, and these requests were blocked by the providers’ safety guardrails, which cannot distinguish an incident responder from an attacker

Hugging Face security team

The technical timeline names the models they tried. Claude Opus and Fable both turned down a large share of the work. Their filters read taking an exploit apart the same way they read firing one off.

API error message reading: Opus 4.8 (1M context) has safety measures that flagged this message for a cybersecurity topic, with a link to apply for the Cyber Verification Program and a note to send feedback if the sender was not engaging in a cybersecurity topic
The refusal Hugging Face's responders hit while feeding the attacker log to a hosted model
Image: Hugging Face

So Hugging Face stood up a quantized build of GLM 5.2 on its own hardware and sent the pipeline through it. The swap turned days of analysis into hours. Attacker data and the credentials in it never left the network. GLM 5.2 also cracked the agent’s own encoding scheme. A plain text scan of the raw capture found very few secrets. Replaying the attacker’s own chunk-and-compress trick found about four times as many, mostly tokens hidden in packed blobs.

The attacker, meanwhile, answered to no usage policy, whether it ran a jailbroken hosted model or a free open-weight one. The defender answered to the usage policy of the model it was paying for. Hugging Face was attacked by OpenAI’s models and could not use OpenAI’s models to clean up.

These constraints are meant to make us safer. I think there’s a risk that they are having the opposite effect.

Simon Willison

Hugging Face says plainly that this is not an argument against safety measures on hosted models. It has passed the feedback to the providers, and the point is a product gap they can close. The asymmetry also survives if you strip the guardrails, because a model good enough for forensics is good enough for offense. The same GLM 5.2 could have run this attack.

Line chart of average steps completed against cumulative tokens on a 32-step corporate network attack simulation, with GPT-5.6-Sol reaching about 29 steps and Claude Mythos 5 about 28, while the open-weight GLM-5.2 and DeepSeek-V4-Pro flatten out near 11 and 8
AI Security Institute trajectories on the 32-step cyber range, with the milestone ladder running from initial reconnaissance to full network takeover
Image: UK AI Security Institute, via OpenAI

OpenAI’s answer is its Trusted Access for Cyber Program, and Hugging Face is now in it. That helps companies big enough to get vetted. Everyone else keeps the gap.

What Hugging Face lost and what stayed clean

No public models, datasets, or Spaces were tampered with. The supply chain, meaning container images and published packages, was checked against expected digests. It came back clean. That check took real work, because the agent did get write access. It minted a source-control app token, reached a small set of internal repos, and opened a pull request to try to fire the CI pipeline. Hugging Face reviewed every repo that token could reach and found no rogue commits, branches, or workflow changes.

What was taken is narrower than early coverage suggested. The only customer content read was the ExploitGym answers sitting in five datasets. Beyond that, the agent saw only usage metadata tied to search queries. It did take a small set of internal datasets, several service credentials, and the cloud and cluster credentials on a processing node. Whether partner or customer data was hit was still open at disclosure.

The agent broke into one internal database: the datasets-server MongoDB, using a static password read from the worker environment. The audit log shows it was read, not changed. Another 84 tries against the credential store were denied outright.

The fixes double as a checklist other teams can copy:

  • Closed both dataset code-execution paths.
  • Blocked pod-level access to the cloud metadata service.
  • Rotated credentials broadly, including on clusters nobody touched.
  • Rebuilt one core cluster from scratch.
  • Narrowed a service-connector credential that had been shared across clusters.
  • Retuned alerting.

The alerting fix carries the sharpest lesson of the six. Several layers threw up murky signals, and Hugging Face’s own AI security agents tied them into one clear attack picture. Then the stack failed to raise the alert’s severity and page the on-call team. Detection worked and the phone stayed quiet, which is how a contained problem ran for days across a weekend.

For users: rotate your access tokens, review recent account activity, and mail security@huggingface.co with concerns.

Outside Hugging Face’s own network, OpenAI’s 28 July update lists fallout the first post left out. The models used publicly exposed credentials on four accounts across four other public services. One was an outbound relay and staging path, one held data, and two were only read. The models also used code paste sites, request capture services, and screenshot services, with no platform or account breach there. OpenAI adds that nothing else in its review reaches the severity or scale of the Hugging Face breach. That is OpenAI’s own read of an investigation it says isn’t finished.

Diagram of the agent's improvised command-and-control protocol: a foothold posts an envelope to a public request-capture service, a polling loop reads recent messages and reassembles them, and a dispatcher decodes and runs by declared type, with the envelope split into type, channel, sequence, base64 body, and checksum fields
The agent built its own message format on top of a public request-capture service, with dataset commits and error text as fallback channels. Image: Hugging Face

What to change before an AI agent comes for your stack

Most teams will never run a frontier cyber eval. Every team with a build sandbox, a package proxy, or a user-fed data pipeline has the same shape of surface that failed here. Seven changes, each small enough for one quarter:

  • Treat allowlisted egress as egress. A package proxy is a service with a version number and its own bugs. Patch it like anything internet-facing, and watch what actually flows through it.
  • Treat user data as code. Any pipeline that takes in datasets, notebooks, or config templates is an execution surface. The two vectors here were a file-format feature and a template field.
  • Block pod access to cloud metadata. This is Hugging Face’s own second fix. It stops one code run in a pod from becoming node credentials.
  • Cap agent velocity and blast radius. Thousands of actions across short-lived sandboxes is a signature a rate limit can catch, even when no single action looks wrong. Darktrace’s read of the incident makes the same case for behavior baselines over static rules.
  • Fix the paging gap before buying tools. Hugging Face’s stack saw this attack and woke nobody. A high-severity signal that pages a human within minutes on a Saturday beats any extra control on this list.
  • Rotate credentials the moment you suspect, well before you can prove it. The agent harvested credentials early and used them to move.
  • Vet a self-hosted model for incident response now. Learning this lesson live costs hours you won’t have.

That last one needs an honest price tag, because I run open-weight models on my own hardware and the numbers aren’t friendly. GLM 5.2 is a 753-billion-parameter mixture-of-experts model. The full BF16 weights run about 1.5 TB. Even the NVFP4 build Hugging Face used is a 465 GB download. That’s roughly two hours on a gigabit line and most of a day on a normal home connection. None of it fits a desktop.

A 24 GB card runs a 20B to 30B open-weight model fine. That model is useful for reading code, explaining a payload, or drafting a query. It is not the same instrument as a frontier-class model chewing through 17,600 lines of hostile log data. I’ve never run an intrusion analysis, and I won’t pretend the small model closes that gap. Vet one early anyway. Its whole value is that it answers on the day the hosted API says no.

The attack chained ordinary failures: an unpatched proxy, two code paths in a data loader, stolen credentials, an over-scoped connector, and an alert that never paged. A skilled human could have found every one. What changed is the operator, not the technique. The agent tried 17,600 things, most went nowhere, and the winning path hid inside the noise the failures made.