Leaked API Keys Are Going to Become a Major Headache for Every Company

In August, more than 50,000 Stripe API keys were exposed across public code repositories, GitHub Actions logs, and misconfigured web servers. Researchers used a sample of the active ones to pull merchant customer lists, create fraudulent payment links, and initiate test charges. All within 17 hours of the keys going public.
Two months before that, a threat group calling itself “Icarus” got into one of Klue’s dormant integration credentials and pushed a malicious update into its systems. Almost 200 of Klue’s customers were affected, including Postman and several cybersecurity vendors. So suffice to say, we’ve been reflecting deeply on this problem.
Both incidents highlighted that one leaked credential can get exploited thousands of times before anyone notices.
The Problem With API Keys (And Why AI Makes It Worse)
API keys are possession-based. Users don’t treat them as carefully as they should and they end up on laptops, in config files, and pasted into repos. Once a secret exists in more places than you can track, you’ve lost visibility into where access can even come from.
The lifecycle is the other half of the problem. Hygiene best practices like rotation, revocation, and expiry are often treated as an afterthought. The administrative headache of rotating a key means updating every application that depends on it before you revoke the old one, or you break something in production.
GitGuardian’s State of Secrets Sprawl 2026 report counted 28.65 million new secrets in public GitHub commits in 2025 alone, and found that 64% of secrets confirmed valid in 2022 were still active four years later. It’s usually faster to spin up a new endpoint than to audit what already exists, so inventory just keeps growing.
That blind spot was bad enough on its own. Now AI agents are calling APIs on our behalf at an exorbitant pace. The blast radius of a leaked key used to be human-sized; now they can be exploited at machine speed.
How to Avoid Becoming the Next Headline
I’ve said this before and I’ll say it again: accurate inventory enables effective policy, which drives automated enforcement and continuous detection. That loop is what keeps a leaked credential from spiraling into a massive incident like those we’ve seen in recent headlines.
Here are four recommendations from my experience after decades in the field:
- Build an inventory: Most security problems are inventory problems in disguise. List every credential, everywhere it’s issued, stored, and copied, and map each one back to the APIs it can touch.
- Apply least privilege to humans and agents alike: Scope credentials to the task, not the person. A workflow that only needs to read data gets an API that can only read, not one that can also delete or expose records.
- Automate expiry, rotation, and revocation: Automate rotation wherever you can, and make emergency revocation as easy as one click. Breaking a key almost always costs less than the potential damage it prevents.
- Govern your agents: Give agents their own identities, with per-call attribution to a distinct machine identity, not a shared one. This is the heart of least privilege: an agent should get only the access that the task actually requires. And detection needs to feed back into policy so security teams can restrict behavior the moment it strays, not just sound an alarm after the fact.
Leaked credentials have always been a problem. AI increased the speed with which these incidents can proliferate: more keys, more machine callers, more activity than any manual process can account for. Inventory, least privilege, automated rotation, and agent governance won’t make headlines on their own, but getting them right, right now, is what keeps you from making headlines for the wrong reason.
