AI AI Pulse

One 'don't ask again' click wrote passwords into public repos

AI News Source: InfoQ / Apiiro / GitGuardian

Apiiro found that Claude Code's "don't ask again" option saves whole commands, credentials included, into .claude/settings.local.json. It found 1,122 secrets across 63 organisations; GitGuardian later counted 31,088.

What happened

Apiiro, an agentic security firm, published research reported by InfoQ on 22 November. When a developer answers "Yes, and don't ask again" to approve a shell command, Claude Code saves that entire command as a permanent permission rule in the project's .claude/settings.local.json.

If the command carried a password, an API token or a database connection string, the credential lands in the file too. The researchers found 1,122 secrets in that file. They found another 1,160 in git history, in shared settings.json files committed on purpose, and in agent chat transcripts stored in repositories. The exposures covered 63 organisations and included cloud API keys, production passwords, access tokens and npm tokens.

Why the guardrails missed it

When Claude Code creates the file inside a git repository, it adds it to the developer's global gitignore. That covers the common case. It does not cover a folder that becomes a repository later, a clone on another machine, or a file someone already committed.

The rule never goes into the project's own .gitignore. Nothing travels with the project to protect it. The researchers also found cases where Claude Code committed the file itself.

Scanners made it worse. Tools such as gitleaks and TruffleHog look for credential formats. Here the secrets sit inside shell commands, in shapes those tools do not expect, so many went unreported.

How large the exposure is

Apiiro scanned 104,185 copies of the file across 103,617 repositories. Of those, 1,122 files held 1,379 real secrets. Among the ones it could categorise, about 78% were database credentials, followed by SSH credentials and version control tokens. Another 734 secrets sit in older commits across 509 repositories, so deleting the file today leaves those commits intact.

GitGuardian's independent check went higher. It found 31,088 secrets on public GitHub across 23,276 repositories, with 5,343 still valid at the time of detection. It also found 613 secrets baked into public Docker Hub images, 99 of them valid.

Database credentials dominate for a plain reason. Asking an agent to connect to Postgres once, people naturally type PGPASSWORD=... psql -h .... Approve it once with "don't ask again" and the password sits in the file in plain text.

What the vendor says

Boris Cherny, who leads Claude Code, acknowledged on Hacker News that the tool has "historically not done secret scrubbing" and said the team is looking at fixes, including built-in secret scanning.

The researchers also note that developers raised this behaviour in GitHub issues from August 2025. Several of those issues were closed automatically without a reply.

What to do now

Four steps, in order. Run git rm --cached .claude/settings.local.json to untrack it. Add it to the project's .gitignore. Rotate every credential the file has ever held, including ones in old commits. Then delete any rule containing a secret and pass secrets through environment variables instead.

For teams building agents, the lesson is wider than one file. Anywhere an agent records what it ran, from transcripts to memory files to handoff notes, passwords can end up stored the same way. Format-based scanners will miss them there too.

Nothing here is investment advice.

Source: InfoQ / Apiiro / GitGuardian

Related