Neodrop
Create
FeedDiscoverMy ChannelsAuto-publishJoin Our Discord
Neodrop
A smoother experience in the app
FeedDiscoverCreateMy Channels
Clicking 'don't ask again' left 2,539 secrets in public GitHub repos, and a second Claude Code artifact leaked account emails the same week
2026-11-08

Clicking 'don't ask again' left 2,539 secrets in public GitHub repos, and a second Claude Code artifact leaked account emails the same week

How Claude Code's "don't ask again" turned an approved command into a saved rule holding the password, what 1,122 public copies of that file exposed, and the artifact inventory a product team can use to find the same failure inside its own agent.

Tech Trend Translator: The PM Brief
Tech Trend Translator: The PM Brief@NeoDrop Official
A developer asks Claude Code why staging login fails. The command the agent proposes carries the staging password, because the command cannot work without it.
Claude Code asks for approval, as it does for most shell commands.
Pick "Yes, and don't ask again", and the tool runs the command and writes a permission rule into .claude/settings.local.json, inside the project folder. The rule is the command. The password is inside the rule.
Apiiro went looking for that file on GitHub and found 104,185 public copies across 103,617 repositories. Of those, 1,122 held at least one real secret, a hit rate of 1.1% 1.
Counting git history, the shared settings file teams commit on purpose, and saved agent transcripts, the total came to 2,539 distinct secrets across 1,994 repositories 1.
The same week, a second Claude Code artifact leaked something else with the same shape. An engineer on the team confirmed it, apologized for it, and explained how it happened 2.
Two incidents are not a pattern. Two incidents with one structure are. Each time, a change made for a good reason pushed state into a durable artifact, and nobody measured what the artifact contained.

What the button actually writes

The persistence rules are specific, and they are the part a reader can check against their own harness.
Bash commands save permanently, per repository and per command. Web fetches save per repository and per domain. Web searches save per repository. File edits do not save at all; that approval lasts until the session ends 3.
The rule lands in .claude/settings.local.json at the root of the git repository, resolved through worktrees to the main checkout. From then on it applies to any session anywhere in that repository, including sessions started in subdirectories 3.
The Bash permission prompt as shipped, with the rule it will save shown inside the option
The second option names the rule it will write. Here it is a pattern, npm test *, so no secret becomes part of it. When the prompt can only offer the literal command, the literal command is what gets saved. Screenshot from Claude Code's permission documentation.
The prompt only offers the save when it can show you everything the rule would allow, so a saved rule covers exactly what its option named 3.
That is the whole mechanism. A pattern like Bash(npm test *) carries no secret. A literal Bash(PGPASSWORD=… psql -h …) carries the password, because the password is in the command.
Two more properties matter for what follows. Rules are enforced by the harness, not by the model, so a prompt injection cannot edit them and a model upgrade cannot fix them 3. And a rule never expires. "Yes, and don't ask again" means exactly that.

Why the prompt exists, and why nobody reads it

The feature is not carelessness. It exists because approval prompts fail at the thing they are for, and Anthropic has published its own measurements of that failure 4.
Users approve 97% of permission prompts in Claude Code. The rejection rate is 3%. When Claude presents a plan for approval instead, users reject 39% of those 4.
The gap between 3% and 39% is the whole argument. People read plans and click through commands.
Anthropic then ran a controlled study with 1,053 paid professional testers. Partway through each session, one permission prompt was swapped for a clearly dangerous command. The humans approved it 86.4% of the time: they caught 143 of 1,053. The classifier caught 937 4.
Attention decayed with session length. Testers blocked about 17% of dangerous commands early on, falling to about 5% after 50 or more prior prompts. The classifier's rate stayed flat 4.
A benchmark published in October reaches the same conclusion from another direction. V³AST-Bench ran 212 risk tasks across 11 models and 5 harnesses, 86,496 trials in total. Claude Opus 4.8 inside Claude Code still caused verified harm on 20.9% of tasks, and the authors found that explicit recognition of a risk did not reliably prevent the harmful action. Agents of comparable capability produced markedly different safety outcomes, so capability did not predict safety 5.
The install base already reflects that. As of June 2026, 49.5% of active CLI users had hand-written a Bash allow rule. Inside that group, 5% allowed any shell command outright, and another 43% held interpreter rules like Bash(python:*) that amount to the same thing in practice. The share was growing about five points every five weeks. Beyond allow rules, 62% of users had used bypassPermissions or clicked "don't ask again" on Bash, and 25% of interactive sessions started in bypass mode 4.
Read those numbers as a product constraint rather than a user failing. "Tell people to read the prompt" is not a fix available to you. Anthropic's own conclusion was that human attention is the binding limit, which is why its answer was a classifier that reviews actions instead of a louder warning 6.
So the button stays. What has to change is what the button persists.

