Secret Sprawl: How to Detect and Prevent It (2026 Data)

On this page
  1. What secret sprawl is
  2. Secret sprawl in numbers (2026)
  3. Where secrets sprawl: the places to look
  4. How to detect secret sprawl
  5. We tested what pattern scanners catch
  6. Update, 14 November 2026: Secret Sentinel as shipped
  7. How to prevent secret sprawl
  8. When you find one: the response that actually closes it
  9. Where our tools fit, and where they don’t

Short answer: secret sprawl is copies of credentials spreading into places nobody controls: code, CI logs, Jira tickets, Confluence pages, chat. It is growing: GitGuardian’s State of Secrets Sprawl 2026 counted 28.65 million new secrets in public GitHub commits in 2025 (up 34%), found that about 28% of incidents start entirely outside repositories, and that more than 64% of credentials valid in 2022 still worked in January 2026. Detect it by scanning every place people paste, not just git. Prevent it by taking people out of the path (short-lived credentials, no copied values), redacting at paste time, and revoking every key you find. And know the limit of scanning: in our test of 1,400 fake leaks, tokens with a vendor prefix were found almost every time. Passwords with no prefix were missed by both scanners we had on 1 November. Rerun on 14 November, Secret Sentinel as shipped finds 1,396 of the 1,400, up from 898, and 346 of those 350 passwords by the word written next to them.

What secret sprawl is

An engineer retrieves a database credential from the company vault, pastes it into a debug command, and later copies the terminal output into a Confluence incident page. The vault authenticated the request, logged the read and never lost control of its own storage. The organization still has a working database password on a wiki page the whole department can read.

That is secret sprawl: not one dramatic leak, but credentials multiplying through ordinary work. Each copy is as good as the original. Nobody tracks the copies, so nobody revokes them, and the places they land (tickets, pages, chat threads, CI logs) are read by far more people than the vault ever was, and kept for years.

Copy-propagation diagram: an authorized read from a secrets manager can create plaintext in a process environment, terminal log, Jira issue, Confluence page, or git commit; the vault governs the source copy but not every downstream copy.

Three terms help when people argue about it. A secret is anything that grants access by being known: an API key, a token, a password, a private key, a connection string with a password in it. An occurrence is one copy in one place. An incident is one secret, however many copies it has. Sprawl is occurrences outgrowing incidents: one key, twenty copies, and every copy has to be found, because each one keeps working until the key itself is revoked.

It is not the same as “we don’t use a vault”. GitGuardian’s 2025 report found that 5.1% “of repositories using secrets managers still leaked secrets in 2024”. The vault protects the canonical copy. Sprawl is everything that happens after a person or a build reads it.

Secret sprawl in numbers (2026)

All figures from the primary reports, fetched on 1 November 2026.

FindingNumberSource
New hardcoded secrets in public GitHub commits, 202528.65 million, up 34% year over yearGitGuardian 2026
Incidents that start entirely outside repositories (Slack, Jira, Confluence)about 28%GitGuardian 2026
How much likelier those non-code leaks are to be critical13 percentage pointsGitGuardian 2026
Secrets found both in code and outside it4%GitGuardian 2026 report page
Internal repositories vs public onesabout 6Ă— likelier to contain hardcoded secretsGitGuardian 2026
Credentials valid in 2022 that still worked in January 2026more than 64%GitGuardian 2026
Critical secrets missed if you only act on ones you can validate46%GitGuardian 2026
Leaked AI service secrets, 20251,275,105, up 81%GitGuardian 2026
Repositories using a secrets manager that still leaked, 20245.1%GitGuardian 2025
Collaboration-tool incidents rated highly critical or urgent38%GitGuardian 2025

Two numbers matter most for planning. The 4% overlap means a code scanner and a collaboration-tool scanner find almost entirely different secrets: you cannot cover one surface with the other. And the 64% means the hard part is not finding leaks but closing them; a finding that sits in a queue for a year is a working key for a year.

Where secrets sprawl: the places to look

Every place on this list has a reason people paste credentials into it. That reason is also where prevention has to start.

