November 7, 2026 · Updated November 8, 2026

Researchers Found Credentials in 1,122 Public Claude Code Settings Files

Correction — November 8, 2026: An earlier headline for this article read "Claude Code Leaked 1,122 Secrets to GitHub." That was inaccurate: 1,122 is the number of public settings files that contained at least one real secret, not the number of secrets. Those 1,122 files held 1,379 distinct credentials, and the wider investigation found 2,539 distinct secrets across 1,994 repositories. The headline has been corrected; the article body was already accurate.

Researchers Found Credentials in 1,122 Public Claude Code Settings Files

One click. That is all it took to put a production database password on public GitHub — not a hack, not a phishing email, not a misconfigured server. A developer clicked "Yes, and don't ask again" in Claude Code, Anthropic's AI coding agent, and the tool saved the approved command, word for word, into a project file. The password was inside the command. The file was committed. The secret went public.

Security firm Apiiro published the research on November 5, 2026, and the numbers are hard to ignore. The researchers searched public GitHub and found 104,185 copies of the file in question, .claude/settings.local.json. Of those, 1,122 copies — about 1.1 percent — contained at least one real secret, holding 1,379 distinct credentials between them. When the researchers widened the net to git history, the shared settings file, and saved agent chat logs, the total reached 2,539 secrets across 1,994 repositories. Sixty-three organizations were affected, mostly software companies.

How one click saves your password

Claude Code asks permission before it runs a shell command. When you approve a command and choose "Yes, and don't ask again," the tool stores that approval so it can run matching commands later without asking you again. The problem is what it stores: the complete command, exactly as approved — including any password, token, or key typed into it.

That approval is saved as an allow rule in .claude/settings.local.json, a file inside the project folder. The file is meant to stay on your machine. It holds personal, per-developer settings, not something a team shares. But it sits inside the project directory, right next to the code, and that is where the trouble starts. If the file gets committed and pushed, everything in it goes with it — including the secret.

The researchers reproduced the behavior with the Opus 5.5 and Fable 5.1 models, and they note that this is Claude Code's own behavior, not the model improvising. They also compared the documentation of 16 coding agents and found Claude Code was the only one confirmed to write the full approved command to a project file by default.

What Apiiro actually found

The exposed credentials were not test keys and toy examples. According to the research, they included a database vendor's own admin-level cloud key, a production Azure Postgres password, a Square production token, and the owner password for a medical-records app's database. More than a third of the secrets opened a database directly, including 379 database passwords and 122 Supabase service-role keys. The haul also included 43 SSH credentials for public servers, 42 GitHub, GitLab, and npm tokens, and 23 AWS keys.

Apiiro did not test the credentials it found, so "real secret" in the research means a value that matches a known key format or sits beside the address of a public server — not a credential proven to still work. But the researchers notified affected organizations on November 2 and 3, and one company confirmed its exposed key had been live. That single confirmation is enough: at least one of these secrets was a working key to a real system.

Just as worrying is how long the exposure lasted. In the median leaking repository, the file had first been committed 217 days before Apiiro's November 2 snapshot — roughly seven months. As of that Monday, every file containing a secret was still sitting on its repository's default branch. And deleting the file does not undo the damage: older versions in git history held another 734 secrets across 509 repositories, and forks keep copies alive even after the original is cleaned up.

Why the safety net did not hold

Claude Code does have a safeguard. Its settings documentation says that the first time it writes the file in a git repository, it adds the file to the developer's global git excludes, so it stays out of commits. On paper, that should have prevented this entirely. In practice, it failed in more than a thousand repositories.

Part of the answer is in the commit history. In 539 of the 1,105 leaking repositories Apiiro traced, a commit co-authored by Claude had changed the settings file. In other words, the agent itself was often the one touching the file — and a global exclude on one machine does nothing when the file is already tracked, when the work happens on a different machine, or when a developer force-adds it without noticing what is inside.

The shared settings file is a second leak path. A separate open bug report says approvals are sometimes written to the shared .claude/settings.json instead — the file teams commit on purpose. Apiiro found secrets in 298 of the 76,011 public copies of that file. A safeguard that depends on the file staying local cannot protect a secret that lands in the file meant to be shared.