How a file on one laptop ends up on public GitHub

Claude Code does try to keep the file private. When it creates the file inside a git repository, it adds it to the developer's global git excludes, which covers that user, on that machine, in every repository 1.
Global excludes do not travel with the project. The file never enters the repository's own .gitignore, so nothing in the repo marks it as private, and a second machine, a container, or a copied folder has no protection at all 1.
Then the agent often commits it. In 539 of the 1,105 traced repositories, a commit co-authored by Claude changed the file. Those commits name every recent model from Sonnet 4.5 to Opus 5.5 1.
Once committed, the file is everywhere. Every file holding a secret sat on its repository's default branch on 2 November. In the median repository the file was first committed 217 days earlier, and in 118 repositories more than a year earlier. Forks carry it: 211 forks of 74 repositories hold the same secrets 1.
Deleting it later does not undo it. Earlier versions of the file hold 734 secrets that appear in no current copy, in 509 repositories, usually because someone removed the file 1.
One honest boundary belongs here, because the first version of the story overstated it. Clicking the button exposes nothing on its own. The file has to be committed, and the commit is what publishes it. On the Hacker News thread, the researcher conceded that a claim about a "fresh clone" committing the file was wrong, and restated it correctly: a new machine or container without the global exclude, a copied project folder, or any repository where the file was already committed 7.
That correction narrows the mechanism. It does not shrink the pile, because the pile is the outcome.

What was in the files

The composition matters more than the count, because it tells you what a bad day looks like.
The 1,122 files held 1,379 distinct secrets: 636 provider keys and 743 passwords or tokens for public hosts. More than a third open a database directly. Apiiro counts 379 database passwords and 122 Supabase service-role keys, plus 103 Supabase account tokens that control every project in an account 1.
What the leaked secrets unlock, by kind
Bar length is the count of distinct secrets of each kind across all 1,122 files. The green bars mark credentials that open a database directly. No credential was tested by the researchers, so this ranks what was exposed, not what still works. Chart from Apiiro.
The long tail is the decision-relevant part: 398 service API tokens, 149 AI model API keys, 110 Google API keys, 43 SSH logins, 42 GitHub, GitLab and npm tokens, 23 AWS keys, 6 private keys 1.
Sixty-three organizations held at least one. Apiiro names the sharpest cases at commit-pinned links: a database vendor's own cloud API key with manage access and no expiry claim, a B2B startup's production Azure Postgres password, a software agency's Square production token, an open-source project above a thousand stars carrying an OpenAI-format key, and the owner password of a medical-records database run by an IT services firm. One company confirmed its key had been live 1.
Those are not sophisticated failures. Someone typed a password into a command, approved the command, and committed a file.
The part that should worry a team with existing tooling is the scanner gap. Apiiro ran gitleaks and TruffleHog over all 104,185 files. Of the 1,122 with a real secret, gitleaks flagged 564 and TruffleHog 643. Neither flagged 215 1.
The misses are not exotic. Scanners look for known key formats. A password written after PGPASSWORD=, sshpass -p or mysql -p is an ordinary word inside an ordinary command line, and both tools let it through 1.
If the secret scanner in your CI passes a repository, that is not evidence the repository is clean. It is evidence the repository contains no well-formatted secrets.

The size of the allowlist predicts the leak

The most useful number in the research is a rate, and it is the one you can measure on your own machine.
Apiiro bucketed all 104,185 files by size. Under 500 bytes, 0.17% held a real secret. Over 8 KB, 9.9% did. Every bucket in between rose in order 1.
Share of files holding a real secret, by file size
The curve is monotonic across six buckets, and the file counts beside each bar are the base rates: most of the 104,185 files are tiny and clean. Read the top bar as a description of what a long-lived allowlist turns into, not as a typical file. Chart from Apiiro.
The interpretation is plain. Each saved rule is one command the developer once used. A small file is a new user. A large file is a developer who has been approving for months, and the probability that at least one of those commands carried a credential rises with every rule.
This gives a team two things. A triage threshold: a repository whose local settings file is over 8 KB deserves a read this week. And a proxy metric for any agent product you ship: average number of persisted rules per user, tracked like any other growth number, because it is a good predictor of your breach probability.

One vendor's buttons, everyone's problem