PlaceHow secrets get thereWhat usually watches it
Git repositories, including internal onesconfig committed “for now”, test fixtures, .env filespre-commit hooks, push protection, repository scanners
Git historya secret removed in a later commit is still in the old onea full-history scan; removing it needs a rewrite and a revoke
CI/CD logsdebug output, set -x, a failed step printing its environmentlog masking, which matches known values only
Jira issues and commentsincident notes, “here are the creds to reproduce”, pasted stack tracesGuard Premium or a Marketplace app; nothing by default
Confluence pages and commentsrunbooks, onboarding pages, setup guides, tables of service accountsGuard Premium or a Marketplace app; nothing by default
Chat (Slack, Teams)“can you send me the key”, screenshots of terminalsthe chat vendor’s DLP, if bought
Attachments and screenshotslog exports, HAR files, a photo of a terminalalmost nothing: text scanners skip images
AI assistant prompts and configspasted configs, MCP server settingsGitGuardian found 24,008 unique secrets in MCP configuration files on public GitHub
Laptops and build runners~/.aws/credentials, shell history, cached tokensendpoint tools; 59% of compromised machines in GitGuardian’s sample were CI/CD runners

The collaboration rows deserve the most attention because they are the least watched and the most read. A git repository is read by the people who build it. A Jira project or a Confluence space is read by the whole department, by contractors, sometimes by customers through a portal. Our earlier look at secrets in Jira issues goes through how they get there; the credential leak guide for Confluence and Jira covers the habits behind it.

How to detect secret sprawl

Detection works in layers, from the cheapest point (before the secret is saved anywhere) to the most expensive (finding a copy that has been sitting somewhere for years).

1. At the keyboard and at commit. OWASP’s Secrets Management Cheat Sheet says to “consider enabling secrets detection at the developer level to avoid checking secrets into code before commit/PR”. A pre-commit hook and the code host’s push protection stop most new code leaks before they exist.

2. Every repository’s history. Run a full-history scan on all repositories, internal ones first: GitGuardian finds internal repositories about six times likelier than public ones to contain hardcoded secrets, and nobody outside the company is looking at them for you.

3. Where people write, not only where they code. Jira, Confluence and chat need their own scanner. In Atlassian Cloud the built-in option is Atlassian Guard Premium, whose sensitive data detection covers credentials, which Atlassian describes as “data like API tokens and private keys”. Its own documentation lists the gaps: it does not scan “Confluence whiteboards and databases” or “text entered into our fields from third-party apps”; in Jira, “we don’t scan fields that haven’t changed”; and attachments are skipped when they are over 5 MB, compressed or archived. Its Findings page combines real-time monitoring with “full-site content scans”, so it can look at existing content too. Without Guard Premium, nothing in Jira or Confluence scans for credentials; a Marketplace app or an external scanner has to.

4. Rank, but do not discard. Validating a finding (does the key still work?) is the fastest way to rank a queue. It is a bad way to empty one: GitGuardian reports that “46% of critical secrets are missed by validation-only prioritization”, because many secret types have no safe way to test them.

5. Measure the right thing. A falling number of findings can mean fewer leaks, or a scanner that lost coverage. Track findings by place, time to revoke, and repeat leaks of the same credential, and test the scanner with known fake secrets now and then; our guide to testing detection without live credentials shows how.

We tested what pattern scanners catch

Almost every secret scanner, including ours, is a set of patterns: a known prefix, a length, an alphabet. We wanted to know how far that gets you on the kind of text people actually paste into Jira and Confluence, so we measured it.

Method. We wrote 28 leak shapes the way they appear in tickets and pages: a comment with an AWS key pair, a runbook line export GH_TOKEN=…, a pasted .env, a curl -u command, a Basic auth header, a password in a table, a password in a sentence. Each value was random, generated in the vendor’s published shape (prefix, length, alphabet), 50 values per shape, 1,400 fake leaks in all. On 1 November 2026 we ran them through two scanners: the scanner inside Secret Sentinel at that time (secretlint rules, repository commit 57c1931, the same credential rules as the production versions then) and our free API key leak checker, which then knew 47 formats. A leak counts as found when the scanner reports anything in it. The generator, the runners and the raw counts are kept with our research notes.

What changed on 6 November. The test showed big gaps in both, so we built keysnitch, an open-source engine (MIT, no dependencies) with every gitleaks rule for text and its own rules for passwords. Secret Sentinel and the free checker both run on it now. We ran the same 1,400 values through keysnitch 0.1.0 from npm: it found 1,392. Read that number with care. keysnitch was written after this test, by people who knew its shapes, so it is not a blind result. A fair test of keysnitch needs leak shapes it has not seen, and we will publish one. On 14 November we ran the shapes again through the app itself; the update below has the method and the numbers.

