2026-11-26 15:49 UTC

Apiiro reports 2,539 secrets in public coding-agent files

state: significantheat: lowuncertainty: mediumrelevance: highcoding-agent-security secret-exposure claude-codeApiiroShmulik CohenMatan GiladiAnthropic

What is this?

On November 5, 2026, Apiiro researchers Shmulik Cohen and Matan Giladi published a report on credentials in public coding-agent files. Apiiro says that when a Claude Code user chooses “Yes, and don’t ask again” for a command, Claude Code can save the command verbatim—including any embedded secret—in the project’s `.claude/settings.local.json` file. Apiiro examined 104,185 public copies and classified 1,122 as containing at least one real secret; its broader count, including file history and other agent-related files, was 2,539 distinct secrets across 1,994 repositories. These are Apiiro’s findings, not independently verified here: its researchers did not test whether credentials worked, though they say one company confirmed its key had been live. The report says conventional scanners missed some password-in-command cases. The supplied Hacker News item links the report; search results provide secondary coverage, but no Anthropic response or fix is included.

Why it matters

The case remains highly relevant: it describes a concrete credential-exposure path in coding-agent workflows and a possible blind spot in existing scanning. The newer, unsubstantiated count adds a claim to track, not reliable evidence that the scale is larger.

Current assessment

Apiiro’s November 5 report says it found 1,122 of 104,185 public `.claude/settings.local.json` copies containing credentials, and 2,539 distinct secrets across 1,994 public repositories when including histories and other agent-related files. It attributes one exposure path to Claude Code saving a command verbatim after a user selects “Yes, and don’t ask again.” Apiiro says common scanners missed some password-in-command cases; it did not test whether credentials remained valid, though it reports one organization confirmed a key had been live. These are Apiiro’s findings, not an independent audit, and the supplied evidence contains no confirmed Anthropic fix or remediation. A later Hacker News title claims 31,088 secrets in public Claude Code settings files, but provides no source or methodology here; treat it as unverified, not a replacement for Apiiro’s count. Discussion and engagement have largely cooled, and repeated posts add no new substantiated findings.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 451h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-07 21:24 (minted)⭐ origin echo-reconstructedApiiro says its research found real credentials in public coding-agent files, including Claude Code permission settings that can record secr
Shmulik Cohen, Matan Giladi on blog (echo) · attributed from hn.story.50407882 · published time unknown
—
11-07 20:45first on hacker news · published · lag ?Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files
shmulc
—
11-07 20:45amplified on hacker news 👑hn.story.50407882
shmulc
peak 629 · 424 comments · 99% of case engagement
11-09 14:14amplified on hacker newshn.story.50425934
guedou
peak 4 · 1 comments · 0% of case engagement
11-11 01:40amplified on hacker newshn.story.50448813
Gaishan
peak 6 · 1 comments · 1% of case engagement
11-07 21:21our radar first saw it · lag ?discovery anchor: hn.story.50407882—
pace: p95 vs 1845 stories at the 336h mark (now 451h old) — ahead of deepseek-dsh-superagent-prototype (1.0x), behind kitten-tts-2-ternary-release (1.0x)

Evidence (4) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnClaude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files
Retrieved article excerpt

Open article · Retrieved 2026-11-07T21:23:46.099503+00:00

*Apiiro research found 2,539 real secrets in 1,994 public GitHub repositories: database passwords, cloud keys, API tokens, SSH root logins. Among them: a database vendor's own admin-level cloud key, a production Azure Postgres password, a Square production token, and the owner password of a medical-records database. 63 organizations, mostly software companies of all sizes, are affected. One confirmed its key had been live.*

*Ask Claude Code to check a database or call an API, and the command it proposes carries the secret from your config file. It asks before running it. Pick "Yes, and don't ask again" and it saves that exact command, secret included, to `.claude/settings.local.json` inside the project folder. Nothing in the repo marks that file as private, so it gets committed with the rest of the code.*

*Out of 104,185 public copies of this file on GitHub, 1,122 hold a real secret. We found 1,160 more in git history, in the shared `settings.json` teams commit on purpose, and in agent chat transcripts saved in repos.*

*GitHub is just where we could count. The same file sits in plain text on every laptop where someone clicked "don't ask again." Malware already collects credentials from developer machines in bulk. The Shai-Hulud npm worm ran TruffleHog over victims' files; that same scanner flags 643 of the 1,122 files we found. And one in five of those files is flagged by neither gitleaks nor TruffleHog, usually because the secret is a password typed inside a command, not a key in a recognizable format.*

## Check if you’re affected

**Is it public?** Search your GitHub organization for .claude/settings.local.json and .claude/settings.json. Each hit is a file anyone can read right now.

