Secrets sprawl is when the passwords and keys software uses get copied into too many places.
This guide is for students, newcomers to IT and anyone whose business relies on apps that connect to other services. You do not need to write code to be affected: if staff or suppliers share keys to save time, those copies can build up quietly.
In short
- Software uses secrets, such as passwords and keys, to connect to other services.
- Each time a secret is pasted, saved or shared, another copy is made, and copies are rarely tracked.
- Copies turn up in code, chat, wikis, build tools, laptops and backups, and many may still work.
- The fix is to find the copies, change the secret, keep the new one in one vault and give it an owner.
What you will learn
- Explain what secrets sprawl is in one sentence.
- Spot the everyday places where copies of a secret pile up.
- Explain why changing the secret matters more than deleting copies.
- Ask your team or supplier how many places a key lives.
- Software password (secret)
- a password, key or token that one program uses to prove who it is to another.
- Copies everywhere (secrets sprawl)
- the build-up of copies of secrets across many tools and places.
- Locked store (vault)
- a safe place that holds secrets and hands them only to the right program.
What is secrets sprawl?
Think of a confidential letter in an office. Someone photocopies it for a meeting. Another copy sits in the printer tray, one on a desk and one in a drawer.
Soon nobody knows how many copies exist, or who can read them. Secrets sprawl is the same thing, but for the secrets that software uses.
Programs often need to connect to other services, such as a database or a cloud account. These programs are non-human identities (NHIs): identities that represent a machine, app, automated process or AI agent rather than a person. Each one proves who it is with a secret, such as a password or an API key (a secret code one program shows another).
People copy these secrets to get work done. A developer saves one in a settings file. A colleague pastes it into chat. A supplier writes it on a wiki page. Every copy is a new place it can leak from.
Where the comparison stops working: a photocopy of a letter is only paper. A copy of a working key can open the service it belongs to, and it looks exactly like the original.
Why does it matter?
The more copies there are, the more chances someone outside can find one. Changing a key also gets harder when you do not know every app and person using it.
The problem is large. GitGuardian, a company that sells secret scanning tools, reported finding more than 23 million new secrets in public code on GitHub during 2024.[1]
If you are a student or new to IT
What could happen: you paste a working key into a group chat to help a classmate, and it is copied on.
Check this: share where a key is kept, not the key itself.
Next: API Keys for Beginners
If you run a small business
What could happen: a key set up by a past supplier lives on in old files that nobody remembers.
Check this: ask suppliers to list each key they hold for you and where it is kept.
If you manage a team
What could happen: one key is shared by several apps, so changing it breaks things and nobody wants to try.
Check this: make sure each important secret has a named owner.
What does it look like?
Here is a made-up list a team might write when they first go looking for one key.
Example only. All values are made up.
Key: EXAMPLE-MAILKEY-0000-FAKE (email service) Found in: shop-app/.env (1) team chat, March, "try this" (2) wiki: "How to set up the shop" (3) build tool settings and logs (4) old laptop backup (5) Owner: unknown (6)
- In a real file, this line would contain the key the app uses to send email.
- A copy pasted into a chat message. Everyone in that chat, past and present, may be able to read it.
- A copy in set-up notes, readable by anyone who can open the wiki.
- A copy stored in the build tool, and maybe printed in the records of its runs.
- A copy inside a backup that nobody checks.
- Nobody knows who looks after the key, so nobody knows who to ask before changing it.
Why this is risky: any of the five copies could leak, and each may still work. Deleting four of them does not help if the fifth is already in the wrong hands.
The safer way: change the key, put the new one in a vault, and let the app fetch it from there. The list then has one place on it, plus a named owner.
How does it work?
Sprawl rarely comes from one big mistake. It builds up through small, normal shortcuts.
- A key is made. Someone creates a key so an app can use a service.
- It is copied to get work done. It goes into a settings file, a script or a wiki page. GitHub lists settings files, wikis and set-up notes among the common places secrets leak.[2]
- It is shared. Someone pastes it into chat or a support ticket to help a colleague. Security guidance from OWASP, a non-profit security community, lists chat apps, logs, laptops and shared file stores as places secrets end up.[3]
- Tools make their own copies. Saved code keeps old versions. Copies spread to other people's versions of the project, backups and the records of automatic build runs.[2] A build tool is the system that tests and ships code automatically, often called CI/CD. If it is not set up with care, it can print a key into its records.[4]
- People move on. Staff and suppliers leave. The copies stay, and nobody remembers what the key opens.

Reversing sprawl follows a simple pattern. OWASP suggests keeping secrets in one central place, where it is clear what each one is for and who to contact about it.[5] It also suggests short-lived credentials (passes that expire by themselves after a set time) where a system allows them, so there is less to copy.[3]