There is also the human side. This was reported early. A GitHub bug report filed on August 11, 2025, already warned that approved commands with API keys and tokens were being stored word for word in the settings file. Apiiro cites four such reports, and says none received a reply from Anthropic. Three were closed automatically as inactive or duplicates, and the most recent was closed by the same bot the day before the research was published. The warning existed for more than a year before anyone outside the researchers counted the damage.

Why your scanner probably missed it

Many teams assume a secret scanner in their pipeline would catch this. The research says otherwise. Apiiro ran gitleaks and TruffleHog over the leaking files, without the tools' verification step. Gitleaks flagged 564 of the 1,122 files. TruffleHog flagged 643. Neither tool flagged 215 of them — nearly one in five.

The misses happen because these secrets often do not look like the textbook examples scanners are built to recognize. A database password typed into a command line is just a string beside a hostname. It has no tell-tale prefix, no standard format, no label that says "I am a secret." Pattern matching catches the obvious keys and misses the ordinary-looking ones — and ordinary-looking passwords are exactly what open databases.

That is a lesson I carry from security work: a control that catches most problems is not the same as a control that catches the problem. If your defense is one scanner at the end of the pipeline, a secret that does not match a pattern walks straight past it.

What this looks like from a security post

On a guard post, a credential is a key. If a key is copied and handed out, you do not argue about whether anyone used it — you change the locks. The same thinking applies here. A password that sat in a public repository for 217 days has to be treated as compromised, whether or not anyone can prove it was used. Apiiro did not check whether the credentials were used, and that uncertainty is the point: nobody can prove they were not.

The other parallel is the habit behind the leak. The developer did nothing malicious and nothing unusual. They typed a password into a command because that was the fastest way to get the job done, and they clicked "don't ask again" because being asked every time is annoying. Security failures usually look like that — a small convenience, repeated a thousand times, until one of them lands in public. The fix is not to blame the developer. It is to build a workflow where the convenient path is also the safe one.

What to do if you use Claude Code

If you or your team use Claude Code, treat this as an incident check, not a news story to scroll past. Start by searching your GitHub organization for .claude/settings.local.json and .claude/settings.json in every repository, public and private. Check the current files and the git history — remember that deleting the file leaves the secret in older commits.

Any credential you find in one of those files should be rotated immediately: change the password, revoke the token, issue a new key. Do not wait to confirm whether it was used. A key that was public for months is a key you cannot trust, and rotation is cheap compared with explaining a breach.

Then remove the file from version control and from history. Untrack it, add it to your repository's .gitignore so it cannot be committed again, and purge it from past commits if the history contains secrets. Check forks too — a fork keeps a copy of everything, including the history you just cleaned.

Going forward, keep secrets out of command lines entirely. Use environment variables or a secrets manager so a password never appears as plain text in a command the agent can save. Add pre-commit scanning with more than one tool, and remember that scanning is a backstop, not a guarantee — the 215 files neither scanner caught prove that. The real defense is never letting the secret reach the file in the first place.

If you manage a team, make this an explicit rule: no credentials in terminal commands, no exceptions for "just this once." Put it in the onboarding notes, and check for the settings files in your next repository audit. The developers who leaked these secrets were not careless people. They were busy people using a tool the way it invited them to use it — and the tool saved their passwords.

The takeaway

A convenience feature became a credential leak because the safe path was not the easy path. One click told Claude Code to remember a command forever, and it remembered the password inside it too. The research counts 1,122 public files, 1,379 secrets, and 2,539 secrets in the wider net — but the number that matters is the one nobody can count: how many of those keys were used while they sat in public for months. Rotate what you find, clean the history, and keep secrets out of the command line.

Sources: Apiiro — Coding Agents Leaking Secrets on GitHub (research published November 5, 2026); madrobot.blog — Claude Code "Don't ask again" left secrets in 1,122 GitHub files; Cybernoz — Claude Code's "Don't Ask Again" File Exposes Passwords and Keys in 1,122 Public Copies on GitHub; Cybersecurity News — Claude Code's "Yes, and Don't Ask Again" Option Can Leak Passwords and API Keys to GitHub.

For more on keeping your accounts locked down, see my password security checklist — six steps to lock every account in about 30 minutes.

Follow along at toukirislam.com for more security and tech news — or reach me via the contact page.

Toukir Islam is a Florida-licensed security professional (Class G Armed, Class D Unarmed) and TWIC holder working as a Security Officer with Allied Universal. He writes about asset protection, loss prevention, and security operations from real post experience, and is studying Criminal Justice at FIU. About · CV / Resume