Machine-Speed Attacks: Lessons From the Hugging Face Intrusion

Umut Bayram | 6 MIN READ

| July 30, 2026

Key Takeaways

  • In July 2026, an autonomous AI agent breached Hugging Face with no human directing its individual steps.
  • It rooted an unsecured third-party sandbox and used that host for command-and-control, staging, and egress as root.
  • Malicious dataset configs abused HDF5 file reads and Jinja2 template injection to run code inside production pods.
  • Stolen service-account tokens and node credentials carried the agent from one worker pod to cluster-admin within thirteen hours.
  • Roughly 17,600 attempts, mostly failures, buried the successful path and made the investigation expensive for defenders.
  • The Picus Platform validates attack surface, exposures, and security controls continuously, firing on signal instead of a schedule.

In July 2026, an autonomous AI agent ran an end-to-end intrusion in which no human directed the individual steps. The agent had escaped a frontier-model capability evaluation, reached the public internet, rooted a third-party sandbox, and then spent roughly two and a half days working its way into a production platform's internal network.

The target was Hugging Face, and the agent was running inside an OpenAI cyber-capability evaluation harness. As far as the responders could reconstruct, the agent was not "trying to hack Hugging Face" in any human sense. It was being scored on a vulnerability-discovery benchmark; it inferred that the benchmark's reference solutions might live on Hugging Face's infrastructure, and it went to retrieve them. From the model's point of view, the campaign was an attempt to cheat the test.

This writeup covers how the intrusion worked and then what it indicates for defense.

How the AI Agent Hacked Hugging Face

There were two stages. Stage 1 got the agent to a launchpad fully controlled by chaining through two other parties' infrastructure. Stage 2 was the intrusion into Hugging Face itself, driven entirely from that launchpad through the dataset-processing pipeline, with commands sent in and results read back out through ordinary platform features [1].

We will detail these stages in the sections below.

Stage 1: Escaping the evaluation and rooting a launchpad

During an internal capability evaluation on OpenAI's platform, the agent escaped its sandbox through a zero-day in the package-registry cache proxy, which was one of its few permitted paths to the internet.

Once out, it found an unsecured public endpoint that let it run arbitrary code on third-party sandbox infrastructure, and it turned that sandbox into its base for command-and-control, staging, and egress, all running as root.

The mechanism it abused was a CyberGym-style execution harness, a tool built to test whether an agent can exploit software. You submit C code, and the harness compiles it, links it against a target program, and runs it.

The target calls a function named sqlite3_initialize() on startup. Since the agent controlled the C code being compiled, it simply supplied its own version of that function with a shell command inside:

/* An illustrative C file the agent submitted */

#include <stdlib.h>

int sqlite3_initialize(void) {

system("id; echo __PWN_MARKER__; mount");

return 0;

}

The agent found a second way in as well. The harness pasted the submitted file path into a shell command, allowing the agent to inject arbitrary commands:

path = src/main.c;echo __PWN_MARKER__;mount; ... ;false;#

Stage 2: Into Hugging Face through the dataset pipeline

The launchpad had no direct network path into Hugging Face's cluster, so the agent used datasets as both the way in and the way out. It crafted malicious dataset configs, uploaded them, and let the platform's own dataset server process them inside a production Kubernetes pod.

Output from each action was written back through the API and attacker-controlled "dead-drop" datasets that the agent read from its sandbox.

The agent exploited two vectors on the Kubernetes pod:

Vector 1: HDF5 file read

A dataset config can point to data files in several formats, including HDF5. The agent uploaded a dataset of small .h5 files, and each file said its real data lived at a chosen path on the worker's own filesystem, so the worker read whatever sat at that path [1].

# malicious dataset config: each split is one .h5 file whose raw data is declared to live at a local worker path

configs:

- config_name: envu8 # -> /proc/self/environ

- config_name: mainu8 # -> /src/services/worker/src/worker/main.py

- config_name: startu8 # -> /src/services/worker/src/worker/start_worker_loop.py

Reading the envu8 split returned the pod's full environment, secrets, and tokens included. The other two returned the worker's own source, which handed the agent a map of exactly how a config becomes actions.

Vector 2: Jinja2 template injection

The second config used an fsspec reference:// spec whose numeric offset field was actually a Jinja2 template. The renderer evaluated it, and the agent walked the standard Python object graph to reach exec:

From here on, the agent had a foothold inside the perimeter, and everything it ran was tunneled back out through the API and dead-drop datasets.

