FeaturesPricingFAQMCPSecurityAffiliatesContact

Research

AI API Key Leaks in 2026: The Numbers

API key leaks are no longer a rare edge case — they are the default. This is a short digest of the 2026 data, drawn from our full report, and what the numbers mean if you build with AI tools.

28.6M+new secrets leaked on public GitHub in 2025 (+34% YoY)
81%year-over-year rise in AI-service key leaks
24,008unique secrets found in MCP config files
64%of valid 2022 secrets still unrevoked in 2026

The headline numbers

In 2025, GitGuardian detected 28.6M+ new secrets in public GitHub commits — a 34% jump over 2024, and the fastest growth on record. The fastest-growing category was AI-service credentials, up 81% to over 1.27 million. This is not a niche problem; it is the cost of everyone shipping AI features at once.

Method: these figures come from published third-party research (GitGuardian State of Secrets Sprawl 2025/2026). ProphetKey reproduces them with sources linked in the full report — we do not collect user key data.

Why AI workflows leak more

  • Speed. Claude Code-assisted commits leaked secrets at ~3.2% — roughly double the ~1.5% GitHub-wide baseline.
  • No standard prefixes. Many AI service keys lack recognizable formats, so older scanners miss them.
  • New config surfaces. MCP and agent config files became a fresh place to paste plaintext keys.
  • Keys don't get rotated. 64% of valid secrets leaked in 2022 were still not revoked by 2026.

What to do about it

  1. Get keys out of files. Move them into an encrypted vault that injects them at call time.
  2. Use per-tool virtual keys. One leak then costs you a virtual key, not your real credential.
  3. Watch for leaks. Monitor public repos and paste sites for your own keys so you can rotate within minutes.
  4. Assume breach, rotate fast. If a key touched a public place, replace it today.
ProphetKey encrypts keys locally, injects them through a local proxy and MCP bridge, and includes leak monitoring. → Download for Windows

FAQ

How many API keys were leaked in 2025?

GitGuardian's State of Secrets Sprawl 2026 reported 28.6M+ new secrets detected in public GitHub commits during 2025, a 34% increase over 2024.

Are AI-related API keys leaking more than others?

Yes. Leaks tied to AI services rose 81% year-over-year to 1,275,105 secrets. AI-service credentials often lack standardized prefix patterns, which makes them slip past older detection rules.

Do MCP and agent config files create a new leak risk?

They do. MCP configuration files exposed 24,008 unique secrets in 2025, including Google API keys (19.2%), PostgreSQL connection strings (14%), and Perplexity.ai keys (11.2%).

How do I protect my API keys in 2026?

Keep keys encrypted on-device instead of in plaintext config files, give each tool its own scoped virtual key so one leak is replaceable, and monitor public code for your own keys so you can rotate fast.

Read the full data

The complete, sourced breakdown lives in our report: API Key Exposure Report 2026 →

Sources