**Was it ever committed?** Check each repo’s git history for the file, even if it’s gone today. If history has it, so does every fork and clone.

**What's in it?** Find every copy of the file on your machine and read its allow list. Each entry is a command you approved, with whatever you typed into it: look for passwords, tokens, keys and connection strings.

**Found something:** rotate first, clean up second.

## How a secret ends up in a settings file

Developer machines hold secrets: a database connection string in a config file, cloud keys in local installations, an API token in .env. Ask Claude Code to check why login fails on staging or to run a migration, and the command it proposes carries that secret, because it can’t work without it. Claude Code asks before it runs a shell command, multiple times a session. Pick "Yes, and don't ask again" and it runs the command and adds a permission rule to `.claude/settings.local.json` in the project folder, so it won't ask again. The rule is the command string itself:

This is Claude Code's own behavior, not the model's: it happens with Anthropic's latest models too, and we reproduced it with Opus 5.5 and Fable 5.1.

The file is meant to stay on the developer’s machine, and Claude Code tries to keep it there. When it creates the file inside a git repo, it adds it to the developer's *global* git ignore list. That covers the common case. It doesn’t cover a folder that becomes a repo later, a clone on another machine, or a file someone already committed. The rule never goes into the repo's own .gitignore, so nothing travels with the project to protect it.

Often Claude commits the file itself. In 539 of the 1,105 repos with a real secret that we traced, a commit co-authored by Claude changed the file. Those commits name every recent model, from Sonnet 4.5 to Opus 5.5.

## Who is exposed

63 organizations hold a real secret in a public allowlist. The strongest cases, all in `.claude/settings.local.json` and each checked at a pinned commit:

| Organization | What’s exposed |
| --- | --- |
| Database vendor | Its own cloud API key with manage access and no expiry claim, plus the cluster host |
| B2B startup | Production Azure Postgres password |
| Software agency | Square production access token |
| Open-source project (over 1,000 stars) | OpenAI-format API key |
| Open-source project | npm token |
| IT services firm (medical-records app) | Owner password for the app’s cloud Postgres database |
| Payments startup | Postgres password for the postgres role |

Organization

Database vendor

What’s exposed

Its own cloud API key with manage access and no expiry claim, plus the cluster host

Organization

B2B startup

What’s exposed

Production Azure Postgres password

Organization

Software agency

What’s exposed

Square production access token

Organization

Open-source project (over 1,000 stars)

What’s exposed

OpenAI-format API key

Organization

Open-source project

What’s exposed

npm token

Organization

IT services firm (medical-records app)

What’s exposed

Owner password for the app’s cloud Postgres database

Organization

Payments startup

What’s exposed

Postgres password for the postgres role

Most are companies: startups, software agencies, IT services firms. A few are established vendors, exposed through their own demo and workshop repos. Nobody meant to publish a key. The key was in a command, the command was approved, and the file was committed with everything else.

The allowlists also hold server logins: 43 SSH credentials for public servers, some of them a root password in an `sshpass` command. One university repo, for example, permanently approved a root SSH command to a public server.

## How many

Public GitHub holds 104,185 copies of .claude/settings.local.json, in 103,617 repositories. 1,122 files (1.1%) hold a real secret: a key in a known provider format, or a password or token next to a public host. Together they hold 1,379 distinct secrets: 636 provider keys and 743 passwords or tokens for public hosts.

More than a third open a database directly: 379 database passwords and 122 Supabase service-role keys. Another 103 are Supabase account tokens, which control every project in the account. The rest are mostly API tokens for third-party services and AI model keys, plus 43 SSH logins, 42 GitHub, GitLab and npm tokens, 23 AWS keys and 6 private keys.

Large allowlists drive the rate. One in ten files over 8 KB holds a real secret, against fewer than one in 500 under 500 bytes. The longer a developer has been clicking “don’t ask again”, the more the file holds.

The files are still there: every one sat on its repo’s default branch on November 2, 2026, and most have sat there a long time. In the median repo with a real secret, the file was first committed 217 days before that. In 118 repos, more than a year before.  
Forks copy them: 211 forks of 74 repos carry the same secrets.

Deleting the file doesn’t solve it. Earlier versions of the file hold 734 real secrets, in 509 repos, that appear in no current copy, usually because the file was deleted.

Counting the file's history, the shared settings file and agent transcripts (next sections), the total comes to 2,539 distinct real secrets in 1,994 repos.

## What secret scanners miss

Generic secret scanners miss many of these. We ran **gitleaks** and **TruffleHog** over all 104,185 files. Of the 1,122 files with a real secret, gitleaks flagged 564 and TruffleHog 643; 215 were flagged by neither.

