Hugging Face says an AI agent hacked its infrastructure, and it used AI to fight back
By Matthias Bastian

AI 摘要
Hugging Face reports an attack on parts of its production infrastructure that was allegedly carried out entirely by an autonomous AI agent system. The attack spanned thousands of actions controlled by an agent framework. During forensic analysis, commercial AI models actually got in the way of the d
原文正文
Hugging Face says an AI agent hacked its infrastructure, and it used AI to fight back
Key Points
- Hugging Face, the popular AI platform, was hit by a cyberattack that was reportedly carried out entirely by an autonomous AI agent system.
- The attackers used a malicious dataset as their entry point, which allowed them to compromise internal data and steal login credentials from the platform.
- To analyze the more than 17,000 recorded actions taken by the attacker, Hugging Face deployed its own AI tools, completing the full forensic analysis in just a few hours instead of days.
AI platform Hugging Face has disclosed a breach of parts of its production infrastructure that was allegedly carried out entirely by an autonomous AI agent system. The company says it detected and analyzed the attack largely with its own AI tools.
According to Hugging Face, the attackers gained unauthorized access to a limited set of internal datasets and several credentials used by Hugging Face services. The company says public models, datasets, and Spaces were not tampered with, and the software supply chain was not affected. Whether partner or customer data was compromised is still under investigation.
A malicious dataset opened the door
According to Hugging Face, the attack started at one of the weakest spots on any AI platform: the data processing pipeline. A malicious dataset exploited two code execution paths in dataset processing, specifically a remote code dataset loader and a template injection in a dataset configuration.
From there, the attacker escalated to node level, harvested cloud and cluster credentials, and moved laterally across multiple internal clusters over a weekend. An autonomous agent framework built on an agentic security research harness orchestrated the entire campaign, the company says.
Hugging Face says it doesn't know which language model powered the attack. The system executed many thousands of individual actions through a swarm of short-lived sandboxes and used self-migrating command-and-control infrastructure running on public services. The company classifies the incident as the "agentic attacker" scenario the industry has been predicting for some time.
AI-powered analysis cut investigation time from days to hours
Hugging Face says it spotted the attack through an AI-powered anomaly detection pipeline that runs LLM-based triage on security telemetry. To make sense of the more than 17,000 recorded attacker actions, the company deployed LLM-driven analysis agents.
Those agents reconstructed the timeline, extracted indicators of compromise, mapped affected credentials, and separated real damage from deception activity. Work that would normally have taken days was done in hours, the company says.
Commercial AI safety filters blocked the company's own defense
According to Hugging Face, when the security team first tried to analyze the attack logs using frontier models behind commercial APIs, it hit a wall. The providers' safety guardrails blocked the requests because they couldn't tell an incident responder from an attacker. The analysis required submitting large volumes of real attack commands, exploit payloads, and C2 artifacts, all of which tripped the filters.
The company turned to the open-weight model GLM 5.2, running on its own infrastructure. According to the company, that had two advantages: no attacker data, and none of the referenced credentials ever left its own environment.
"We do not know which model powered the attacker's agents, whether a jailbroken hosted model or an unrestricted open-weight one; either way, the attacker was bound by no usage policy, while our own forensic work was blocked by the guardrails of the hosted models we first tried," Hugging Face wrote.
The practical lesson for defenders, the company says, is to have a capable model running on your own infrastructure before an incident happens. Hugging Face adds that this isn't an argument against safety measures on hosted models.
Hugging Face's response and open questions
Hugging Face says it shut down the exploited code execution paths, revoked the attacker's access, rebuilt compromised nodes, and rotated affected credentials. The company also tightened access controls and improved its detection systems, according to the blog post. Hugging Face is working with external cybersecurity forensics experts and has reported the incident to law enforcement. As a precaution, the company recommends that all users rotate their access tokens and review recent account activity.
The incident confirms that autonomous, AI-driven attack tools are no longer theoretical. According to Hugging Face, they lower the cost of broad, multi-stage campaigns and operate at machine speed. The company argues that data and model surfaces need to be treated as first-class attack surfaces and that defenders need AI of their own to keep pace.
Hugging Face calls the fact that commercial safety filters blocked its own forensic work a gap the industry should prepare for. But the company is also one of the largest platforms for open-source AI models and has a clear business interest in framing open models as indispensable for security work, so its conclusion that defenders absolutely need their own open-weight models on hand isn't entirely selfless.
AI News Without the Hype – Curated by Humans
Subscribe to THE DECODER for ad-free reading, a weekly AI newsletter, our exclusive "AI Radar" frontier report six times a year, full archive access, and access to our comment section.
Subscribe now