Apiiro finds Claude Code approvals leaking secrets

Apiiro found secrets in 1,122 public Claude Code settings files saved by the "don't ask again" prompt. Rotate keys, then untrack the file.
What it means for founders
- Rotate before you clean up. Search your GitHub organisation, history included, for the local settings file and the shared `.claude/settings.json`. Revoke any credential that ever sat in either file, since forks and clones keep old commits.
- Put the ignore rule in the repository. Run `git rm --cached` on the local settings file, then list its path in the project's own `.gitignore` and your org templates, so every clone carries the protection.
- Keep literal secrets out of agent commands. Reference a variable such as `$DB_URL` from your secrets manager so a saved rule stores the name. Approve narrow patterns over one-off commands.
- Scan for passwords, not only key formats. Standard scanners missed nearly one file in five here. Treat `.claude/` like `.env` in pre-commit and CI checks; the OpenCode breach showed how fast stored AI keys turn into bills.
The story
Security firm Apiiro said on November 5, 2026 that public GitHub repositories hold thousands of passwords and API keys saved by Claude Code. In a research post, Apiiro's Shmulik Cohen and Matan Giladi trace the leak to the "don't ask again" choice on permission prompts, which writes the approved shell command to the project file `.claude/settings.local.json`. Once that file is pushed to a public repository, any credential typed into the command goes public too.
What leaks, and how much
The saved permission rule is the command text itself, so a database password written after `PGPASSWORD=` or a token in a request header sits in the file as plain text. Between November 1 and 3, Apiiro gathered 104,185 instances of the file from 103,617 public repositories. It classed 1,122 of them, about 1.1%, as holding a real secret, 1,379 distinct values in total, as iTWire reports. Adding file history, the shared `.claude/settings.json` and saved agent transcripts raised the count to 2,539 secrets in 1,994 repositories.
Over a third of the 1,379 secrets give direct database access, Developers Digest notes, including 122 Supabase service-role keys and 379 database passwords. Older versions of the file held 734 secrets in 509 repositories that no current copy shows. TruffleHog caught 643 of the 1,122 files and gitleaks 564, and 215 got past both.
Claude Code adds the file to a developer's global git excludes the first time it writes it in a repository. It does not follow a clone on another machine, a project folder turned into a repository afterwards, or a file git already tracks. Apiiro found commits co-authored by Claude touching the file in 539 out of 1,105 traced repositories.
What Anthropic said
Claude Code lead Boris Cherny replied in a Hacker News thread on November 7. He said Anthropic was "looking into what we can do to prevent this," as SecurityOnline reports, naming built-in secret scanning and making auto mode catch such commands as options to prototype. He also argued the exposed files were made by hand and checked in, and steered users toward auto mode and git host secret scanning. VentureBeat notes he announced no specific fix or release date. Apiiro says earlier GitHub issues on the same behaviour, dating to August 2025, got no reply from Anthropic.
What we don't know yet
- Whether most of the credentials still work. Apiiro did not test them, though one company it notified confirmed its exposed key had been live.
- Whether anyone used an exposed key to reach a system.
- When, or whether, Claude Code will ship scanning or change what the approval saves.
- How an independent count would compare. Apiiro sells application security products.
Sources
Tools in this story
We may earn a commission if you sign up through our links. It never affects our ratings or which stories we cover.
Anthropic's coding agent, from terminal to IDE to browser
More in Policy & Safety
- eBay appears to block Meta's Muse shopping agent

For founders: The terms reach your users. eBay's terms put the promise on whoever accesses its services, so a customer who points an unapproved agent at eBay may be acting…
The Verge · 8d ago - Nvidia board investigates CEO's ties to alleged spy

For founders: Export policy could tighten. Nvidia's case for selling into China rests partly on its promise to keep chips away from barred buyers.
TechCrunch · 9d ago - Elvis and Eminem rights owners sue Suno over AI songs

For founders: Prompt blocks may not be enough. The Presley filing calls Suno's v6 guardrails an implicit admission that earlier safeguards fell short on infringing output…
The Verge · 10d ago - The RealReal says AI agents face tougher bot defenses

For founders: Agent access is granted, not assumed. A retailer can restrict login and checkout for agents with a configuration change, so any product that buys on users'…
The Verge · 23d ago - Cohere flags Qwen's attempted Beijing bucket upload

For founders: Reasoning text is not a guardrail. Enforce policy on the actual tool call, since Cohere's case shows the stated plan and the action can diverge.
TechCrunch · 22d ago