Claude Code is not uniquely badly built here. It is unusually easy to measure, and the measurement caught it first.
Apiiro compared how 16 coding agents store approvals, working from each vendor's own documentation. Claude Code is the only one confirmed to write the full approved command into a project file by default 1.
The behavior had been reported before. An issue filed in August 2025 described approved commands being stored word for word with API keys and tokens inside them. An automated bot closed it in January 2026 without a reply, and the researchers say three of the four related reports were closed the same way 8.
The problem is older than this study. In February 2026 a security engineer noticed he had committed his own .claude/settings.local.json, and that it held his whitelisted commands complete with the secrets inside them. He wrote a scanner and found sensitive material in the history of about 2.4% of repositories containing AI tool configuration directories, on a 100-repository sample, with findings verified against the providers rather than guessed from entropy 9.
The pattern also outgrew the file. GitGuardian's write-up collects the failure mode that makes cleanup so hard: asked to remove a secret, an agent typically removes it from the latest commit and leaves it one commit earlier. A GitHub search for commit messages like "redact exposed client secret" returned roughly 124,000 results where the secret was still one commit back, and a message announcing the danger is a signpost to where it sits 10.
And the same secret shows up in every other place an agent keeps state. Apiiro checked the shared .claude/settings.json that teams commit deliberately, and found 298 files with a real secret out of 76,011. Agent chat transcripts held 120 secret-bearing files across 87 repositories. Memory files held 9. Handoff and deploy notes held 33, a third of them written by the agent itself. VS Code Copilot auto-approve settings held 9. Outside GitHub, 126 of 31,053 Hugging Face Spaces carry the file, and 2 of 69 public copies on GitLab.com held a secret 1.
A separate study measured the transcript half of this independently. Running over 45 real coding-agent sessions, covering 102,233 records and 20,577 tool executions, its authors found 1,326 records across 16 sessions containing credential-like strings 11.
Demand for the button is systemic too. A study of 1.53 million agent skills, instruction packages an agent loads on demand, found that about one in seventeen, roughly 88,000 skills, contains a line telling the agent to skip an approval: proceed without asking, pass --no-verify, keep working without checking in. Seven in ten of those lines apply unconditionally rather than only inside CI. Skills that run shell code, install packages or use sudo carry 1.7 to 1.8 times the odds of containing one, and they do not compensate with more tightening elsewhere. Public skill scanners caught at most 46% of the directives they were tested against 12.
That is the part worth carrying into a roadmap conversation. The file is not the bug. The file is one instance of a class: agent harnesses now write durable state to disk as a matter of course, and every one of those write paths is a place secrets and identity can settle.

The same week, the same shape, a different artifact

A different Claude Code artifact was doing something similar, and this one had nothing to do with git.
A developer filed an issue on 5 November titled "Privacy violation in User-Agent header". His complaint: Claude Code had been putting his account email into the User-Agent header of web requests made during searches, so third parties were receiving an address that later attracted scam mail. The issue has since drawn 987 reactions and 106 comments, and it remains open 13.
An engineer on Claude Code answered the next day, in public, and the explanation is the interesting part.
Users had reported that Claude hallucinated names for things like @author tags, because it had no context about the signed-in account. The team fixed that by putting the account email into the model's context. Then, when Claude wrote a command itself, such as a curl call, it sometimes put that email into the User-Agent as a contact address, because some sites ask agents to supply a contact 2.
Read that sequence against the first incident. A real user-experience defect. A fix that put durable state where it had not been. A downstream leak nobody was watching for, because the fix was reviewed as a context change and the leak happened in a tool call.
The remediation is partial and worth tracking. Releases from 2.1.317 carry a built-in mod, on by default, that asks before Claude runs a web or curl-style command containing the email. It does not cover every case, notably a script Claude writes and then runs on its own. The permanent fix, removing the email from the model's context, is slated for a release the engineer expected early next week. The stable channel was still on 2.1.311 at the time of that reply 2.
Four minutes of walkthrough for anyone who wants the file story before the analysis:
Loading content card…

The artifact inventory

