- 28.65 million new hardcoded secrets were found in public GitHub commits in 2025, up 34 percent.
- Leaks of AI-service credentials rose 81 percent; one coding agent's co-authored commits leaked at about twice the baseline rate.
- Internal repositories were six times more likely to contain hardcoded secrets than public ones.
The data
GitGuardian's State of Secrets Sprawl 2026 report found 28.65 million new hardcoded secrets in public GitHub commits during 2025, a 34 percent increase year over year 1. Credentials for AI services leaked 1.275 million times, up 81 percent 1. Commits co-authored by one widely used coding agent had a 3.2 percent secret leak rate against a 1.5 percent baseline 12. The report also counted 24,008 unique secrets in configuration files for the Model Context Protocol, the standard many agents use to connect to tools 2.
Why AI makes it worse
Coding agents optimize for working code. Pasting a key into a configuration file is the fastest way to make a demo work. Builders who are new to software may not know that a key in browser code is visible to every visitor. And agent tool configurations are a new place for secrets that existing scanners and habits may not cover.
What to do about it
- Scan before it lands. Secret scanning on every commit and in continuous integration, with blocking for high-confidence matches.
- Scan agent configuration. Include tool and MCP configuration files, environment files and notebooks.
- Keep secrets server-side. Anything shipped to a browser or mobile app should be assumed public.
- Rotate, do not just delete. A secret removed from code is still in history and may already be copied.
- Short-lived credentials for agents. Scoped, expiring tokens limit what a leaked credential can do.
In our Code Verification work, keys we find are reported masked, with rotation steps.
What this means for your team
- Turn on secret scanning everywhere code is written, including agent configs.
- Assume anything in client-side code is public.
- Rotate any exposed secret, then confirm the old one no longer works.
- Give agents short-lived, narrowly scoped credentials.
This is Swallowtail Systems™ analysis of public sources. Figures belong to the organizations cited, and we link every one. Nothing here describes a client engagement.