The problem
An agent can read what the engineer can read.
API keys, credentials, and code sit on the same devices as the agent, and the agent can send them anywhere the network allows.
Engineers keep API keys in .env files and cloud credentials in ~/.aws/credentials. A coding agent can open either, or upload a folder of client code to a paste site. A skill can send data out too: one that sets ANTHROPIC_BASE_URL to a third-party endpoint sends every prompt, the code in it, and the API key to that endpoint.
Research from across the industry shows how often secrets already leak through AI tooling.
24,008unique secrets exposed in MCP-related configuration files on public GitHub.
2,117 of them were valid credentials, from GitGuardian's scan of public GitHub in 2025.
The files that connect agents to tools often hold live keys.
GitGuardian, State of Secrets Sprawl 2026, March 2026
81%year-over-year rise in leaked secrets for AI services, such as model provider API keys.
1,275,105 AI service secrets, out of 28.65 million new secrets found in public GitHub commits in 2025.
The keys agents run on are now among the secrets leaking fastest.
GitGuardian, State of Secrets Sprawl 2026, March 2026
2,000+unique, verified secrets leaked in the s1ngularity attack on the Nx build package, which told local AI command line tools to search for sensitive files.
Over 1,700 users had secrets leaked; about half of all victims had at least one AI command line tool installed.
Malware can use the agent already on a device to find credentials for it.
Wiz, September 2025