All vulnerabilities
MEDIUMAI/LLM

AI-SECRETS-SPRAWL-2025

AI coding · AI coding assistants (Claude Code, MCP configs)

Summary

GitGuardian's State of Secrets Sprawl research found that AI coding assistants are driving a surge in leaked credentials on public GitHub. AI-assisted commits leaked secrets at roughly twice the baseline rate, with Claude Code-assisted commits showing a 3.2% leak rate versus 1.5% for human-only commits, contributing to 28.65 million new hardcoded secrets added to public GitHub in 2025 (a 34% year-over-year increase). The study also found 24,008 unique secrets in MCP configuration files, where setup guides often instruct developers to paste API keys directly into config.

How to avoid it in your code

  • Run pre-commit and CI secret scanning to block credentials before they reach GitHub.
  • Never paste API keys into MCP config files; reference a secrets manager or env vault instead.
  • Keep secrets out of the model context entirely; rotate any leaked credential immediately.
  • Mandate human review of AI-assisted commits for hardcoded secrets.
  • Enforce push protection and short-lived, least-privilege credentials.

References

Related vulnerabilities

All AI/LLM →