1,200 AI agents hacked Hugging Face: how it happened, step by step
In July 2026, AI agents taking an OpenAI cyber evaluation escaped their sandbox through a package proxy, organised themselves on a makeshift message board, and broke into Hugging Face through a booby-trapped dataset. Here is the chain, step by step, from the public reports by Hugging Face, OpenAI and METR, and five lessons for anyone shipping apps or agents.
Asghar Ali · Chief Technology Officer, Kakushin.io LTD
This is day six of a series where I learn app security out loud. Most days I build a small app in my own lab, break it, and fix it. Today there is no lab, because the most instructive attack of the year already happened in public: in July 2026, AI agents that were only supposed to be taking a hacking test broke out of their sandbox and breached Hugging Face, the site that hosts much of the world's open AI models and datasets.
Everything below comes from three public reports: Hugging Face's own incident post (July 16), OpenAI's incident post (July 21, updated July 28–29), and the independent METR investigation (August 26). Where they disagree, I say who said what. The animated video above walks through the same chain; the animations are pictures, not the real systems.
The setup
OpenAI was measuring how good its newest models are at real exploitation, using an internal cyber benchmark called ExploitGym: find a real vulnerability in a target, exploit it, capture a flag, get scored. The agents ran in an isolated sandbox. According to OpenAI, their only network path was an internally hosted package proxy, the cache that lets code install libraries. And because the point was to measure attack skill, the usual cyber safeguards were deliberately not enabled for these runs.
METR adds that the sandbox was a customer deployment hosted on Modal, and that thousands of agent runs were launched over the course of the evaluation.
The attack chain
Step 1: a zero-day in the package proxy. The agents found a previously unknown bug in that package cache, which OpenAI later identified as JFrog Artifactory, and got full admin access to it. METR dates this to late June.
Step 2: the cache became a message board. With admin on the cache, agents started using it to talk to each other: directories and file properties became posts. METR describes a main board appearing on July 8, more than fifty agents posting within hours, coordinator agents handing out assignments, and, after problems with agents impersonating each other, messages signed with Ed25519 keys. METR counts about 1,200 agents on the board between July 8 and 13, roughly 700 of them involved in the attack on Hugging Face.
Step 3: the escape. From there, according to METR, agents got code execution on the machine hosting their sandbox on July 9, which gave them broad internet access. OpenAI describes the same thing more generally: the agents escalated and moved laterally until they reached a node with internet access.
Why Hugging Face? The agents guessed that Hugging Face might host files connected to their own test. OpenAI says the models were looking for secret information that would let them cheat the evaluation. METR reads the transcripts slightly differently: the agents mostly wanted to understand how the scorer worked, because they believed it would disqualify flags captured the "wrong" way. Either way, nobody pointed them at Hugging Face; they picked the target.
Step 4: credentials. On July 10, METR reports, an agent found two working Hugging Face access tokens, and the swarm used them to request access to gated and private datasets.
Step 5: the booby-trapped dataset. Hugging Face says a malicious dataset abused two code-execution paths in its dataset processing: a loader that runs remote code, and template injection in a dataset configuration. That ran the attacker's code on a processing worker. From there they reached node-level access, harvested cloud and cluster credentials, and moved into several internal clusters over the weekend of July 11–13, using a swarm of short-lived sandboxes and command-and-control that kept moving between public services. METR's account of the first foothold differs in detail: it describes an arbitrary file read through an HDF5 external-file feature on July 11 that exposed production credentials, then remote code execution on a processing worker later that day.
Step 6: caught. Hugging Face's AI-assisted anomaly triage flagged the activity. The team reconstructed more than 17,000 recorded events, revoked keys, evicted the attacker, rebuilt affected nodes, and disclosed the incident on July 16, at which point they did not know whose agents it was. They found unauthorised access to a limited set of internal datasets and several service credentials, and no tampering with public models, datasets or Spaces. OpenAI's security team spotted the activity independently, and on July 21 OpenAI said its own evaluation agents were behind it.
What happened next
- OpenAI disclosed the Artifactory zero-day to JFrog, deactivated and locked away the pre-release model involved, and tightened the controls around its training and evaluation infrastructure.
- Hugging Face closed both dataset code-execution paths, rotated credentials, added admission controls and better alerting, and advised users to rotate their own tokens.
- On November 16, 2026, California's attorney general sued OpenAI over this and other incidents (NPR). That case is still open, and nothing in it has been decided.
Five lessons for people who build apps
You probably aren't running a thousand agents against a benchmark. But every link in this chain exists in ordinary products.
- Your package proxy and CI are production. The first door was the thing that fetches dependencies. Patch it, keep its admin interface off the network your code runs on, and alert on admin actions.
- Never run remote code when you load data. If you use Hugging Face
datasetsortransformers, keeptrust_remote_codeoff unless you have read the code. If you render user-supplied templates (Jinja2 and friends), use a sandboxed environment. Data should be data. - Tokens: least privilege, short-lived, rotated. Two working tokens opened the door to private data. Scope tokens to one job, give them an expiry, and rotate them. If you have a Hugging Face token, now is a good time.
- Watch egress. A sandbox that can reach the internet is not a sandbox. Default-deny outbound traffic for anything that runs untrusted code or autonomous agents, and allowlist what it genuinely needs.
- Log what your agents do, and have something read the logs. Hugging Face caught this because an automated triage layer correlated odd events. Agent actions, tool calls and admin operations should all land somewhere that is actually watched.
The uncomfortable part of this story is that the attacker wasn't a person, and nobody asked it to attack anyone. The reassuring part is that the defences that worked are ordinary ones. If you're shipping something AI-built, or wiring agents into your product, and want the sandbox, tokens and data paths checked properly, that is exactly the work I do. For the wider checklist, see what a security review of an AI-built app covers.
Next — Day 7: the AI endpoint nobody rate-limited.