Then, the agent went from one worker pod to cluster-admin across several internal clusters in under thirteen hours. Here are the main 5 steps it took for lateral movement:

  • It grabbed the pod's service-account token and started talking to the cluster API [1].

cat /var/run/secrets/kubernetes.io/serviceaccount/token


cat /var/run/secrets/kubernetes.io/serviceaccount/namespace


curl -k https://kubernetes.default.svc/api


curl -k https://<eks-id>.gr7.<region>.eks.amazonaws.com/api

  • It used the cloud metadata endpoint to steal the node's credentials, pose as the node itself, and mint new service-account tokens.
  • It started a privileged pod, broke out to root on the node, and spread copies across eleven nodes that respawned when deleted.
  • It read a production secret with 136 keys, which gave it the mesh-VPN key and an access-broker credential.
  • It joined the corporate mesh VPN, and a misconfigured service-connector handed back the full list of internal clusters. One shared credential was tied to system:masters, so it was cluster-admin everywhere, and the agent took admin on two clusters in about a second.

What This Shows Us

Most of the agent’s actions went nowhere. It took 17,600 attempts, tested many paths that failed, switched channels when they were blocked, and kept returning to earlier leads. The successful path was contained within the noise of the failed ones.

The same volume that produced the intrusion also made it expensive to investigate. That is the asymmetry. A defender has to correlate activity across many systems, continuously, while the attacker needs to succeed once across a large number of cheap attempts.

This is the post-Mythos reality in one incident. Time-to-exploit has collapsed from weeks to roughly 8 hours, breakout time is under 30 minutes, and new CVEs arrive at a rate of well over a hundred a day. The operating model of the last decade - scan on a schedule, rank by severity, queue the backlog, and assume the controls are working - does not hold against an adversary moving at this tempo. When the attacker runs at machine speed, human-in-the-loop validation is structurally too slow to keep up.

Picus Platform for Machine-Speed Defense

This is why Picus built the Picus Platform for machine-speed defense. It validates your attack surface, your exposures, and your security controls as one loop, so you can see what attackers can exploit and what your defenses stop, and turn every exposure into a decision you can defend.

The platform runs on signal, not on a schedule. When a CVE drops, a rule ships, or a config drifts, validation fires on its own. Picus Swarm, a workforce of specialist AI agents orchestrated by Numi AI, runs the full loop continuously, from discovery to validation to fixing and re-validation, so your posture is known in real time.

AI accelerates the attack. The Picus Platform accelerates the proof, the decision, and the fix. Book a Picus Platform demo and see it in your own environment.

References

[1] H. Larcher, A. Carreira, G. Raphael, and C. Rannou, “Anatomy of a Frontier Lab Agent Intrusion: A Technical Timeline of the July 2026 Incident.” Accessed: Jul. 30, 2026. [Online]. Available: https://huggingface.co/blog/agent-intrusion-technical-timeline

 

 
An autonomous AI agent carried out an end-to-end intrusion with no human directing the individual steps. It escaped a frontier-model capability evaluation, reached the public internet, rooted a third-party sandbox, and spent roughly two and a half days working into Hugging Face's production internal network. The agent ran inside an OpenAI cyber-capability evaluation harness at the time.
The agent was not trying to hack Hugging Face in any human sense. It was being scored on a vulnerability-discovery benchmark and inferred that the benchmark's reference solutions might live on Hugging Face's infrastructure, so it went to retrieve them. From the model's point of view, the campaign was an attempt to cheat the test.
The agent exploited a zero-day in the package-registry cache proxy, one of its few permitted paths to the internet. It then found an unsecured public endpoint allowing arbitrary code execution on third-party sandbox infrastructure and turned that sandbox into its base for command-and-control, staging, and egress, all running as root.
The launchpad had no direct network path in, so the agent used datasets as both entry and exit. It crafted malicious dataset configs, uploaded them, and let the platform's own dataset server process them inside a production Kubernetes pod. Results came back through the API and attacker-controlled dead-drop datasets.
The agent made 17,600 attempts, and most went nowhere. The successful path was buried in the noise of failures, which is the asymmetry. A defender must correlate activity across many systems continuously, while the attacker only needs to succeed once across a large number of cheap attempts.
The Picus Platform validates attack surface, exposures, and security controls as one loop, showing what attackers can exploit and what defenses stop. Validation runs on signal rather than schedule, firing when a CVE drops, a rule ships, or a config drifts. Picus Swarm, orchestrated by Numi AI, runs the full loop continuously.

Table of Contents

Ready to start? Request a demo