A secret scanner (a tool that looks for passwords and keys) can help with the Find step. Scanners look for a list of supported key formats. Detection depends on those patterns, so unusual passwords can be missed, and the list a scanner produces is a start, not the whole answer.[6]
A worked example
Jonah Jovanovic runs a small online bakery shop, a fictional business with eight staff. Leila Pereira, a freelance developer, looks after its website.
Leila needs to change the key the shop uses to send order emails. She asks Jonah where it is used. He is not sure.
Jonah thinks of the confidential letter. Before shredding it, you need to know where every copy went. So they make a list together.
Leila finds the key in the shop's settings file and in the build tool. Jonah searches the team chat and finds it pasted twice, once by a past contractor. It is also on an old wiki page about setting up the shop.
They do not start by deleting copies. Leila creates a new key first, and puts it in the hosting service's secure settings, where the shop app reads it. She then cancels the old key at the email service. Once that has taken effect, the old copies should no longer give access.
Then they tidy up. Jonah deletes the chat messages and edits the wiki page so it says only "the app reads its keys from the secure settings". Leila checks the email service's records. She sees no sending from unknown places in the records available to her.
Last, Jonah writes the key into a simple list of the shop's secrets, with Leila named as owner. Next time, the question "where is it used?" has an answer.
Myths and mistakes
| What people think | What is true |
|---|---|
| We have a vault, so we have no sprawl. | A vault helps only if the old copies are found and the secret is changed. Copies outside it may still work. |
| Our chat and wiki are private, so keys there are safe. | Private tools are read by many people over time, including past staff and suppliers. |
| Deleting the copies fixes the problem. | A copy may already have been taken. Change the secret first, then tidy up. |
| Sprawl is only a problem in code. | Secrets also turn up in chat, tickets, logs, laptops and backups.[3] |
| Sharing one key across apps saves effort. | Shared secrets make it hard to tell where a leak came from.[5] Give each app its own. |
What can I do this week?
- Pick one important key and list every place it is kept.
- Search your team chat and wiki for words like "password", "key" and "token".
- Agree a team rule: share where a secret is kept, never the secret itself.
- Ask each supplier which of your keys they hold and where.
- Give each important secret a named owner.
Checklist
- We have a list of our important secrets and what each one opens.
- Each secret on the list has a named owner.
- Secrets live in a vault or the hosting service's secure settings, not in files or messages.
- Each app has its own secret, not one shared with other apps.
- Code, chat and wikis are scanned for secrets from time to time.
- Build tools are set up so secrets are not printed in their records.
- When a copy is found, the secret is changed first, then the copies are removed.
- Suppliers follow the same rules, in writing.
Common questions
Is secrets sprawl the same as a leak?
No. Sprawl means a secret has been copied into many places. A leak means a copy has reached someone who should not have it. Sprawl makes leaks more likely, and it makes them harder to clean up, because nobody knows every place to check.
How do I know how bad our sprawl is?
Start small. Pick a few important keys and list where each one appears, using a secret scanner and a search of chat and wikis. Count how many still work and how many have no owner. That gives you a first picture to improve on.
Does a vault stop sprawl?
Partly. A vault gives secrets one proper home, and apps can fetch them when they run. But a vault does not find old copies, and people can still copy a secret out of it. Pair the vault with scanning, owners and clear sharing rules.
What should I do if I find a key in a chat message?
Tell the owner of the key or your security contact straight away. The key should be changed first, then the message deleted. We suggest doing this even if the chat is private, since you cannot tell who has already read it. See Leaked Secret Response for Beginners.
Can AI tools add to secrets sprawl?
Yes. Pasting a key into an AI chat or coding assistant makes one more copy, held by another service. Treat AI tools like any other place a key might be stored, and keep keys out of prompts.
Where next?
Ready for the detail? Read the practitioner guide: Secret Sprawl Measurement Guide. It goes further into which numbers show real exposure, where to collect them and how to report progress.
Also useful:
- Secrets Sprawl vs Vault Sprawl
- Secrets in Code for Beginners
- Leaked Secret Response for Beginners
- Non-Human Identities for Beginners
- NHI Foundation Level Training
Related NHI Mgmt Group resources: Secrets Management Guide · OWASP NHI Top 10 NHI2 Secret Leakage Guide · AI Coding Tools and Secrets Sprawl
Key terms
- Secrets sprawl
- The build-up of copies of secrets across code, tools, messages and devices, which makes them hard to track and change.
- Secret
- A password, key, token or certificate that software uses to prove it may act.
- API key
- A secret code one program shows another to prove it may connect.
- Secrets manager
- A tool, often called a vault, that stores secrets, controls who can read them and records each use.
- Secrets inventory
- A list of where secrets exist, who owns them and whether they still work.
- Secrets rotation
- Replacing a secret with a new one, so old copies no longer give access.
Sources and further reading
- The State of Secrets Sprawl 2025. GitGuardian, 2025. https://www.gitguardian.com/state-of-secrets-sprawl-report-2025, accessed 28 Nov 2026.
- Secret leakage risks. GitHub Docs, GitHub. https://docs.github.com/en/code-security/concepts/secret-security/secret-leakage-risks, accessed 28 Nov 2026.
- OWASP Non-Human Identities Top 10, NHI2:2025 Secret Leakage. OWASP Foundation, 2025. https://owasp.org/www-project-non-human-identities-top-10/2025/2-secret-leakage/, accessed 28 Nov 2026.
- Using secrets in GitHub Actions. GitHub Docs, GitHub. https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions, accessed 28 Nov 2026.
- Secrets Management Cheat Sheet. OWASP Cheat Sheet Series, OWASP Foundation. https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html, accessed 28 Nov 2026.
- Supported secret scanning patterns. GitHub Docs, GitHub. https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns, accessed 28 Nov 2026.