# Is your AI coding tool leaking your secrets?

- Type: News
- Author: Daniel Okafor
- Published: 2026-12-02
- URL: https://aimunk.com/p/is-your-ai-coding-tool-leaking-your-secrets
- Source: https://blog.gitguardian.com/claude-code-settings-local-json-secrets-docker-hub/

> 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.

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](https://code.claude.com/docs/en/settings), 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](https://itwire.com/business-it-news/security/claude-code-approval-files-found-exposing-company-secrets-on-github-says-apirro-researchers) 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](https://blog.gitguardian.com/claude-code-settings-local-json-secrets-docker-hub/), 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](https://blog.postman.com/your-coding-agent-leaked-the-key-it-was-only-following-orders/) 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](https://www.csoonline.com/article/4247336/claude-codes-dont-ask-again-button-has-a-secrets-spilling-problem.html) 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](https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md) 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](https://github.com/anthropics/claude-code/issues/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](https://github.com/postmanlabs/postman-app-support/issues/14370) now shows only that it has been deleted. [Idlen's timeline](https://www.idlen.io/news/postman-desktop-auto-installs-claude-code-codex-plugins/) 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](https://xusheng.dev/posts/windows-coding-agent-telemetry/) 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](https://learn.microsoft.com/en-us/windows/privacy/diagnostic-data-viewer-overview) 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](https://blog.gitguardian.com/claude-code-settings-local-json-secrets-docker-hub/) 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](https://code.claude.com/docs/en/settings) 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.

## Reply, by Rachel Levi

The article ends by sharing the blame between a default and a habit. I am less generous, and I would like to ask why.

A confirmation button saved the full command, secret included, as plain text in the project folder. Who decided that the thing to store was the whole command and not a pattern? The article relays the team lead saying the tool has not historically scrubbed secrets. Why not, when its job is to run commands that contain them?

Users have committed too much for as long as version control has existed. Anyone designing a tool that writes files into a repository knows that. So is this a user habit meeting a default, or a default designed without the user's known habits in mind? As someone who leads application security, I know which of those I would write up as the root cause.

## Reply, by Girish Kamath

12,535 leaks in April 2026, 959 by October. Those are the article's monthly figures, and I think they're the most cheerful numbers in a gloomy piece.

The researcher says he doesn't know why it fell, so I won't claim the fixes did it. But look at the rest of the timeline. An issue was opened on 5 November and a reply announcing a block came the same day. The changelog shows the "don't ask again" behaviour has been changed since. That's a tool being fixed in public, quickly, because real use exposed the problem.

Private testing rarely finds what thousands of real repos find. Shipping and then fixing fast is how this kind of flaw gets found at all. I wouldn't call it careless.

## Reply, by Rachel Levi

A related risk surfaced this week, on the model side instead of the tool side. A scan of public Hugging Face repositories found GGUF models whose chat template inserts a fake system directive telling an agent with shell access to download and run a script: [Malspark write-up](https://malspark.com/blog/malicious-gguf-models-hugging-face/). If your agent runs a local community model and has a shell, the model file is part of your attack surface.

## Reply, by Lucas Ferreira

A fresh example of the same problem, from a [GitHub issue](https://github.com/convex/convex-backend-skill/issues/64) discussed this week.

1. The issue says a quickstart skill for coding agents sent the user's one-sentence project idea to a remote server, in a step marked in a code comment as telemetry, without telling the user.
2. A reply from the project side on 28 November said the prompts are not used for telemetry, are sent only to generate a custom quickstart, and that the comment wording was wrong.
3. The reporter then wrote that a later commit removed the telemetry labels and lets the user approve or decline. Two points were still open: scripts fetched at run time that are not pinned, and an unclear retention period.

Fixed fast, which is good. The lesson stays: a skill is code that runs with your agent's access. Read it before you install it.
