Claude Code is Accidentally Exposing

Claude Code is Accidentally Exposing Your Info on GitHub: Artificial Intelligence Trends

Ruh-roh! Apparently, Claude Code is accidentally exposing passwords, API keys, and more on GitHub. Here’s what’s happening.

As discussed by Kyle Orlans in ArsTechnica (Claude Code is accidentally exposing secrets all over GitHub, available here), 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.

How often does this happen? Apiiro’s researchers found over 100,000 cases where Claude Code’s local settings file had been uploaded to a public GitHub repository. However, 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.

Amazingly, this security issue was flagged in a Claude Code bug report as far back as August 2025, but it’s certainly getting more attention now. In a comment thread on Hacker News over the weekend, Claude Code’s Boris Cherny said the team is “looking into what we can do to prevent this.” So far, most of his potential recommendations discussed in the article have been found to be flawed in some respect.

If you’re using Claude Code, FYI.

So, what do you think? Are you surprised that Claude Code is accidentally exposing passwords, API keys, and more on GitHub? Please share any comments you might have or if you’d like to know more about a particular topic.

Image created using ChatGPT, using the term “robot uploading a file titled ‘Passwords and API keys’ to GitHub”.

Disclaimer: The views represented herein are exclusively the views of the author, and do not necessarily represent the views held by my employer, my partners or my clients. eDiscovery Today is made available solely for educational purposes to provide general information about general eDiscovery principles and not to provide specific legal advice applicable to any particular circumstance. eDiscovery Today should not be used as a substitute for competent legal advice from a lawyer you have retained and who has agreed to represent you.


Discover more from eDiscovery Today by Doug Austin

Subscribe to get the latest posts sent to your email.

Leave a Reply