Is your AI coding tool leaking your secrets?
Usually not by itself, but the files it writes can. A Claude Code approval file saved full commands, passwords included, and thousands ended up on public GitHub and Docker Hub. Check your repo history, rotate anything exposed, ignore agent folders, and update the tool.
Source: blog.gitguardian.com/claude-code-settings-local-json-secrets-docker-hub
The tool is probably not sending your keys anywhere by itself. The files it creates are the leak. The biggest leak of November came from a convenience button that saved full shell commands, passwords included, into a project file that was later pushed to GitHub or baked into a Docker image. Elsewhere, one agent put account email addresses where they did not belong, one desktop app wired itself into other agents on the same machine, and Windows was found keeping count of which coding agents you run.
Those are different problems that need different fixes. So it is worth taking them one at a time, then spending about ten minutes on your own repos.
The "don't ask again" file
Claude Code asks you to confirm before it runs a shell command. One of the answers is "Yes, and don't ask again". According to Anthropic's own settings documentation, that answer saves the approval as an allow rule in .claude/settings.local.json inside the project.
The catch is what gets saved: the command string itself. If the agent built a curl call with an API key in the header, or a psql call with PGPASSWORD= in front, the key went into the file as plain text.
Apiiro researchers Shmulik Cohen and Matan Giladi went looking for these files on public GitHub. iTWire's write-up of their study reports 104,185 public copies examined, 1,122 of which held secrets, with 1,379 distinct values. When they widened the search to git history, shared settings files and saved transcripts, they found 2,539 distinct secrets across 1,994 repositories. They did not test whether the credentials worked, so treat this as exposure, not proven breach. One company they contacted did confirm its key was live.
GitGuardian ran a bigger and different count. Its research post, dated 9 November, found 31,088 distinct secrets in settings.local.json files across 23,276 public repositories between January 2025 and 7 November 2026, with 5,343 still valid when detected. The two studies used different methods and time windows, so don't add them together or read one as a correction of the other.
For anyone running containers, two findings in the GitGuardian data stand out. First, public Docker Hub images held 613 distinct secrets from these files, 99 of them valid, because COPY . . ignores .gitignore. One valid Cloudflare token sat in 559 tags of a single image. Second, monthly leaks peaked at 12,535 in April 2026 and fell to 959 by October. The researcher says he doesn't know why.
Why do standard scanners miss this? The Postman engineering blog's summary of the Apiiro work notes that 215 of the leaked secrets got past two popular open-source scanners. A cloud key often has a fixed prefix that is easy to spot. A database password after a label has no recognisable format and looks like any other word.
The same Postman post adds a vendor's own data point, so weigh it as such. An inspector it ran on one engineer's laptop for three weeks saw 22 distinct secrets leave in agent traffic, and only 4 of them came from the project's .env. The exact number is not the point. Agents pull keys from more places than the one file you were watching.
What Anthropic says and has changed
The docs say Claude Code adds **/.claude/settings.local.json to your global git excludes the first time it writes the file. That protects one machine. The rule does not travel with the repo, so a new laptop, a teammate's clone or a hand-made file can still be committed.
CSO Online reported that Anthropic did not answer its request for comment. GitGuardian's post relays a Hacker News reply from Claude Code lead Boris Cherny: the team is investigating, the tool has not historically scrubbed secrets, and auto mode and built-in secret scanning are being prototyped.
The Claude Code changelog shows the concrete changes since. Version 2.1.323 changed "don't ask again" so that a rule that looks like it holds a secret, or would land in a git-tracked settings.local.json, lasts for the session only and is not saved. The same release fixed the global ignore not applying when a folder became a git repo later, or on a new machine. Version 2.1.327 tells Claude not to commit files that likely contain secrets. Those changes help from here on. They do nothing for a key that was pushed in the spring.
The email in the User-Agent
A different issue drew even more comments. In GitHub issue #107757, opened on 5 November, a user reported that Claude Code put their account email in the User-Agent header of web requests. Anthropic had been giving the model the account email as context, and the model sometimes used it as a contact string.
A reply on the issue the same day announced a built-in privacy mod that blocks this, on by default from version 2.1.317. The changelog shows the check was then changed in 2.1.321, 2.1.325 and 2.1.334, the last of which adds your git email too. An Anthropic statement quoted in the thread also said the email would be removed from model context entirely. In a 24 November comment on the issue, users said that removal had not shipped, and the issue was still open when checked on 2 December.
This is an identity leak, not a credential leak. It still matters if your account address is also your login name somewhere.
Postman wiring itself into your agents
GitHub issue #14370 now shows only that it has been deleted. Idlen's timeline records what it said. Postman desktop 12.33.4, on an automatic upgrade, installed Postman plugins into Claude Code and Codex, added a Codex startup hook, and pointed Codex at Postman's remote MCP server. The reporter did not claim any data was taken. The complaint was about consent, and about the installer marking its own hook as trusted.
Postman's reply on the issue said it bundles the plugins because users struggled to set them up separately, that each part can be removed in the app, and that it is reviewing the hook approval. Its head of product told a news site the opt-in would be made clearer for existing users.
Windows counting your agents
The fourth story is the least alarming once you read the source. Xusheng Li's analysis found a Windows 11 component that sets a bit when it sees processes such as claude.exe, codex.exe, copilot.exe or cursor.exe, plus common developer tools. He found no prompt text or source code in the event. It is marked as optional diagnostic data, and on his clean US install optional data was switched on by default. You can turn it off under Settings, Privacy & security, Diagnostics & feedback. If you want to see what actually leaves the machine, Microsoft's Diagnostic Data Viewer shows each event as the JSON that was sent.
What to do with this
Treat agent folders the way you treat .env files. That one habit covers most of the above.
Start with history, not just the working tree. In each repo, run git log --all --oneline -- .claude/ .cursor/ .gemini/, as the Postman post suggests. Any hit means the file was committed at some point, even if it is gone today. Then look inside the local file and your user-level settings for allow rules that contain tokens, passwords or connection strings.
If you find one, rotate first. GitGuardian and the Apiiro authors agree on this order. Deleting the file, or even rewriting history, does not reach forks, clones or images that already exist. Price every exposed key as if someone else already has a copy.
Then close the doors. Run git rm --cached .claude/settings.local.json, add the file to the repo's own .gitignore and to .dockerignore, and delete the secret-bearing rules through /permissions or by editing the file. Prefer narrow pattern rules like Bash(npm run test *) over exact commands with values baked in. Keep secrets in a secret manager or the environment, not typed into the command. The settings docs also show deny rules such as Read(./.env) if you would rather the agent never reads those files.
Finally, update Claude Code to a current version, and check ~/.claude/settings.json, ~/.claude/plugins/installed_plugins.json and ~/.codex/config.toml for anything you don't remember installing.
As I see it, the failure here was a default that saved too much, meeting a git add . habit that commits too much. Neither side is new. What is new is that an agent now writes config files in your repo on your behalf, so those files deserve the same suspicion as anything else that can hold a key.
AI helped draft this from the source linked below, and a person checked it against that source before publishing.