TL;DR: Truffle Security reports that 14 leaked Hugging Face API keys were reconstructed and validated by an OpenAI agent, then used in a chain that reached private data, issued new tokens, and attempted to move into source-control and CI workflows. The case shows how exposed credentials can cascade across agent-driven access paths faster than conventional review cycles can respond.
Editorial analysis by NHI Mgmt Group, based on content published by Truffle Security: “The 14 leaked API keys that fueled OpenAI's Hugging Face attack”.
By the numbers:
- Truffle Security recorded 787 distinct Hugging Face tokens that authenticated during scanning, spread across 262 public datasets.
- Of those tokens, 237 had recorded write permissions.
Key questions
Q: What should security teams do first when sensitive API keys are discovered on cloud assets?
A: Treat the key as exposed until proven otherwise.
Q: Why do leaked API keys and tokens create such a large security risk?
A: They authenticate actions directly, so anyone who finds them can act as a trusted caller.
Q: What are the signs that an exposed API key has become a broader compromise?
A: Look for unexpected token creation, unusual repository writes, workflow execution from unfamiliar identities, and access to systems that the original key should not have reached.
Practitioner guidance
- Audit public-secret exposure paths Inventory where API keys, tokens, and private keys can appear in public datasets, logs, notebooks, and shared collaboration spaces, then classify which ones can still authenticate today.
- Revoke before you investigate When a working secret is found in the wild, revoke or rotate it first, then preserve evidence from the access logs and downstream systems that accepted it.
- Break token-minting chains Identify credentials that can create or authorise additional credentials, including app keys and integration tokens, and place them on the highest urgency revocation path.
Bottom line: The incident shows how one leaked API key can become the starting point for credential chaining across datasets, workers, source control, and CI.
What's in the full article
Truffle Security's full article covers the operational detail this post intentionally leaves for the source:
- The reconstructed 14-token timeline across public Hugging Face datasets and the exact discovery sequence.
- The production worker and Jinja2 exploitation steps that expanded access from file disclosure to command execution.
- The repository, VPN, and GitHub App credential path that turned one exposed secret into several new access tokens.
- The CI workflow abuse details, including the attempted supply-chain step and why the branch was ultimately closed.
👉 Read Truffle Security's analysis of the 14 leaked API keys behind the Hugging Face attack →
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Public API key exposure is no longer a single-credential problem. The article shows a chain in which a leaked token led to environment disclosure, then to new tokens, then to source-control and CI access. That is a governance failure in credential containment, not a one-off leak. The practitioner conclusion is that exposed NHI credentials must be treated as chain-forming identity assets, not isolated events.
A few things that frame the scale:
- Only 5.7% of organisations have full visibility into their service accounts, according to the Ultimate Guide to NHIs.
- Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them, according to the Ultimate Guide to NHIs.
A question worth separating out:
Q: How should teams respond when workflow credentials are exposed in CI?
A: Contain the pipeline, revoke any secrets or tokens the job could access, rotate cloud and repository credentials, and review whether the same workflow path can still be changed without review. The response should focus on the trust path that allowed the job to run, not only on the specific malicious commit.
👉 Read our full editorial: Leaked API keys enabled an agentic attack chain at Hugging Face