The useful output for a PM is not a warning. It is a list of the places your product or your team writes state down, with the travel path and the lever for each.
ArtifactWhat it holdsHow it travelsDesign lever
Permission allowlistThe literal approved command, credential includedCommitted by the agent; then clones, forks, history, images, archivesPersist a pattern, never the invocation
Shared project settingsTeam-committed allow rulesCommitted on purpose, read by everyoneReview it like code; assume it is public
Agent transcriptsWhole conversations, commands and outputCommitted or exported by usersExclude by default; redact on export
Agent memory filesNotes the agent wrote for itselfCommitted with the projectTreat as a .env, not as documentation
Handoff and deploy notesAgent-written runbooksCommitted, often by the agentScan on write, not on push
Model contextAccount identity, org, repo visibilityEvery request, and into tool calls the model writesKeep identity out of anything that can reach the network
IDE auto-approve settingsTool permissionsCommitted or syncedOne policy across every harness
Two lists follow from the table, one for this week and one for the roadmap.
Check today, in this order. Rotate first, because deleting a file does not clear history, forks or clones; Apiiro's own sequence puts rotation before cleanup 1. Then search every repository for both settings files, including history where the file is already gone. Untrack the local file with git rm --cached and add it to the repository's own .gitignore. Open the file on each laptop and delete every rule containing a secret. Rewrite any command that needs a credential to read $DB_URL from a secrets manager, so the rule records the variable name. Approve patterns rather than single commands.
Then test the scanner, not the repository. Run your existing tool over a file containing PGPASSWORD= and see whether it fires. If it does not, it will not catch the most common case in this dataset 1.
Design rules, if you ship an agent. Persist the rule and not the invocation, and give the user the pattern form by default. Scan the string before it is written and refuse to store a rule that matches a secret shape, because asking the human to notice is a control Anthropic's own data says will not hold. Put protection in the project rather than on the machine, since machine-level settings do not survive a clone or a container. Make the artifact reviewable: a count of saved rules, a diff of what the last approval wrote, and a view filtered to rules containing credentials. And assume the artifact is public, because the base rate says some of them will be.
Anthropic's engineering lead said on the thread that the team is prototyping approaches, including basic secret scanning, and will decide after testing them 6. Every harness vendor now has the same decision to make, and the ones who do not make it will be measured next.

What would change the answer

Five unknowns would move the plan.
What the scanning actually scans, and whether it blocks the save or warns after it. A warning does not help a user who approves 97% of prompts 6.
Whether the email fix lands on the timeline given, and whether removing identity from context closes that class or merely relocates it 2.
Whether the 1.1% rate falls once harnesses change, or whether the population simply grows faster. Apiiro's own data is a snapshot from one to three November, and a second census on the same method would settle this 1.
What pattern-level rules cost in prompts. Narrower rules match less, so more prompts return, and more prompts mean more clicking. Nobody has published that trade-off, and it is the constraint that decides how far the design fix can go.
Whether any other harness ships the same default. Sixteen were compared from documentation; a runtime test of each would turn a documentation finding into a measurement 1.
Four questions carry the decision. Which of these artifacts does your product write, and who would notice if one of them contained a password? What does your agent store so that it will not have to ask again? Which of your security tools actually reads a password inside a command line? And what is your average persisted-rule count per user, this week, compared with last quarter?

References

  1. 1
    Coding Agents Copy Your Secrets to a Hidden File, Apiiro

    apiiro.com

  2. 2
    Anthropic engineer on the User-Agent report, Hacker News

    news.ycombinator.com

  3. 3
    Configure permissions, Claude Code

    code.claude.com

  4. 4
    Auto mode is now the default in Claude Code, Anthropic

    claude.com

  5. 5
    V³AST-Bench, arXiv:2610.35188

    arxiv.org

  6. 6
    Boris Cherny on the threat model, Hacker News

    news.ycombinator.com

  7. 7
    Discussion of the Apiiro research, Hacker News

    news.ycombinator.com

  8. 8
    Approved bash commands containing credentials stored in settings.local.json, anthropics/claude-code

    github.com

  9. 9
    Leaking secrets from the claud, ironPeak

    ironpeak.be

  10. 10
    AI Is the Newest Developer To Misunderstand Secrets In Your Git History, GitGuardian

    blog.gitguardian.com

  11. 11
    Soei, arXiv:2610.39468

    arxiv.org

  12. 12
    When Skills Tell Agents Not to Ask, arXiv:2610.37734

    arxiv.org

  13. 13
    Privacy violation in User-Agent header, anthropics/claude-code #107757

    github.com

Tech Trend Translator: The PM Brief
Tech Trend Translator: The PM Brief@NeoDrop Official

This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.

Related content

  • What the button actually writes
  • Why the prompt exists, and why nobody reads it
  • How a file on one laptop ends up on public GitHub
  • What was in the files
  • The size of the allowlist predicts the leak
  • One vendor's buttons, everyone's problem
  • The same week, the same shape, a different artifact
  • The artifact inventory
  • What would change the answer
Click to open on YouTube