Bar chart titled Secret Sentinel went from 898 to 1,396 of 1,400 fake leaks, showing the share found by four scanner runs, in three groups. Tokens with a vendor prefix, 14 shapes and 700 leaks: Secret Sentinel on secretlint on 1 November found 548, 78 percent; the old free checker 697, 99.6 percent; keysnitch 0.1.0 on 6 November 700, 100 percent; Secret Sentinel as shipped on 14 November 700, 100 percent. Private keys, connection strings and JWTs, 7 shapes and 350 leaks: Secret Sentinel on 1 November 300, 86 percent; the old checker 350; keysnitch 350; Secret Sentinel on 14 November 350, 100 percent. Passwords and tokens with no prefix, 7 shapes and 350 leaks, including a .env line, curl -u, a Basic auth header, docker login -p, a table cell and a sentence: Secret Sentinel on 1 November 50, 14 percent, all of them a kubeconfig token line; the old checker none; keysnitch 342, 98 percent; Secret Sentinel on 14 November 346, 98.9 percent. A note says keysnitch was written after the first test, so these results are not blind, and the 14 November run used fresh random values. Source: Simplify tests, 1 November 2026; keysnitch rerun 6 November 2026; Secret Sentinel Jira 2.15.0 and Confluence 4.8.0, commit e03a738, keysnitch 0.1.1, 14 November 2026.

Every shape, with how many of its 50 fake leaks each scanner found. The 14 November column used new random values in the same shapes:

Leak shapeWhere we put itSecret Sentinel, 1 NovOld checker, 1 Novkeysnitch, 6 NovSecret Sentinel, 14 Nov
AWS access key pairJira comment50/5050/5050/5050/50
GitHub token (classic)Confluence runbook50/5050/5050/5050/50
GitHub fine-grained tokenJira description50/5050/5050/5050/50
GitLab personal tokenJira comment50/5050/5050/5050/50
Slack bot tokenConfluence page50/5050/5050/5050/50
Slack webhook URLJira comment50/5050/5050/5050/50
Stripe live secret keyJira comment50/5050/5050/5050/50
OpenAI project keyConfluence page48/5050/5050/5050/50
Anthropic API keyJira comment50/5050/5050/5050/50
Google API keyConfluence page0/5049/5050/5050/50
SendGrid API keyConfluence page50/5050/5050/5050/50
npm access tokenJira comment50/5050/5050/5050/50
Atlassian API tokenJira comment0/5050/5050/5050/50
Telegram bot tokenConfluence page0/5048/5050/5050/50
SSH private keyConfluence page50/5050/5050/5050/50
GCP service-account JSONConfluence page50/5050/5050/5050/50
Azure storage connection stringJira description0/5050/5050/5050/50
Postgres URL with a passwordConfluence page50/5050/5050/5050/50
MongoDB URL with a passwordJira description50/5050/5050/5050/50
curl with a Bearer JWTJira comment50/5050/5050/5050/50
Bare JWT (session token)Jira comment50/5050/5050/5050/50
kubeconfig token: lineConfluence page50/500/5050/5050/50
.env line DB_PASSWORD=…Jira comment0/500/5050/5050/50
curl -u user:passwordConfluence runbook0/500/5050/5050/50
Authorization: Basic … headerJira comment0/500/5050/5050/50
docker login -p …Confluence runbook0/500/5050/5050/50
Password in a table cellConfluence table0/500/5042/5046/50
Password in a sentenceJira comment0/500/5050/5050/50
Total8981,0471,3921,396

What the numbers say:

  • A prefix is what makes a secret findable. AKIA, ghp_, xoxb-, sk_live_, glpat-: when the vendor stamps its tokens, a scanner finds them every time, wherever they are pasted. The few random misses of the old scanners (two OpenAI keys, one Google key, two Telegram tokens) were all values ending in a hyphen, where the rule’s word boundary does not fire.
  • A password needs a word next to it. On 1 November neither scanner found a password in a sentence, in a table, after docker login -p, in curl -u, in a .env line named DB_PASSWORD, or base64-encoded in a Basic header: 0 of 300 for each. keysnitch finds them by the context: the word “password”, the -u and -p flags, the Basic header, a column named “Password”. It still misses 8 of 50 passwords in a table: values made only of letters, which it skips on purpose so that a word like “regenerate” in a table is not reported. Secret Sentinel missed 4 of 50 there on 14 November, for the same reason. A password with nothing around it stays invisible to any pattern scanner.
  • Coverage lists differ, so check yours. On 1 November Secret Sentinel’s rules had no pattern for Google API keys, Atlassian API tokens, Telegram bot tokens or Azure storage keys. That is why we moved it to keysnitch, and on 14 November it found 50 of 50 of each. Ask any scanner vendor for the list, then test it with fake values in the shapes your company uses. For Atlassian tokens in particular, and the Basic header that hides their prefix, see Jira API token.

