Apiiro finds thousands of secrets leaking from Claude Code into public GitHub repos
Apiiro researchers found database passwords, API tokens and root logins exposed in Claude Code settings files across public GitHub repositories.
- Event
- 2026-11-05
- Affected
- Anthropic's Claude Code (coding agent)
- Published
- Sources
- 1
By the cisonews.ai Desk · Published · Updated
Security researchers reported that Claude Code, Anthropic's AI coding agent, is leaking sensitive information on public GitHub instances because of how its settings files are handled.
Tuesdays, by email
Pages like this one, every Tuesday
One email with the week’s new incidents, explainers and rules, sorted by topic.
Unsubscribe any time.
AI security researchers at Apiiro discovered thousands of secrets, including database passwords, API tokens, and root logins, inside Claude Code settings files embedded in GitHub repositories.
What happened
When a user approves a shell command with the Yes, and don't ask again option, that choice gets stored as part of a rule in the local .claude/settings.local.json file on the user's computer.
That rule is sometimes coded as a pattern, but the command itself is often written to that settings file as is, including any sensitive information that may be embedded within it.
The gitignore setting isn't reflected at the repo level, meaning the sensitive file can be uploaded accidentally if a repo is cloned to another machine or a folder becomes a repo later.
In many cases, Claude Code itself will commit changes to the settings file without the user's input, Apiiro writes.
Impact
Apiiro's researchers found over 100,000 cases where Claude Code's local settings file had been uploaded to a public GitHub repository.
Of these, only about 1,100 from 63 different organizations contained secrets such as public API tokens, database passwords, or private keys.
Even after these files are discovered and removed from a repository, the secrets can persist in forks of the original project if a GitHub user isn't careful.
Response
Claude Code's Boris Cherny said the team is looking into what we can do to prevent this.
He noted that these settings files should pretty much never be checked in to a user's git source control.
Cherny recommended Claude Code's auto mode, which uses classifiers to automatically route routine permission prompts without requiring manually maintaining finicky allow/deny lists.
When a reader pointed out the same exposure could occur in auto mode, Cherny called it a good catch and said the team is thinking through what it can do to improve this.
Apiiro found that 215 of the roughly 1,100 public secrets it found in Claude Code settings files were not flagged by the gitleaks and TruffleHog secret scanners.
Ars Technica noted the problem is not isolated, pointing to Meta's Muse agent, whose sharing feature the company suspended after researchers found its shareable links were easy to guess.
Lessons for security leaders
Teams running coding agents should search their own GitHub organizations for Claude Code settings files and treat any hit as a possible credential exposure rather than assume the agent's default gitignore protects them. A repo-level gitignore entry, rather than reliance on a developer's global ignore list, is needed because the global setting does not travel with a cloned or newly initialized repository. Because conventional scanners missed a meaningful share of the secrets Apiiro found, relying on a single scanning tool is not sufficient, and organizations should pair automated scanning with manual review of agent-approved command allowlists. Any credential found in a public or private settings file should be rotated, since deleting the file does not remove it from git history or existing forks.
Sources (1)
- [1]Ars Technicaarstechnica.comundatedtier B · Press
Tuesdays, by email
Pages like this one, every Tuesday
One email with the week’s new incidents, explainers and rules, sorted by topic.
Unsubscribe any time.