39 Million Credentials Leaked in One Year
GitHub's Octoverse 2024 report found 39 million secrets leaked on GitHub in 2024. That is a 25% year-over-year increase from 2023. The secrets include API keys, database strings, auth tokens, and cloud credentials.
The cause is known. Developers commit code with secrets inside. The secrets come from debug sessions. Or they are hardcoded instead of stored in environment variables. At 39 million leaks, this is not rare. It is routine.
AI Tools Add a Second Leak Channel
GitGuardian's 2025 research found that 67% of developers have accidentally exposed secrets in code. The same habits that create GitHub leaks also create AI tool leaks.
A developer pastes code into Claude, ChatGPT, or another AI assistant for help. That code often has live credentials in it. The AI model receives the secret. It may store it in conversation history. It sends it to the provider's servers. The developer loses control — with no warning.
Three examples:
Database debugging. A developer pastes a stack trace. The trace includes the connection string. The AI reads the password too.
Pipeline review. A developer shares a data pipeline script. The script has an AWS access key and secret key. The AI receives both.
API integration review. A developer asks for feedback on an integration. The code includes a live partner API key. The key leaves the developer's network.
In each case, the goal is legitimate help. The credential leak is a side effect of giving the AI enough context. This is the same pattern as GitHub leaks — not malicious, just routine.
CI/CD Pipelines Face the Same Risk
CI/CD pipeline secret leaks increased 34% in 2024. Build scripts, deployment configs, and infrastructure-as-code files all go through AI review now. These files often hold cloud credentials and service account tokens.
As AI tools cover more of the dev cycle — review, docs, debugging, optimization — the exposure surface grows with them.
How MCP Architecture Blocks Leaks
For teams using Claude Desktop or Cursor IDE, Model Context Protocol (MCP) server architecture puts a credential filter in the path between developer and AI model.
The MCP server handles every text that moves through the session. Pasted code, stack traces, config files, debug context — all of it passes through an anonymization step before the model sees it.
The engine finds credential patterns: API key formats, database strings, OAuth tokens, private key headers, and custom formats your security team defines. Each match gets replaced with a token before transmission.
What this looks like in practice:
A developer pastes a stack trace with a database connection string. The MCP server replaces the string with [DB_CONNECTION_1]. The AI sees the trace with the token in place. It gives debugging help based on the anonymized version. The actual credential never left the internal network.
This stops the same leak vector that fills GitHub with secrets. The channel is different — AI tools, not git commits — but the fix works the same way: block it before it transmits.
See our security overview for how anonym.legal handles this across AI tools and document workflows, and the compliance center for audit controls.
Detection After the Fact Is Too Late
Some teams use post-commit scanning to catch leaked secrets. GitGuardian and truffleHog work well for the GitHub channel. They do not cover AI tool sessions.
When a secret reaches an AI provider's servers, the exposure is done. Scanning finds it after. MCP-layer anonymization stops it from reaching the model at all.
The 39 million GitHub leaks document one channel. AI tool exposure is the same problem in a channel with less monitoring and no audit trail. Prevention before transmission covers both.