The conclusion is not “scanners don’t work”. It is that a scanner is a net for tokens and for passwords written next to a label, and prevention still has to deal with shared human passwords, mostly by not having them for services at all, which is where the prevention section starts.

Update, 14 November 2026: Secret Sentinel as shipped

The 6 November number came from the engine on its own. On 14 November we tested the app.

What changed. On 1 November Secret Sentinel ran on secretlint and found 898 of the 1,400 fake leaks. Since Jira 2.12.0 and Confluence 4.5.0, released on 6 November, it runs on keysnitch. The version we tested is the one in production on 14 November: Jira 2.15.0 and Confluence 4.8.0. Both are built from the same commit, e03a738, with keysnitch 0.1.1. The releases after 2.12.0 changed where the app looks on a page and how much of a value it masks, not which formats it knows.

Method. The same 28 shapes from the same generator, 50 values per shape, but fresh random values, not the ones from 1 November. The generator now takes a seed (20261114), so the same 1,400 values can be built again for other scanners. We ran them through scanText(), the function both apps run on the text of every saved page, issue and comment, taken from the release tag, not from a newer branch. The rule did not change: a leak counts as found when the scanner reports anything in it. To check the result was not luck, we built three more sets without a seed and got 1,393, 1,396 and 1,393.

GroupLeaksSecret Sentinel, 1 Nov (secretlint)Secret Sentinel, 14 Nov (keysnitch 0.1.1)
Tokens with a vendor prefix700548 (78.3%)700 (100%)
Private keys, connection strings, JWTs350300 (85.7%)350 (100%)
Passwords and tokens with no prefix35050 (14.3%)346 (98.9%)
All1,400898 (64.1%)1,396 (99.7%)

What the rerun shows:

  • The four missing formats are found. Atlassian API tokens, Google API keys, Telegram bot tokens and Azure Storage keys: 0 of 50 each on 1 November, 50 of 50 each now. Atlassian tokens matter most in an app for Jira and Confluence: they open the site the leak sits on.
  • The trailing-hyphen misses are gone. OpenAI project keys went from 48 to 50 of 50.
  • Passwords next to a label are found. A .env line, curl -u, a Basic header, docker login -p and a password in a sentence: 0 of 50 each on 1 November, 50 of 50 each now.
  • The 4 misses are all in a table column. Each was 12 letters with no digit. keysnitch skips letters-only values in a table on purpose, so that a word in a table is not reported as a password. About 1 in 8 random 12-character values has no digit, so expect 4 to 8 misses in 50. In our four sets we saw 4, 7, 4 and 7.

This rerun shows that the shipped app finds what the engine finds. It is still not a blind test: the shapes were known when keysnitch was written. If you keep .env files around, our .env file format test shows how differently 11 loaders read the same file, and our Claude Code and .env test shows what an AI assistant reads from it.

How to prevent secret sprawl

Ranked by how much sprawl each control removes, most first.

1. Take people out of the path. OWASP puts it plainly: “it is better to limit or remove the human interaction with the actual secrets.” A credential that no person ever sees cannot be pasted. Where the platform supports it, workloads should authenticate with their own identity (cloud workload identity, OIDC from CI to the cloud) instead of a stored key.

2. Make credentials short-lived. OWASP: “Dynamic secrets should be used where possible to reduce the surface area of credential reuse.” A token that expires in an hour turns a leak in a ticket from a standing risk into a short one. For the rest, “regularly rotate secrets so that any stolen credentials will only work for a short time.”

3. Share access, not values. When a colleague needs a credential, grant them access to it in the vault, or give them a link to the vault entry. A pasted value is a copy; a link is not. Write this into runbook templates: a placeholder like <from vault: payments/db> where people would otherwise paste the value.

4. Stop secrets where they are typed. Pre-commit hooks and push protection for code; for Jira and Confluence, a scanner that acts when content is saved and removes the value from the page, not one that reports a week later. Remember the test above: this catches tokens and passwords written next to a label, not a bare password with nothing around it.

5. Keep secrets out of logs. OWASP’s list says secrets must “never be logged”. Masking in CI only hides values it already knows, so do not print environments, and turn off shell tracing around credential handling.

6. Retire shared human passwords. The shapes no scanner caught on 1 November (a router password, a Grafana admin, docker login -p) are shared passwords used by people. Single sign-on, per-person accounts and a password manager for the few that are left remove the reason to paste them.

