Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding

Apiiro: 1,122 Claude settings files leak secrets

Written November 9, 2026

Clicking "Don't Ask Again" in Claude Code can save the exact command you approved — password included — into a file inside your project. Apiiro found 1,122 public copies of that file holding a real secret. Rotate first, then clean up.

The problem

Claude Code asks before it runs most shell commands. Pick "Yes, and don't ask again" and it saves an allow rule in .claude/settings.local.json inside the project, so matching commands run without asking in later sessions. Sometimes the rule is a pattern, such as npm test *. Sometimes it is the one exact command Claude offered — and if you typed a password or API key into that command, the secret is saved too, in plain text.

That file is meant to stay on your machine. Claude Code tries to keep it out of git: the first time it writes the file in a repository, it adds it to your global git excludes, so git on that computer ignores it in every repository. But the protection stays in one person's git settings on one computer. It never goes into the project's own .gitignore, so it does not travel with the project — and it does nothing for a file that was already committed.

What Apiiro found

Apiiro's report, published November 5 by Shmulik Cohen and Matan Giladi, searched public GitHub between November 1 and 3. The numbers below are Apiiro's, from that report:

What was countedFigure
Public copies of .claude/settings.local.json examined104,185, in 103,617 repositories
Copies holding at least one real secret1,122 (about 1.1%), holding 1,379 distinct secrets
Database passwords among the secrets379
SSH logins for public servers43
GitHub, GitLab and npm tokens42
AWS keys23
Organizations holding a secret in a public file63
Total secrets including git history, shared settings and agent transcripts2,539, across 1,994 repositories

A value counted as a secret when it matched a known key format, or when a password or token sat beside the address of a public server, and an AI reviewer also had to agree. Apiiro did not test whether any of the credentials still work, so the count is a measure of exposure, not of confirmed compromise. One company the researchers notified confirmed its exposed key had been live. No use of any secret by anyone else is reported.

Two details make the count a floor rather than a ceiling. Older versions of the file hold 734 more secrets across 509 repositories that no current copy holds, usually because the file was deleted — and deleting the file does not remove it from git history. Forks spread the files further: 211 forks of 74 repositories carry the same secrets as the originals. Every file with a secret was still on its repository's default branch when Apiiro collected the data, and in half of those repositories it had been there for at least 217 days.

Apiiro also found secrets in 298 of 76,011 copies of the shared .claude/settings.json file, which teams commit on purpose, mostly inside allow rules. And in 539 of the 1,105 repositories the researchers traced, a commit listing Claude as a coauthor had changed the settings file — Apiiro reads that as Claude often committing the file itself.

What to do

Apiiro's advice, in order:

  1. Rotate first. Change every password, token, and key the file has ever held, before cleaning anything up. Deleting the file does not undo the leak: older versions stay in git history and in forks.
  2. Search your organization. Search GitHub for .claude/settings.local.json and .claude/settings.json, and check each repository's git history for them, even where the files are gone.
  3. Stop tracking the local file. Run git rm --cached .claude/settings.local.json and add the path to the repository's own .gitignore, so the protection travels with the project instead of living in one person's git settings.
  4. Open the file on your own computer. Even if it was never committed, open it and delete every rule that contains a secret. The file is plain JSON in the project folder, and copies can also sit inside an npm package, a Docker image, a zip archive or a synced folder.
  5. Keep secrets out of commands. Refer to them as variables from a secrets manager, such as $DB_URL, so the saved rule holds the variable name and not the secret.
  6. Approve patterns, not single commands. A pattern such as Bash(npm run:*) cannot carry a password the way one exact command can.

What scanners miss

Do not trust a clean scanner report on this file. Apiiro ran gitleaks and TruffleHog over every copy without the tools' verification step: of the 1,122 files with a secret, gitleaks flagged 564 and TruffleHog 643, and neither flagged 215. Most misses are passwords typed inside commands — a password after PGPASSWORD=, sshpass -p or mysql -p looks like an ordinary word in an ordinary command line, not a key in a recognizable format. Apiiro also compared the documentation of 16 coding agents and reports Claude Code as the only one confirmed to save the full approved command in a project file by default. It reproduced the behaviour with Opus 5.5 and Fable 5.1, so the model in use makes no difference.

For security teams, Apiiro recommends treating agent folders such as .claude/, .cursor/, .gemini/ and .specstory/, and agent memory files, as holding secrets, like .env files — on laptops as well as in repositories — and adding them to pre-commit and CI secret scanning, including git history, with a scanner that catches passwords inside commands.

Limits

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Check every package name your agent invents · Audit apps that installed agent plugins for you · MCPhantom: agents install dead MCP servers