TL;DR
- One leaked key had 13 copies, and the team knew about one: Hardcoded fallbacks, a config file, an old pipeline variable, a vault entry, and a Jira ticket all held the same secret. Nobody could say which one the deploy trusted.
- Rotating is easy and breaking production is not: The technical fix took a few hours. Finding copies, ordering three teams, and fearing the next deploy turned it into three days, and the Jira copy was still missed.
- Replay the same leak with a full inventory: See the same incident handled in hours, with every occurrence, owner, and vault match listed before the first pull request. Then learn how to skip the rotation entirely.
Long-lived API keys and passwords end up scattered across the credential layer, often in plaintext and in places they were never meant to be. They tend to stay there, valid and usable by anyone or anything that finds them. They remain this way for one simple reason: Credential rotation is one of the hardest problems in modern security.
The stakes are fairly straightforward: every exposed credential is an open door to stolen data, destroyed systems, or deeper access. This is exactly what attackers have always gone after. Agentic AI raises the stakes, as it acts with whatever credentials are within reach, even when its operator has good intent.
This is a growing problem. GitGuardian's State of Secrets Sprawl 2026 found 28.65 million new hardcoded secrets in public GitHub commits in 2025 alone. That is a 35% year-over-year increase. Valid secrets detected in 2022 were retested in January 2026, and 64% were still valid.
One of the issues with remediation is that rotation is not just toilsome; it is also risky.
Rotating the wrong credential can take down production, break builds, and burn hundreds of engineering hours. A team can lock an attacker out and lock the whole business out in the same moment. Ensuring availability is one of the core tenets of security, so revoking a secret needs to be done deliberately, with supporting data showing nothing terrible is going to happen.
We often get asked, "Why is rotation so hard?"
Credential rotation is hard because, on the surface, it should just be as easy as "rotate and revoke," right? Those final, mechanical steps are actually the easiest parts. The reality is that remediation stalls on mapping everything a credential touches and coordinating its replacement.
To see why, take one realistic enterprise and leak one production credential. Then walk through the remediation twice, once with existing tools and once with GitGuardian fully integrated.
Follow the API key
Picture a mid-sized company on a (simplified) standard cloud setup. In our example, a service calls a SaaS application that holds customer data. It authenticates with a single production API key. Around that key sit six things most teams will recognize.
The code for the service lives in a Git repository. The config file tells the service how to connect. A CI/CD pipeline builds the code and deploys it.
The SaaS application accepts the key and returns customer records. A vault holds the current value of the key. Jira tracks the work, including the incidents.

The pipeline should fetch the key from the vault at deploy time and nothing else should hold it. This is the only copy DevOps knows or cares about, though, since it holds the system together. If there are copies, that is not a business priority.
The reality is that the key actually predates the vault. Developers were hardcoding it as a fallback in the code and config. Someone copied it into the config file to get a local build working. Then they migrated to the vault; the secret was never rotated, so the pipeline kept an old variable with the same value.
During a failed deploy last spring, an engineer pasted it into a Jira ticket so a teammate could reproduce the error. This brings us to our incident.

There are actually 13 copies of one key. The team is accounting for just one of them.
The incident: the code lands in a public repository
Imagine a developer hardcodes a secret they find in Jira for testing reasons and pushes a feature branch to a repository that turns out to be public. This is a very real scenario, and sometimes it is actually intentionally malicious, but, for our example, let's say it was an accident.
Your security team gets an alert via email. Now they have to act. Now the remediation work is forced to take priority.
The instinct is to revoke the key in the SaaS application immediately. Then the questions start.
Does the pipeline read the key from the vault or from its own variable? Which deployments break if the key stops working? Is the copy in the vault the same value as the leaked one? Who has admin rights in the SaaS application?
All of those need answers while the key stays exposed. Here is how that response plays out with and without GitGuardian, based on what customers have told us.
Rotation without GitGuardian