7. Use encrypted config instead of plaintext files. For teams that keep configuration in git, encrypting each value removes the plaintext .env that keeps getting committed; envseal is our open-source take on it.

When you find one: the response that actually closes it

Finding a secret is the start. The order matters:

  1. Revoke the credential at its source (the cloud console, the vendor dashboard). OWASP: “Keys that were exposed should undergo immediate revocation.”
  2. Issue a replacement and deploy it to whatever legitimately used the old one.
  3. Remove the copies, every occurrence, not just the one that was reported. Deleting the text does not revoke the key, and Jira and Confluence keep history: old page versions and issue history still hold the value.
  4. Check the logs of the service the credential opened for use between the leak and the revoke.
  5. Record it: where it leaked, why, how long it was valid, so the same runbook does not leak it again next quarter.

Our guide to rotating credentials after a leak goes through each step by credential type.

Where our tools fit, and where they don’t

Secret Sentinel scans Jira issue summaries, descriptions and comments, and Confluence pages, blog posts and comments, when they are created or edited, and replaces each credential it recognizes with a marker such as [REDACTED by Secret Sentinel: github_token, ghp_****1a2b]. It can open a Jira security incident so someone owns the rotation, and it runs on Atlassian Forge, inside your site. What it does not do, so you can plan around it:

  • It acts on new and edited content; it does not sweep years of old pages, attachments or page history. For existing content you need a full-site scan (Guard Premium’s Findings, or an external scanner) once, then Secret Sentinel keeps new leaks from piling up.
  • It finds known credential formats and passwords written next to a label, not a bare password with nothing around it. Since 6 November it runs on keysnitch, with 250 formats from 128 companies and projects; the Advanced edition adds your own patterns for internal token formats.

Install Secret Sentinel for Jira · Install Secret Sentinel for Confluence

To check a snippet before you paste it into a ticket, our free API key leak checker runs entirely in your browser, sends nothing anywhere, and gives you a redacted copy to paste instead.

Frequently asked questions

What is secret sprawl?

Secret sprawl is the spread of copies of credentials (API keys, tokens, passwords, private keys) into places nobody controls or watches: source code, CI logs, tickets, wiki pages, chat, screenshots. Each copy works as well as the original, and most are never revoked. GitGuardian counted 28.65 million new hardcoded secrets in public GitHub commits in 2025 alone, and found about 28% of incidents originate entirely outside repositories.

How can you detect secret sprawl?

Scan every place people paste, not only git. That means pre-commit and push scanning for code, a history scan of every repository (internal ones too), scanning CI logs, and scanning Jira, Confluence and chat where incidents and runbooks live. Then validate and rank what you find, but do not drop findings that cannot be validated: GitGuardian reports that 46% of critical secrets are missed by validation-only prioritization.

How do you prevent secret sprawl?

Take people out of the path: workloads should fetch short-lived credentials themselves, so nobody holds a value they could paste. Share access through the vault, not by copying values. Block secrets at commit, redact them at the moment they are pasted into a ticket or page, and revoke and rotate every credential that is found, because deleting the text does not make the key stop working.

Does a secrets manager stop secret sprawl?

No. A vault protects its own copy and logs who reads it, but it cannot control what happens to a value after an authorized read: a debug command, a pasted log, a runbook. GitGuardian found that 5.1% of repositories using secrets managers still leaked secrets in 2024. A vault is necessary; detection and short-lived credentials cover what it cannot.

Does Atlassian scan Jira and Confluence for secrets?

Only with Atlassian Guard Premium, whose sensitive data detection covers credentials such as API tokens and private keys. Atlassian documents what it skips: Confluence whiteboards and databases, text entered by third-party apps, unchanged Jira fields, and attachments over 5 MB, compressed or archived. Without Guard Premium, Jira and Confluence do not scan content for credentials; a Marketplace app or an external scanner has to.

Why do leaked secrets stay valid for so long?

Because finding a secret and revoking it are done by different people. The person who sees the leak rarely owns the credential, and revoking it may break production, so it waits. GitGuardian retested credentials that were valid in 2022: in January 2026, more than 64% still worked.

Is it safe to paste a key into an online checker?

Only if the checker never sends what you type anywhere. Our API key leak checker runs entirely in your browser: the page makes no network request with your text and stores nothing. Even so, if the key is real and you are checking it because it leaked, revoke it first; a checker tells you what it is, not whether someone already used it.

Keep reading