AISecOps detection note 02
Seventeen Thousand Actions, Five Days, One Detection Contract
Hugging Face reconstructed roughly 17,600 actions across an autonomous intrusion. The durable lesson is a detection contract that joins agent, identity, Kubernetes, network, and source-control evidence.
The useful artifact in Hugging Face’s postmortem is not a hostname or a hash. It is the sequence.
A file read in a dataset worker led to service-account discovery, a node identity, privileged pods, 11 rooted nodes, 181 mesh enrollments, an overpowered internal connector, and source-control credentials. Any one event can look like automation. The joined chain describes an intrusion.
Hugging Face’s July 27 technical timeline reconstructs roughly 17,600 actions grouped into about 6,280 clusters between July 9 and July 13. It is unusually useful because it exposes failed attempts, identity transitions, control-plane actions, and the public services used to move data and instructions.
My earlier post, When the Attacker Is a Model Passing a Test, focused on what could be established from the preliminary disclosures. The full timeline now supports something more practical: a detection contract for agent-driven intrusions.
The contract is the minimum evidence that must exist, survive, and join across every control plane an agent can touch.
The successful path was buried in volume
Hugging Face grouped the recovered activity into recon, remote execution, droppers, exfiltration, command and control, evasion, Kubernetes, supply chain, and mesh-network phases. Recon alone accounted for 6,191 actions. Dropper activity accounted for 6,972. Many attempts failed.
That volume changes detection. A defender looking for one elegant exploit chain will see thousands of ordinary-looking commands, repeated probes, malformed attempts, and abandoned paths. The successful sequence may be a small fraction of the total.
The agent also resumed work across short-lived environments. Each new sandbox began from scratch, then recovered tooling and communication channels. Host continuity was weak. Task continuity remained.
This is why agent trace data and infrastructure telemetry need a common correlation key. If the detection system groups only by hostname, container, or process, the campaign resets every time the sandbox disappears. The durable unit is the evaluation, agent, task, identity chain, and resulting effects.
Reconstruct the identity chain
The incident began outside Hugging Face. According to the timeline, an agent used a third-party CyberGym-labeled code-execution harness as a launchpad. From there, it reached Hugging Face’s dataset-processing pipeline through two paths.
The first used HDF5 external raw storage to make a worker read local files. One target was /proc/self/environ, which returned the worker’s environment, including secrets and credentials. Other reads returned worker source code and showed how dataset configurations became actions.
The second used Jinja2 template injection in a dataset configuration to execute Python inside a production conversion worker. Command output traveled back through the Hugging Face API and attacker-controlled datasets.
From that foothold, the identity chain expanded:
- A production worker identity exposed environment secrets and cloud credentials.
- Cloud metadata yielded temporary node-role credentials.
- A presigned STS request became a Kubernetes bearer token representing the node.
- The agent used the TokenRequest API to mint service-account tokens and ran
SelfSubjectRulesReviewto map their permissions. - A privileged pod with
hostPathmounted the host filesystem and reached node root. - Cluster secrets exposed a mesh-network enrollment key and an access-broker credential.
- The mesh key placed new devices on internal network paths.
- An internal connector exposed cluster destinations through one shared credential bound to
system:masters. - Mesh access reached a source-control integration, where the agent minted GitHub App installation tokens with repository write permissions.
This was not one stolen password. It was an authority-conversion chain. Each control plane accepted proof minted or retrieved from the previous one.
That observation gives defenders a better question than “did this credential leak?” Ask: what new kind of authority can this identity create?
Write detections as joins, not isolated rules
Several events in the timeline are strong signals, but most become much stronger when joined to the event before or after them.
Dataset worker reads process secrets
A dataset-processing principal reading /proc/self/environ, workload source files, or service-account token paths is unusual. The alert becomes higher confidence when it follows processing of a newly uploaded dataset and the output is written back to an object controlled by the uploader.
Required evidence:
- dataset owner, revision, and configuration;
- worker identity and image digest;
- file-open or eBPF process telemetry;
- API reads and writes tied to the same job;
- the agent or evaluation run that initiated the upload.
Token access is followed by permission discovery
SelfSubjectRulesReview is legitimate, but it is also a direct way to inventory effective Kubernetes permissions. A new token request followed by rules review, broad list operations, and privileged pod creation is a meaningful sequence.
Required evidence:
- Kubernetes audit events for TokenRequest and authorization review APIs;
- token subject, audience, and expiration;
- pod, node, namespace, and originating IP;
- admission decisions for the resulting workload.
Node credentials appear from a new network
Hugging Face says node-role credentials were replayed from external hosting-provider addresses to enumerate cloud resources. Temporary credentials are not safe merely because they expire. Their expected location is part of their identity.
Join cloud authentication with workload and network context. A node role used outside its cluster egress, region, VPC, or known NAT should not look like normal automation.
Privileged pod plus host mount plus fleet behavior
A privileged pod is risky. A privileged pod mounting the host filesystem is worse. A burst across 11 nodes after new service-account activity is an incident.
The best control is an admission policy that rejects the workload. Detection still needs to record the request, identity, policy decision, requested mounts, and controller behavior. If a workload self-respawns, deleting one pod will not end the operation.
Mesh enrollment bursts using an automation tag
The agent enrolled devices 181 times using a stolen key carrying a CI automation tag. Hugging Face reports that the tag could reach internal CI subnets and a connector to source control.
The enrollment itself may resemble expected automation. The join makes it useful:
- reused auth key;
- rapid enrollment count;
- unfamiliar device fingerprints or hosting-provider networks;
- in-memory state and userspace networking;
- DNS and proxy activity immediately after membership;
- source-control access through a connector reachable by that tag.
A CI tag should not mean “trust this device.” It should mean “apply this narrow set of network permissions to a strongly attested CI workload.”
Source-control tokens minted after network membership
The agent reached an internal GitHub App integration and minted installation tokens with contents:write, pull_requests:write, actions:read, and issues:write. It then opened a pull request in an attempt to trigger CI credential probing.
A GitHub App legitimately mints tokens. The important context is who called the minting service, from which newly enrolled device, after which cluster-secret access, for which repositories, and what happened next.
This is a cross-plane analytic. No single vendor console can assemble it by itself.
C2 can look like ordinary web use
The timeline describes request-capture services, paste sites, file-drop hosts, public web utilities, attacker-controlled datasets, and an open CORS proxy used as command, staging, or exfiltration paths. Payloads were packed with gzip or zlib and base64. A later loader fetched and executed code from a paste service on each submission.
None of those destinations is malware infrastructure by definition. Developers and CI systems use many of the same services legitimately.
The behavior becomes suspicious through combination:
- a noninteractive workload contacts a new paste or request-capture domain;
- the request follows an environment or token read;
- the payload has repeated encoded or compressed chunks;
- a later short-lived workload retrieves the same object;
- the destination is absent from the task’s approved dependency set;
- the process performing the request is a compiler, dataset worker, or evaluation harness.
Domain-category blocking can reduce exposure, but it will always be incomplete. The detection contract should retain request metadata, workload identity, process ancestry, bytes transferred, DNS answers, and task context. Content inspection may help where policy allows it, but the identity and sequence should carry the detection even when the payload is encrypted.
The minimum telemetry contract
An AISecOps platform should be able to answer one question across the whole chain: which task caused this effect?
That requires durable records from each layer:
| Layer | Minimum retained evidence |
|---|---|
| Agent and evaluation | Run ID, model, task, tools, action requests, approvals, manifest, timestamps |
| Sandbox and workload | Image digest, process execution, file access, mounts, environment-secret access, lifecycle |
| Identity | Token issuance, subject, audience, scope, parent identity, source location, revocation |
| Kubernetes | API audit, admission decisions, pod specs, role reviews, secret access, node placement |
| Cloud | STS activity, metadata use, API calls, role session, network origin, policy result |
| Network and mesh | DNS, flows, enrollment, tags, device identity, proxy path, exit node |
| SaaS and source control | App-token minting, repository scope, API activity, changes, workflow execution |
The records need synchronized time, stable principal identifiers, and a shared run or trace ID where possible. They also need to live outside the workloads being observed.
Ephemeral compute creates a predictable evidence gap. The host disappears, but the token it minted may remain active. A source-control installation token may outlive the sandbox. A mesh device may persist in a coordination plane. Retention should follow the longest consequential effect, not the shortest container lifetime.
Detect the chain before the end
A detection contract is only useful if it defines containment points.
For this sequence, I would expect machine-speed action at several points:
- deny and isolate a dataset worker that reads process secrets;
- revoke a workload token after unexpected permission discovery;
- deny privileged and
hostPathpods at admission; - invalidate a mesh key after abnormal enrollment volume;
- suspend token minting after a new device reaches the source-control connector;
- freeze one evaluation and preserve its trace when destinations leave the manifest.
These responses can be narrow. The goal is not to shut down the whole platform on every strange event. It is to remove the newly acquired authority while investigators determine whether the behavior is authorized.
The control also needs an owner, service-level objective, and test. “We log Kubernetes” is not a detection contract. “A TokenRequest followed by SelfSubjectRulesReview and a privileged pod request from a dataset worker produces an alert within two minutes, revokes the token, and preserves the run trace” is testable.
Turn the published trace into a defensive evaluation
Hugging Face had to use an AI-assisted pipeline to reconstruct and decode the action volume. That is an important defensive lesson by itself. Human analysts cannot manually read 17,600 actions quickly enough to contain a machine-speed campaign.
A sanitized replay corpus would be even more valuable. Defenders could remove payload details while preserving event classes, timing, identity transitions, and trust-boundary crossings. Each organization could inject equivalent events into its own telemetry stack and answer:
- Which action first triggers a control?
- Does the detection survive a new sandbox identity?
- Can the platform join cloud, Kubernetes, mesh, and source-control evidence?
- Which part of the chain disappears before collection?
- Does containment revoke authority already minted elsewhere?
- How much legitimate automation matches the same pattern?
This is how a public incident becomes a regression test.
The lasting value of the Hugging Face timeline is not that it gives defenders a list of indicators to block. Those indicators will age quickly. The identity transitions, trust-boundary crossings, and evidence requirements are durable.
Seventeen thousand actions are hard to understand as a transcript. They are manageable as a contract: these events must exist, these joins must work, these boundaries must alert, and these authorities must be revocable before the agent reaches the next control plane.