Let's assume the team has everything needed to fix the problem from a technical perspective. That is rarely the issue. They now need answers from a single source of truth about this key.
Hour 0 to 1
Assess the exposure. Security confirms the key belongs to the organization and checks that it still works against the SaaS application. The key can read and write customer records, so the incident becomes critical. Security pulls the SaaS application's access logs and starts looking for whoever owns the integration.
Hours 1 to 4
The team works to find every copy of the secret where it is exposed. This is a manual process, performed from a CLI with legacy tools.
A search of internal repositories turns up the hardcoded fallback and the config file. The platform team opens the pipeline settings and finds the old variable. Nobody can say right away whether the pipeline uses that variable or the vault reference, because both exist and the precedence depends on how the deploy script was written years ago.
Finally, after consulting multiple spreadsheets, everyone agrees that the vault holds the same value as the hardcoded credential. It has taken real effort, but now the team has confirmed that rotating the key will touch every deploy. The assessed risk makes this a top priority for everyone.
However, nobody searches Jira. Tickets don't feel like infrastructure, so the fifth copy stays where it is.
Hours 4 to 8
Next, the team needs to agree on a rotation plan. There was a playbook, but it seems really out of date, as the author is no longer with the org.
The team works out which file or source production actually needs, and that becomes the central conversion point. If the pipeline variable overrides the vault, writing a new value to the vault changes nothing. Revoking the old key first breaks the next deploy. The application team owns the code and config, the platform team owns the pipeline, and a SaaS administrator owns the key itself. Three teams need to agree on an order, all while the clock is ticking with an attacker who has access.
Day 2
The team makes the needed code and vault changes. This takes considerable time and coordination, pulling people off their scheduled work and pushing issues further into their backlogs.
Developers remove the hardcoded fallback and the config copy. The platform team deletes the pipeline variable and points the deploy at the vault. Pull requests, reviews, and a test deploy follow. This is all time that should have been devoted to fulfilling customer requests and keeping users happy.
Day 3
The team's mantra finally becomes "Rotate, revoke, verify." It took a massive "all hands on deck" event to unite everyone behind the cause, with the C-suite chiming in, but it has created focus for now. The SaaS administrator generates a new key. The team writes it to the vault and redeploys. Once the service authenticates with the new key, they revoke the old one and close the incident. All as one coordinated effort, which has made multiple teams switch context for the day.
However, the Jira ticket still holds the old key. True, it no longer works, so the immediate risk is gone, but the incident was still closed with an incomplete inventory. The next leaked key will probably start the same way, as the root cause was overlooked. From the team's perspective, the real issue started with the public push. The real cause was much deeper.
Three days, three teams, six components. This scenario is fictitious; however, it is based on stories real customers have shared with us over the years. The technical changes took a few hours. The rest went to finding copies, untangling which one mattered, and coordinating people.
The same rotation with GitGuardian
Now let's take the same six pieces and the same leak. This time GitGuardian is fully deployed.
Public Secrets Monitoring and Internal Secrets Monitoring are enabled. The Git repositories and Jira are connected as monitored sources, and the vault is connected through a secrets manager integration.

First few minutes with GitGuardian
The security responder gets the alert and immediately understands the situation around this key. GitGuardian detects the public exposure and opens an incident showing the secret type and, where supported, its validity. The same incident lists the internal occurrences. The hardcoded fallback and the config file appear as occurrences in internal repositories. The Jira ticket appears too, because Jira is monitored like any other source.
Secrets manager integrations show that the key is also stored in the vault. That changes the shape of the problem. The key is vaulted but copied, so the fix is to make the vault the only place the key exists.
The Exploration Map brings these relationships together where integrations provide them. The team starts from a list of known locations instead of a blank search bar.

Minutes 20 to 60 with GitGuardian
As teams organize the remediation, the full context is in one consistent user interface, giving every team a unified way to talk about secrets exposure. The pipeline variable is the one copy the team still confirms by hand, which is a "human in the loop" step, which is needed in any process involving critical systems.
The responders already know which repository leaked, so they know which pipeline to open. Ownership information is attached to the incident, so they know immediately who to ask for more information about this key. Security brings in the application owner, the platform team, and the SaaS administrator at the start to coordinate the response, giving everyone a consistent view of what they are seeing.
The team sees the risk score and collectively decides to immediately revoke this secret, as it is connected to too much regulated information. The business signed off on the risk that the next deploy would be disrupted to cut access right now. GitGuardian informs that decision and gives an auditable trail that can back up this decision when the board or auditors ask. The risk is still very real, but GitGuardian has helped them mitigate this risk in a responsible way.
Hours 1 to 3 with GitGuardian
The code and pipeline get updated with AI assistance, thanks to available Model Context Protocol (MCP) servers from GitGuardian and vault providers.
Developers use AI coding assistants, guided by internal standards for secrets handling, to remove the hardcoded fallback and the config copy. The assistant also replaces the pipeline variable with a vault reference and prepares the pull requests. Reviews and a test deploy still apply. Developers simply start from a complete list of locations.
The controlled rotation. The SaaS administrator generates a new key, and the team writes it to the vault, which is now the only copy the pipeline reads. After a successful deploy, the old key is revoked. For supported providers, GitGuardian can revoke the key directly from the incident. Otherwise, revocation runs through the SaaS application's admin console.
The team then uses GitGuardian to confirm the old key is no longer valid and to close out the remaining occurrences. The Jira ticket gets cleaned up as part of the incident.
Same changes, same safety checks. The inventory was complete before the first pull request.
Six activities, with and without GitGuardian

