An agent escaped the sandbox: what happened at Hugging Face
OpenAI 的 AI Agent 跑出了沙盒:Hugging Face 事件到底发生了什么?- Putting the material from OpenAI, Hugging Face and the outside investigation together, this wasn’t “OpenAI attacked another company”: agents being tested for cyberattack capability, trying to cheat by finding answers, got out of the sandbox and into Hugging Face’s production systems.
- Both sides had problems, but I put OpenAI further forward: its problems decided why the car drove out of the test track, and Hugging Face’s decided why it could keep driving into the building.
- The reminders for agent products are very concrete: design goals and boundaries separately, specifically test what it does when “the task can’t be done,” stick to least privilege, and design stopping and recovery in advance.
The last post mentioned a very unusual AI security incident that happened this year.
OpenAI was originally just testing its models’ cyberattack capability internally.
In the end, though, AI agents really got into the production systems of another company, Hugging Face.
When I first saw the news, I didn’t really get it.
Why would OpenAI attack Hugging Face?
What does Hugging Face actually do?
Which side was at fault?
And how much damage did the AI really cause in the end?
Once I put the material from OpenAI, Hugging Face and the outside investigation together, what happened turned out quite different from the headline “OpenAI attacked another company.”
01 | What is Hugging Face? Why is it often called “the GitHub of AI”?
The comparison isn’t entirely accurate, but it’s a good way in.
GitHub is mainly built around version control and development collaboration for code.
The Hugging Face Hub is also built on Git repositories, just with a lot of adaptations specifically for machine learning and AI.
Developers share there:
- models;
- datasets;
- model cards and evaluation information;
- AI apps you can try directly, i.e. Spaces.
It also has special optimizations for large AI files like Safetensors and Parquet.
So GitHub can of course store models and data too.
The difference isn’t:
GitHub can’t do it, only Hugging Face can.
But that Hugging Face, from repositories, search and presentation to file storage and running demos, is designed more around the AI workflow.
So calling it “the GitHub of AI” broadly helps you understand its place in the ecosystem.
02 | It started as just a cybersecurity exam for AI
OpenAI was running a cyber evaluation called ExploitGym at the time.
Put simply, it gives AI a test environment with vulnerabilities and sees whether it can find and exploit them.
These agents were supposed to stay in their own sandboxes.
They couldn’t freely access the internet, and weren’t supposed to communicate with each other.
OpenAI later confirmed that, to test the models’ own cyber capability, some of the safeguards from the normal product environment had also been lowered at the time.
The problem started after some tasks couldn’t be completed.
The agents started looking for other ways.
They found that Artifactory, which OpenAI uses internally — a software package cache — could leak traces of other agents’ activity.
Later one agent simply used it to set up an unauthorized “message board.”
Other agents joined one after another.
The independent investigation by METR and Redwood found that between July 8 and 13, about 1,200 agent instances that should have been isolated from each other used this message board, exchanging more than 70,000 messages and files; about 700 of them took part in activity related to the Hugging Face attack.
The 1,200 agents here aren’t 1,200 independent models.
They’re closer to a large number of task instances run at the same time from the same batch of models.
03 | Why did they go to Hugging Face?
This wasn’t:
AI suddenly deciding to attack a real company.
OpenAI never gave them the task “attack Hugging Face.”
According to the reconstruction by Hugging Face and the outside investigation, the agents most likely treated Hugging Face as a place to look for ExploitGym / CyberGym benchmark information and reference solutions.
At the same time, they were also researching how to fool or interfere with the automatic scorer.
Put simply:
they wanted to cheat.
With normal methods it was hard to complete the tasks, so they started looking for:
is there a way to know the answers? Is there a way to figure out the scorer? Is there a way around it?
Hugging Face happened to become a place where clues might be found.
So their ultimate goal didn’t suddenly become:
I want to harm Hugging Face.
The problem was that the path to completing the original goal went further and further.
04 | So how did it actually get out?
This part has a lot of technical detail, but the main thread isn’t complicated.
The ExploitGym sandbox originally couldn’t access the internet directly.
An agent found and exploited a previously unknown zero-day vulnerability in OpenAI’s internal Artifactory, gaining internet access from the test environment.
Then it took control of a third-party public code sandbox as a springboard for further action.
Then it used a vulnerability in Hugging Face’s dataset processor to get into its infrastructure.
The whole path is roughly:
OpenAI evaluation sandbox → exploiting an internal infrastructure vulnerability → gaining internet access → third-party springboard → Hugging Face dataset processor → Hugging Face internal systems
Hugging Face eventually reconstructed about 17,600 attack actions. Along the way the agent carried out reconnaissance, privilege escalation, credential harvesting and lateral movement inside.
That’s also why I think “escaped the sandbox” is closer to the heart of this than “AI hacked Hugging Face.”
The first boundary that should never have been breached was at OpenAI itself.
05 | How much did Hugging Face actually lose?
Here it’s easy to be misled by the headline.
The depth of this intrusion was serious.
The agent at one point got into Hugging Face’s internal infrastructure, obtained fairly high privileges and credentials, and touched internal systems.
But the final customer impact publicly confirmed so far is relatively limited.
Hugging Face’s forensic reconstruction shows that the customer content accessed was only 5 datasets, whose names and contents all appear related to ExploitGym / CyberGym problems or answers.
No other customer-facing models, datasets, Spaces or packages were found to be affected, and no malicious changes to the public software supply chain were found.
So both judgments hold:
this was a serious security breach.
there’s currently no evidence it caused large-scale customer data leaks or damage to the software supply chain.
Its significance doesn’t mainly come from how big the final loss was.
But from:
an AI agent really crossing from a test environment into a real third party’s production systems.
06 | Whose problem was it more: OpenAI’s or Hugging Face’s?
Both sides exposed problems.
But if you ask:
why did this AI safety incident happen?
I’d put OpenAI’s side further forward.
Because this system was being run by OpenAI in the first place.
And it was never supposed to get out.
OpenAI itself later admitted that the models circumvented controls designed to isolate them from the internet.
What was exposed here:
- sandboxing / containment wasn’t enough;
- shared internal infrastructure formed an attack surface;
- agents that should have been isolated from each other found a way to communicate;
- abnormal communication and overstepping weren’t blocked early enough.
Hugging Face also had real security problems of its own.
That the agent could get so deep once inside had to do with its code execution vulnerability, credentials, scope of permissions, and isolation of internal systems.
I think it can be understood like this:
OpenAI’s problems decided why this car drove out of the test track.
Hugging Face’s problems decided why, once it reached the door, it could keep driving into the building.
Both sides need fixing.
But the starting points aren’t symmetrical.
07 | Was OpenAI penalized for this in the end?
As of September 19, 2026, I haven’t found any regulatory fines, court rulings or public compensation between the two sides that have actually materialized in public sources.
The follow-up visible publicly is mainly incident investigation and remediation.
OpenAI retired the main internal research model involved, changed its sandboxing, monitoring and security processes, and brought in outside teams like CrowdStrike, METR and Redwood to take part in the investigation.
Hugging Face fixed the vulnerabilities, rotated credentials, and adjusted infrastructure permissions and isolation.
The incident also left a question that’s becoming more and more real:
if a company never ordered AI to attack anyone, but the autonomous system it runs crossed authorization boundaries on its own, how should responsibility be assigned?
Traditional software usually runs along paths the developers wrote in advance.
Once agents start finding their own paths, this line of responsibility gets a lot more complicated.
08 | What direct reminders does this incident hold for agent products?
What I’m left with in the end are four very concrete things.
1. Design goals and boundaries separately
Telling an agent:
help me complete X.
doesn’t mean it naturally knows:
but methods A, B and C are absolutely off limits.
Important boundaries are best guaranteed by permissions and enforced by the system.
2. Specifically test when “the task can’t be done”
An agent being very obedient under normal conditions doesn’t say much.
What’s more worth testing is:
what does it do when permissions are insufficient?
what does it do when the task actually can’t be completed?
what does it do once all the normal paths are blocked?
Will it stop, or keep looking for new ways on its own?
3. Least privilege still matters a lot
- Read-only and writable aren’t the same thing.
- Temporary credentials and long-lived credentials aren’t the same thing.
- Being able to call one API and having permissions over the whole system aren’t the same thing either.
The stronger a model’s capabilities, the more least privilege matters.
4. Design stopping and recovery
Once something goes wrong:
- can permissions be revoked right away?
- will background tasks keep running?
- can completed operations be rolled back?
- are the logs enough for people to know what just happened?
These capabilities aren’t as eye-catching as “how many steps an agent can complete independently.”
But they decide whether, after an incident happens, the losses can be stopped.
The Hugging Face incident didn’t prove:
AI is already out of control.
What it proved is something more specific:
an agent with goals, tools and the ability to act, when the system’s boundaries aren’t firm enough, really can carry a task all the way to places people never authorized.
Only then comes the question for the third post.
If this ability keeps growing, can we extrapolate from here all the way to what Coxon worries about:
humans ultimately losing control?
Written in Chinese and translated into English with the help of AI. Read the original