Apiiro finds 1,122 public GitHub files holding real secrets saved by Claude Code's 'Don't Ask Again' rules
- Apiiro found 2,539 real secrets in 1,994 public GitHub repositories, including a database vendor's own admin-level cloud key with no expiry, a production Azure Postgres password, a Square production token, and a medical-records database owner password; 63 organizations are affected and one confirmed its key had been live.
- Of 104,185 public copies of
.claude/settings.local.json, 1,122 contain a real secret, and another 1,160 turned up in git history, in the sharedsettings.jsonteams commit on purpose, and in agent chat transcripts saved in repos. - The mechanism is Claude Code's own behavior, not the model's: clicking 'Yes, and don't ask again' saves the exact command string, secret included, as a permission rule, and Claude Code adds the file only to the developer's global gitignore, never the repo's
.gitignore, so a fresh clone or second machine commits it. - In 539 of the 1,105 traced repos with a real secret, a commit co-authored by Claude itself changed the file, with commits naming every recent model from Sonnet 4.5 to Opus 5.5.
- One in five of the 1,122 files is flagged by neither gitleaks nor TruffleHog, usually because the secret is a password typed inside a command; TruffleHog, which the Shai-Hulud npm worm ran over victims' files, flags 643 of them.
Hacker News 의견들
The post says search your org for these files and each hit is a file anyone can read right now. That's not the same as public though, it depends on whether the repo is public or private. Am I missing something?
Fair point, and our 1,122 files are all in public repos. But in a private repo the password still gets written into a project file that gets committed, so it spreads with every clone and fork and goes public the day the repo does.
Even in a private repo, you probably don't want every developer in the company holding the production SQL password.
The headline is confusing. They scanned repos where people committed their .claude folder, then scanned those files for approved commands that had keys or passwords typed into them. Pressing don't ask again on its own doesn't expose anything.
That's the chain, yes. The part people don't expect is that the file is created inside the project and Claude Code only adds it to your global gitignore, not the repo's .gitignore, so a fresh clone commits it like any other file. In 539 of the 1,105 repos we traced, a commit co-authored by Claude itself changed the file.
This page repeats itself for 80 percent of its length. If you post output from an AI, edit it before publishing.
Don't edit AI garbage, use the AI as an editor that points out your mistakes instead.
Vibe coders don't read the slop code and leave agents in autonomous loops, so of course Claude leaked their env vars. This is closed source malware and you have no idea what it does internally.
That's overblown. Claude Code didn't publish anything, users committed their settings to public repos. The same thing happens with an open source harness.
Devs have been leaking secrets in public repos long before any of this. There are just more people with commit power now, which statistically means more leakage.
If you really need to commit private files, look at Turbocrypt.
Or git-crypt, it's been around for over a decade.
Boris from the Claude Code team here. settings.local.json is meant to stay local and we gitignore it automatically when Claude creates the file, so these were manually created and checked in. Permission rules are old hat, everyone should use auto mode instead, and you should have secret scanning enabled regardless of which agent you use.
Appreciate the fast response, but wouldn't Claude Code's auto-review of tool calls already catch this 99 percent of the time? A harness-side fix here is just saving the user from themselves.
Auto mode can't be called safer than anything because it doesn't even attempt to guarantee security. The threat model isn't defined, so it can't be compared to anything except full access.
It still happens in auto mode, since it asks for sensitive commands and the default is always allow, which saves the rule.
Meanwhile auto mode keeps refusing perfectly safe commands in our environment, so we switch modes just to trigger guardrailed CI pipelines or run read-only prod queries. It's a regression from how useful this was around June.
You expect me to pay $19 per user per month for secret scrubbing? Just use awslabs/git-secrets, it's free.
Put the file in ~/.config/git/ignore and teach Claude not to git add dot. While we're at it, stop using -f with rm.
Saying auto mode is safer without bundling proper sandboxing is wild. Nobody should run auto mode anywhere they wouldn't be fine with everything being approved.
It doesn't matter that the file should stay local. You don't write secrets to files, ever, and especially not without the user knowing. As a sysadmin this is a wake up in a cold sweat nightmare, because the next npm worm will scan exactly there first.
That's buck passing. Anyone who didn't ask Claude to create the project can leak a password, and 1,122 known customers were hit. It's existing functionality and entirely foreseeable, so own the mistake.
Getting Claude to leave .env alone takes more hoops than it should. Allow .env.example but not .env.* should be the default, and a simple .agentignore would be even better. The agent supervising itself is a bad answer for compliance.