Forge University
Industry News

Your AI Coding Assistant Is Leaking Credentials Faster Than Your Developers Ever Did

November 5, 2026

Rodney Hall, COO— AI-assisted and reviewed prior to publication.

Abstract illustration of digital keys streaming out of code pipelines past an open vault into darkness

AI coding assistants are not just writing more code. They are hardcoding more credentials into it, and the 2026 data shows commits produced with tools like Claude Code leak secrets at roughly double the normal rate. If you run security operations for any organization writing software, this is now a measurable, growing attack surface, not a theoretical one.

Why Are AI Coding Assistants Leaking So Many Credentials?

The short answer is speed without review discipline. According to GitGuardian's State of Secrets Sprawl 2026 report, 28.65 million new hardcoded secrets landed in public GitHub commits in 2025 alone, a 34 percent jump over the prior year and the largest single-year increase the firm has recorded.

The AI-specific slice of that number is what should worry security leaders most. Reporting on the same dataset found that developers using Claude Code to author or co-author commits leaked secrets at a rate roughly double the human baseline, and that eight of the ten fastest-growing leak categories were tied directly to AI services, with secrets tied to AI services up 81 percent year over year. Model Context Protocol adoption made this worse before anyone built guardrails around it. GitGuardian found that official MCP setup guides routinely recommend putting API keys directly into configuration files and command-line arguments, which normalized hardcoding before security teams had a chance to intervene.

None of this is contained to public repositories either. Internal repos are roughly six times more likely than public ones to contain a hardcoded secret, and leaks that surface outside of code entirely, in chat tools and ticketing systems, run 13 percent more likely to be rated critical than the ones found in source. Perhaps the most damning number in the whole dataset is persistence: 64 percent of secrets confirmed valid back in 2022 are still exploitable today, which means detection without a forced rotation policy accomplishes almost nothing.

How Does This Connect to Machine Identity Governance?

Every leaked API key or service token is a non-human identity, and non-human identities have already overrun every enterprise identity program built around people. CyberArk's 2025 State of Machine Identity Security Report found that machine identities now outnumber human identities by an overwhelming margin inside the organizations it surveyed, and that gap keeps widening as microservices, CI/CD automation, and now AI agents each spin up their own credentials.

Cloud-native environments make the imbalance worse. The Cloud Security Alliance's Non-Human Identity Governance Vacuum whitepaper cites research putting the non-human-to-human identity ratio at an average of 45 to 1 across enterprises, climbing as high as 144 to 1 in cloud-native stacks, up from 92 to 1 just a year earlier. Each one of those machine identities is a credential somewhere, often embedded in a pipeline, a container image, or now an AI agent's configuration file, and most of them were never assigned a human owner who could account for their permissions.

This is exactly the gap that the industry's first standardized taxonomy was built to close. The OWASP Non-Human Identities Top 10 ranks the most critical risks in integrating machine identities into the development lifecycle, and three of its ten categories map directly onto what the secrets sprawl data is showing right now.

OWASP NHI RiskWhat It Looks Like in Practice
NHI2: Secret LeakageAPI keys and tokens hardcoded into commits, MCP configs, or chat tools instead of a managed vault
NHI7: Long-Lived SecretsCredentials with no expiration, which is why 64 percent of 2022 leaks are still valid
NHI1: Improper OffboardingService accounts and keys left active after the project or integration they supported is retired

What Do NIST and OWASP Actually Recommend?

Both bodies converge on the same core fix: stop issuing credentials that outlive their usefulness. NIST's guidance for securing microservice workload identity recommends that the lifetime of a workload's identity certificate be kept as short as the infrastructure can manage, with rotation measured in hours rather than months, precisely so a stolen credential has a narrow window before it expires on its own.

That recommendation only works if someone is actually watching for abuse in the meantime. NIST's zero trust architecture guidance calls for continuous monitoring of non-human identity activity, meaning logs and analysis around API calls, service account usage, and token operations rather than a one-time access review. Pair that with OWASP's ranking criteria, which weighs each NHI risk by exploitability, impact, and prevalence rather than theoretical severity, and you get a shared playbook: discover every machine identity, assign it an owner, shorten its lifespan, and rotate on a schedule instead of waiting for an audit to catch it.

What Should Your Team Actually Do This Quarter?

Treat secrets sprawl as an operational control failure, not a one-time cleanup project. A few moves matter more than the rest:

  • Push secret scanning into the commit pipeline itself, not just into periodic repo audits, so hardcoded keys get flagged before merge rather than after a breach.
  • Force expiration on every credential category, including the ones issued to AI coding assistants and MCP integrations, so a forgotten key cannot stay valid for years the way nearly two-thirds of 2022's leaks still are.
  • Assign a named human owner to every service account and API key at creation time, not retroactively, because ownerless identities are exactly what the offboarding and overprivilege risks in the OWASP list describe.

If your team is still treating this as a developer hygiene problem rather than an identity governance program, the volume alone will outpace manual review. A good curriculum overview of the skills this work actually requires walks through how enterprise security architecture programs cover credential lifecycle management, workload identity, and secure pipeline design as a connected discipline rather than a checklist.

Building the Skill Set This Requires

Closing this gap is an architecture problem as much as a tooling one. Someone has to decide which systems get short-lived credentials versus long-lived ones, how secrets vaults integrate with CI/CD, and how machine identity policy gets enforced across cloud and on-premises workloads at the same time. That is the exact territory covered in Forge University's CompTIA SecurityX certification prep, which goes deep on enterprise security architecture, key and credential lifecycle management, and the governance controls that keep machine identities from becoming the next entry in a breach report.

The organizations getting this right are not the ones running more scans. They are the ones who have someone on staff who can design a credential lifecycle before the next AI tool gets adopted, not after the leak shows up in a report. If you want a study plan built around that kind of enterprise security architecture work, you can start training whenever you're ready.

The data points in one direction. Secrets sprawl tracked with code volume for years, and now it tracks with AI-assisted code volume instead, growing faster than most security teams built their controls to handle. Whoever owns machine identity governance inside your organization needs to treat every new AI integration as a new identity to inventory, not just a new feature to ship.

Start training free at Forge University

AI Coding Tools Are Driving a Secrets Leak Surge — Forge University Blog