DAGet the newsletter
Ethics and safety

Over 1,000 public GitHub repositories stored secrets that users approved in Claude Code

When you press "yes, and don't ask again" in Claude Code, the command is saved to a local file. If it contains a secret, it can end up public on GitHub. Security firm Apiiro found more than 1,000 files with secrets.

November 22, 2026, 18:38AI-generated from the sources listed, with automated source checks.

Photo: Rrustema / Wikimedia Commons, CC0

It starts with a small shortcut. When Claude Code, Anthropic's AI coding tool, wants to run a command on the computer, the user can choose "yes, and don't ask again." That way, you don't have to approve the same thing next time.

The problem is what gets saved. According to The Hacker News, the entire approved command is written as a rule in the file .claude/settings.local.json in the project. If the command contains a password or a key, it is stored in plaintext, meaning without encryption. If the project is later pushed to GitHub, the file goes with it.

Over 1,100 files with secrets

Security firm Apiiro searched public GitHub repositories (folders of code). According to the Cloud Security Alliance (CSA), which summarized the study, they found 104,185 copies of the file in 103,617 repositories. In 1,122 of them, about 1.1 percent, at least one secret was present. In total, there were 1,379 distinct secrets.

According to The Hacker News, they included 379 database passwords, 43 SSH logins for public servers, 42 tokens for GitHub, GitLab and npm, and 23 AWS keys. When git history and shared settings files are included, Apiiro arrives at 2,539 secrets in 1,994 repositories, with credentials from 63 organizations.

CSA notes that the common scanners Gitleaks and TruffleHog together missed 215 of the 1,122 files, because secrets inside commands are hard to recognize. The median time the secrets remained on the main branch was 217 days.

An even larger figure from another analysis

A separate analysis from GitGuardian, cited by CSO Online, found 31,088 distinct secrets in 23,276 repositories. Of those, 5,343 were valid when they were found. The figures are not directly comparable to Apiiro's, because the methodology and underlying data differ. Occurrences peaked in April 2026 and fell to 959 in October.

Anthropic's response

A bug report about plaintext storage was submitted in August 2025 and closed as "not planned" in January 2026 without a response from the maintainers. According to The Hacker News, four related reports were closed by the same bot without a response from Anthropic.

Anthropic did not immediately respond to CSO Online. GitGuardian says that Claude Code head Boris Cherny has acknowledged the problem and said the company is investigating it and considering additional safeguards, including built-in scanning for secrets and an auto mode.

What can you do?

CSA recommends replacing all passwords and keys the files have ever contained before cleaning up. Use environment variables instead of embedded secrets, scan the entire git history, and add agent folders to .gitignore so they don't get pushed.

Apiiro did not test whether the secrets it found still work, and CSA has not repeated the search itself.

Sources

Found via Online Tech Tips

Read also

Next storyGemini agents can now keep tools on standby and save spaceRead on
Back to the front page