This comparison is illustrative. Real timelines depend on how many systems a key touches and how quickly owners respond.
The first walkthrough spends most of its time building an inventory. The second starts with one. Some changes will still need a maintenance window or a careful deploy. The gain comes from knowing what needs to change before anyone touches production.
Without that context, rotation is a risky infrastructure project. With it, rotation becomes a manageable, repeatable process.
The best rotation is the one you never perform
Six components produced three days of work. Most enterprises run thousands of keys across far more systems. Better remediation helps, and the longer-term goal is preventing exposure and retiring long-lived keys.
In this example, which is pulled from multiple cases we have heard and seen, every copy of a secret that leaked started as a plaintext string on a developer's machine. It was copied into an editor and again into Jira a little further down the line. Moving controls to the developer machine would have stopped copies before they spread.
The GitGuardian command-line interface (CLI), ggshield, offers pre-commit and pre-push hooks that catch hardcoded keys before they reach a repository. AI Hooks add deterministic checks where assistants handle prompts, files, and tools. They block secrets in supported interactions before they reach an AI provider.
GitGuardian Developer Endpoint Protection finds credentials already sitting on developer machines, including files that AI coding agents create or use. They help teams mitigate these occurrences before a security emergency, proactively protecting developers of all backgrounds, including those who just got access to their first coding agent.
Keeping keys out of code, config, and tickets means fewer copies to chase during an incident. Every service that reads only from the vault turns rotation into a single write.
Better yet, moving to short-lived, narrowly scoped access means there is no long-lived key to steal, and you never have to think about manual rotation again.
Prevent leaks before they become rotation projects, done under stress. That will make remediation far less daunting.
If you are ready to get started with Developer Endpoint Protection, we would be happy to book a demo with you.
FAQ
Why is credential rotation so hard?
The mechanical steps of rotating and revoking are the easiest part. Remediation stalls on mapping everything a credential touches and coordinating its replacement across the teams that own the code, the pipeline, and the service that issued the key. Rotating the wrong credential can also take down production, break builds, and burn hundreds of engineering hours.
Why is it risky to revoke a leaked key right away?
A team can lock an attacker out and lock the whole business out in the same moment. Before revoking, responders need to know whether the pipeline reads the key from the vault or from its own variable, which deploys break if the key stops working, and whether the vaulted value matches the leaked one. Those answers need to come while the key stays exposed.
How many copies of a single production key can exist?
In the example in this article, one production API key had 13 copies, and the team was accounting for just one of them. The key predated the vault, so it was hardcoded as a fallback in code and config, left in an old pipeline variable, and pasted into a Jira ticket. Copies like these are rarely tracked as part of rotation planning.
Why do teams miss copies of a leaked secret in tools like Jira?
Tickets do not feel like infrastructure, so nobody thinks to search them. In the article's walkthrough without GitGuardian, the team found the code, config, pipeline, and vault copies, but the Jira ticket kept the old key and the incident closed on an incomplete inventory. The key no longer worked, but the root cause went unaddressed.
How long does credential rotation take without a complete inventory?
In the article's illustrative scenario, three days, three teams, and six components. The technical changes took a few hours. The rest went to finding copies, untangling which one mattered, and coordinating people. Real timelines depend on how many systems a key touches and how quickly owners respond.
How does GitGuardian make credential rotation easier?
GitGuardian starts the response with an inventory. The incident shows the secret type and validity where supported, lists internal occurrences in repositories and Jira, and shows the match in the vault through secrets manager integrations. Ownership information is attached, the Exploration Map shows relationships where integrations provide them, and for supported providers GitGuardian can revoke the key directly from the incident.
How can teams prevent leaks from becoming rotation projects?
Stop plaintext copies at the developer machine. ggshield pre-commit and pre-push hooks catch hardcoded keys before they reach a repository, AI Hooks block secrets in supported assistant interactions, and Developer Endpoint Protection finds credentials already sitting on developer machines. Keeping keys out of code, config, and tickets leaves fewer copies to chase during an incident.
What is the best way to avoid manual credential rotation?
Move to short-lived, narrowly scoped access, so there is no long-lived key to steal and no manual rotation to perform. Until then, every service that reads only from the vault turns rotation into a single write. The best rotation is the one you never have to perform.



