1,122 Public GitHub Files Contain Real Passwords and Keys. Claude Code’s “Don’t Ask Again” Approval Saved Them
On November 5, security company Apiiro published an analysis of the configuration files that Claude Code, Anthropic's coding agent, leaves inside projects. Of 104,185 public copies of the .claude/settings.local.json file, 1,122 contain at least one real password, key or token. On November 9, GitGuardian, another security company, published its own measurement of the same file: 5,343 secrets worked at the moment they were found. An AI coding agent remembers what you approved. If the approved command contained a password, it remembers that too, in plain text, in a file that can end up in the repository.
The "don't ask again" approval saves the command exactly as written, password included
Claude Code asks for permission before it runs a command in the terminal. The developer can answer "Yes, and don't ask again", and the approval becomes a permanent rule for that project. The official documentation says where the rule goes: into .claude/settings.local.json, the local settings file at the root of the project, meant to stay on the developer's machine.
The rule is saved verbatim. If the developer approved a database connection command with the password typed into it, the password goes into the file. Once the file lands in a commit and the repository is public, the password is visible to anyone.
The problem is not new. A user reported it on GitHub in August 2025. The report was closed automatically in January 2026, labeled "not planned", after 60 days of inactivity and with no reply from Anthropic in the thread. Apiiro counts four such reports since August 2025, none answered by Anthropic.
379 database passwords, 23 AWS keys, 215 files missed by both scanners
The 1,122 files Apiiro found, roughly 1% of the public copies, hold 1,379 distinct secrets. Among them: 379 database passwords, 43 SSH logins, 42 tokens for GitHub, GitLab and npm, and 23 AWS keys. Most files belong to individual developers, but the owners also include 63 organizations, from student groups to established software companies.
Two widely used open-source scanners, gitleaks and TruffleHog, flagged 564 and 643 of the files respectively. Another 215 got past both. The reason is simple: scanners look for known key formats. A password typed after PGPASSWORD= in a command looks like any other word.
GitGuardian tested the secrets: 5,343 worked when they were found
Apiiro counted what is exposed right now and did not test whether the secrets still work. GitGuardian scans public commits continuously and counted everything that passed through the file from January 2025 to November 7, 2026, including versions deleted since: 31,088 distinct secrets across 23,276 repositories. GitGuardian's automated check found 5,343 of them valid, or 17%. The figure is a floor, because some types of secrets cannot be checked automatically.
The two counts answer different questions. 1,122 files is what is exposed today. 31,088 secrets is everything that ever went into the file and should have been changed. The figures do not add up. Likewise, the figure of 2,539 secrets from Apiiro's report, which is also circulating, includes older versions of the file, the team's shared settings file and saved conversation logs.
The file also leaves GitHub. The COPY . . instruction, common when building Docker images, copies the whole project folder, including files git ignores. GitGuardian found 613 secrets in public Docker Hub images, 99 of them valid. A single valid Cloudflare token appears in 559 versions of the same image.
New cases peaked in April 2026, at 12,535 occurrences a month, and fell to 959 in October. GitGuardian says it does not know what caused the drop. Worth stating plainly: Apiiro and GitGuardian both sell code security products, the very category of solution their conclusions point to.
Anthropic says the files were created manually. The data shows rules written by Claude Code's approval prompt
Claude Code does have a safeguard. The first time it writes the file, it adds it to the developer's global git excludes, the rule on their machine that keeps certain files out of commits in every project. Boris Cherny, head of Claude Code, wrote on Hacker News that, for this reason, the files found had in his view been created manually and committed. He added: "Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this."
The safeguard has limits. The global rule does not cover a folder that becomes a repository later, a clone on another machine, or a file that was already committed. In 539 of the 1,105 repositories Apiiro traced, a commit co-authored by Claude modified the file. GitGuardian found 263 repositories where the commit carrying the secret has Claude's own address as its author, meaning Claude Code made it on the user's behalf. And in the roughly 3,000 occurrences GitGuardian inspected, every secret sat in an approval rule, in exactly the shape Claude Code writes when you choose "don't ask again". As of November 10, Anthropic had not announced a product change.
The risk applies to any agent that remembers what you approve
Apiiro compared the documentation of 16 coding agents. Claude Code is the only one confirmed to save the full command in a project file by default. GitGuardian counted the configuration files of 30 agents on GitHub and found secrets in all of them. For the others, the secrets come from keys placed in the configuration of MCP servers, the connectors through which an agent reaches other applications. Passwords typed into approved commands dominate only the Claude Code file.
Secrets also sit in other files agents leave in a project. Apiiro found secrets in conversation logs, in agent memory files and in VS Code's Copilot auto-approve settings. GitGuardian found 6,155 secrets in CLAUDE.md files, the instructions developers write for the agent, 2,537 of them valid.
On September 29 we wrote that an instruction in a prompt is not a security control. On October 13, that a blocked agent may look for a workaround on its own. This case is more mundane. The agent does exactly what it was asked, and the trace stays behind in a file nobody reads.
What to check in your company's projects
If someone writes code for your company, an internal team, a freelancer or an agency, and uses AI coding agents, ask them to check:
- Where
.claude/settings.local.json,CLAUDE.mdand other agents' similar folders exist, across all repositories, including git history and published Docker images. - Rotation of every credential found, before any cleanup. Deleting the file does not remove the password from history, from forks or from images already published.
- Removing the file from git and adding it to the project's own
.gitignoreand.dockerignore, so the rule travels with the repository to any machine. - Approvals on command patterns, such as
npm run:*, instead of exact commands with parameters. - Secrets used only as environment variables, such as
$DB_URL, plus automated secret scanning on the repository that also catches passwords typed into commands.
An AI coding agent works with the same keys as the person who started it. For an operational AI agent the rule is the same: secrets stay outside the code, the agent gets access limited to the task, and whatever the agent remembers is reviewed like any other code.
Sources: ↗ Apiiro — the research (Nov. 5) · ↗ GitGuardian — valid secrets and Docker Hub (Nov. 9) · ↗ The Hacker News (Nov. 7) · ↗ iTnews — Anthropic's response (Nov. 9) · ↗ Claude Code documentation — permissions · ↗ Claude Code documentation — settings · ↗ GitHub — the August 2025 report
See how we build MassAI agents →