The gap is passwords inside commands. Scanners look for key formats: a provider prefix, a long random string. A password typed after `PGPASSWORD=`, `sshpass -p` or `mysql -p`, or a bearer header in a curl call, is an ordinary word in an ordinary command line, and both tools mostly let it through.

This matters beyond this file. The same password-in-a-command pattern appears wherever an agent records what it ran: transcripts, memory files, handoff notes, and a scanner tuned to key formats misses it in all of them.

## Not just one file

The allowlist is the clearest case, but agents write secrets into other files developers commit.

| File | Checked | With a real secret |
| --- | --- | --- |
| Shared .claude/settings.json | All 76,011 | 298 files |
| Agent chat transcripts (.specstory, aider, Cursor exports) | 2,523 | 120 files in 87 repos |
| Agent memory files (MEMORY.md and similar) | 1,200 | 9 repos |
| Handoff and deploy notes | 2,095 | 33 files |
| VS Code Copilot auto-approve settings | 173 | 9 repos |

File

Shared .claude/settings.json

Checked

All 76,011

With a real secret

298 files

File

Agent chat transcripts (.specstory, aider, Cursor exports)

Checked

2,523

With a real secret

120 files in 87 repos

File

Agent memory files (MEMORY.md and similar)

Checked

1,200

With a real secret

9 repos

File

Handoff and deploy notes

Checked

2,095

With a real secret

33 files

File

VS Code Copilot auto-approve settings

Checked

173

With a real secret

9 repos

Teams commit the shared settings file on purpose, and most of its secrets sit in allow rules as exact command lines. A third of the handoff notes with a secret were written by the agent itself.

The file leaks beyond GitHub too. Of 31,053 Hugging Face Spaces, 126 hold .claude/settings.local.json, and one has allow rules with a database service key and a user password. On GitLab.com, 2 of the 69 public copies we checked hold a real secret, including a GitLab access token.

The habit that leaks is the same everywhere: typing a secret into a command that an agent then records.

## On the developer's machine

Most of these files never reach GitHub. They stay on developers’ machines, and that doesn’t make them safe. The allowlist is plain JSON in the project folder.

Malware already collects credentials from developer machines in bulk. In September 2025 the [Shai-Hulud npm worm](https://sysdig.com/blog/shai-hulud-the-novel-self-replicating-worm-infecting-hundreds-of-npm-packages) downloaded TruffleHog and ran it over the victim’s files. That scanner flags 643 of the 1,122 files with a real secret. Three weeks earlier, the [malicious Nx packages](https://blog.gitguardian.com/the-nx-s1ngularity-attack-inside-the-credential-leak/) told the developer’s own Claude Code and Gemini CLI to search the disk for secrets.

The file can also leave without git: in a published npm package, a Docker image built with a copy command, a zip archive or a synced folder. And a secret approved once stays in the file until someone deletes the rule, long after the command ran.

## Prior work

This post adds the full GitHub count of secrets leakage at scale, the organization cases, the scanner gap, and the other agent files that carry the same secrets. Claude Code users have reported the mechanism in GitHub issues since August 2025 ([#5544](https://github.com/anthropics/claude-code/issues/5544), [#11982](https://github.com/anthropics/claude-code/issues/11982), [#13106](https://github.com/anthropics/claude-code/issues/13106), [#91270](https://github.com/anthropics/claude-code/issues/91270)). None got a reply from Anthropic, and three were closed automatically as inactive or duplicate. ironPeak found the same file in their own repo in February 2026 and measured 2.4% of repos with AI config folders carrying secrets in history, on a sample of 100. Lakera found credentials in 33 such files across 30 npm packages in April.

## What to do

**Developers:**

1. If the file is tracked in a repo, untrack it with git rm --cached `.claude/settings.local.json` and add it to the repo’s own .gitignore.
2. Rotate every credential the file has ever held. Removing it doesn’t clear git history, forks or clones.
3. Even if the file was never committed, open it and delete every rule that contains a secret.
4. Stop typing secrets into commands. Reference them as $VAR from whatever secrets manager you use, so the rule records $DB\_URL, not the secret.
5. Approve patterns, like `Bash(npm run:*)`, instead of literal commands.

**Security teams:**

1. Treat agent folders: .claude/, .cursor/, .gemini/, .specstory/, agent memory files, as secret-bearing, like .env, on laptops as well as in repos.
2. Add them to pre-commit and CI secret scanning, including history. Make sure
shmulc629424
🟧 echo.blog ⭐Apiiro says its research found real credentials in public coding-agent files, including Claude Code permission settings that can record secrShmulik Cohen, Matan Giladi——
🟧 hn31,088 secrets in Claude Code's .claude/settings.local.json on public GitHubguedou41
🟧 hnClaude Code is accidentally exposing secrets all over GitHubGaishan61

Interpretation history

Decision trace