Part 4, Agents · Step 8: Detect
Keys in AI agents and AI training data
TruffleHog finds the copies. That afternoon, Nadia on the security team connects TruffleHog to the company’s GitHub and Slack. Its first scan flags the pushed .mcp.json and the channel post. She then scans the agent folders on Sam’s laptop and the new public repository on Sam’s GitHub account. The prompt in the web AI chat sits on another company’s service, outside the scan.
Why it matters. One finding ties every copy to the same key, so the team fixes the key once.
See it in the lesson Part 4 recap
What the research found: Hugging Face training data, 2026
TruffleHog scanned 7.6 petabytes of public AI training data on Hugging Face and found 221,303 keys and passwords that still worked, spread across 6,003 datasets.
What a scan can and can’t see
- It reads only places it’s connected to or pointed at.
- A copy in a web AI chat lives in someone else’s service. Only rotation reaches it.
Sources
Keep going
- Try TruffleHog open source Scan a repository or a folder on your laptop.
- See TruffleHog Enterprise Continuous scanning, routing to owners, and re-checks.
- Talk to the team Ask how this would work in your environment.
More topics
- A key kept in a vault still gets copied out
- Deleted from the code, and it still works
- Bundled scanners and the noisy queue
- What sits behind a key: owner, reach, permissions, activity
- The owner chase: whose key is this?
- Which key to fix first
- Replace a key without breaking anything
- Proof it’s dead, time to fix, and what auditors ask for
- Hosted or self-hosted: where the scanner runs
- Hooks, CI, history, chat, and builds: what each layer catches
- Keys outside the code: logs, vendors, and public files
- Live, dead, or unknown: triage the queue
- One key, three teams: rotate without an outage