Most leaked keys don't start with a hacker. They start with someone trying to get a build working.
An agent opens your .env to work out why a test fails. It prints the environment to see what's set. It hardcodes a token because that made the error go away. Nobody meant any harm, and your production key has now left the building.
Turn on Mask secrets and keys, tokens and passwords are taken out of every request before it leaves your machine. The agent can still use a key you give it, without ever seeing it.
When the agent finishes changing files, a secret scanner checks them and tells you the file and line, while it's still easy to fix.
Give the agent the work. Keep the keys.
A cloud key can reach your customer data. A CI token can put code in front of every customer you have. A database password can sit in the same file as five others. Whoever holds one of these looks like a legitimate employee in your logs, which is why these breaches go unnoticed for so long. Then comes the part nobody budgets for: rotating everything that key touched, working out what was accessed, telling customers, and answering your auditor when they ask who has had access to that credential.
| Sent to the model | Whatever the agent reads goes into the request. Your key is now on someone else's servers, under their retention policy, outside anything your security team controls |
| Committed to git | Deleting it in the next commit doesn't help. Git keeps the history, and so does every clone, fork and CI cache that already has a copy |
| Pushed to a private repo | Private isn't safe. GitGuardian found hardcoded secrets in 32% of internal repositories, against 5.6% of public ones, and everyone with repo access can read them |
| Written faster | 29 million new secrets reached public GitHub in 2025, up 34% in a year. Commits made with one popular coding agent leaked at about twice the usual rate, 3.2% against 1.5% |
| Left working | 64% of the secrets GitGuardian found leaked in 2022 still worked in January 2026. A leak stays dangerous until someone rotates the key · the report |
Your messages, file contents and command output all pass through masking on your machine, right before each request goes to the provider. It's one switch in Settings, off until you turn it on. If masking can't finish, the text is replaced with a marker or the request isn't sent at all. It never falls back to sending the original.
| Known key formats | Dozens of them, including OpenAI, GitHub, GitLab, AWS, Google, Slack, Stripe, npm and PyPI |
| Credentials in context | Authorization headers, private keys, JWTs, and passwords inside database URLs |
| Files made for secrets | When the agent reads .env files or shell profiles, or dumps the environment, any value under a name like KEY, TOKEN or PASSWORD is masked, whatever its format |
| Keys you've already given it | Once KodaCode holds a value, it's hidden wherever it turns up again, including in command output |
| What it can't catch | Masking works by recognising secrets. A password in ordinary source code, with no known format, can get through. Keep those out of the code, and let the scanner and /review catch the rest |
Click the shield and paste, and your message holds [secret 1] instead of the value. The model gets a placeholder like «secret:1» and writes that into its command. KodaCode swaps the real value back in on your machine just before the command runs. The value itself is stored encrypted, and the key that opens it stays in your system's keychain. A key you type straight into a message is picked up the same way, if KodaCode recognises it.
| After every change | When a turn changes files, the secret scanner checks them and shows what it found, with the file and line · see it catch one |
| Branches and commits | Run /review on a branch or a commit and the scanner goes through those commits too |
| You decide | The scanner warns you and doesn't block anything. Move the value out, and rotate the key if it has already been pushed |
| The scan stays local | The report leaves the value out, and a key it finds is never sent to its provider to check whether it works |
| Masked values stay masked | If the model tries to write a masked value into a file, the write is refused, so you don't end up with a broken key in your config |