cd /news/ai-safety/claude-code-is-accidentally-exposing… · home › topics › ai-safety › article
[ARTICLE · art-166394] src=arstechnica.com ↗ pub= topic=ai-safety verified=true sentiment=↓ negative

Claude Code is accidentally exposing secrets all over GitHub

Apiiro security researchers found over 100,000 instances of Claude Code's local settings file (.claude/settings.local.json) uploaded to public GitHub repositories, about 1,100 of which — from 63 different organizations — contained secrets including API tokens, database passwords, and private keys. The leak stems from Claude Code writing approved shell commands verbatim into the settings file, which Anthropic's documentation says is added to the developer's global .gitignore but not at the repo level, so the file can be committed accidentally or by Claude Code itself without user input. Secrets can persist in forks of the original project even after the files are removed.

by read2 min views3 publishedNov 9, 2026
Claude Code is accidentally exposing secrets all over GitHub
Image: Arstechnica (auto-discovered)

Claude Code is leaking sensitive information on public GitHub instances thanks to a partial oversight in the way its settings files are handled. That’s the finding of AI security researchers at Apiiro, who discovered thousands of secrets, including database passwords, API tokens, and root logins, amid Claude Code settings files embedded in GitHub repositories.

The leak stems from the way Claude Code handles user approval for automated shell commands. When a user chooses the “Yes, and don’t ask again” option to approve running a command, 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.

This isn’t really a significant security issue if the settings file stays on the user’s local machine (assuming that machine doesn’t become compromised itself, of course). And Anthropic notes in its Claude Code documentation that this particular settings file gets added to the developer’s global .gitignore list, which usually prevents it from being shared publicly.

But that .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, for instance. In many cases, Claude Code itself will commit changes to the settings file without the user’s input, Apiiro writes.

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.

── more in #ai-safety 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-is-accid…] indexed:0 read:2min 2026-11-09 · —