Claude Code

AI coding tool Claude Code exposed 2,282 secrets in public repositories

A recent investigation by Apiiro uncovered 2,282 secrets exposed in public repositories by Claude Code, an AI coding tool.

3 min readInfoQ
AI coding tool Claude Code exposed 2,282 secrets in public repositories

The latest findings from Apiiro should unsettle every developer using AI coding assistants. Claude Code has been exposing secrets in public repositories because it stores them in local files to implement a "Don't Ask Again" feature, and the scope is significant: 1,122 secrets in `claude/settings.local.json` files and another 1,160 in git history, shared settings, and agent chat transcripts. This is not a theoretical vulnerability. It is a live, documented leak of credentials, tokens, and keys that developers may have assumed were safely handled.

What makes this particularly frustrating is that the mechanism is understandable. The "Don't Ask Again" feature is meant to reduce friction, allowing developers to approve an action once and move on. But storing that approval in a local JSON file that ends up in a public repository is a design choice that prioritizes convenience over security. The agentic security firm identified the pattern across thousands of repositories, meaning this is not a one-off mistake. It is a systemic issue that affects how AI tools interact with developer workflows. For context, Signal tightens screenshot controls to counter AI surveillance risks shows another company taking deliberate steps to limit data exposure. The contrast is instructive: Signal designed around the assumption that users will make mistakes, while Claude Code's implementation assumed no one would push the wrong file.

The practical consequence for teams using Claude Code is immediate. Every developer should check their repositories for `claude/settings.local.json` and any `.git` history that might contain the shared `settings.json` or agent chat transcripts. Apiiro's findings suggest that even well-maintained projects could have secrets buried in commit history, where they remain accessible to anyone who clones the repo. This is not a problem that a quick `.gitignore` fix solves retroactively. Once a secret is in git history, it is effectively public, and rotation is the only remedy.

The deeper issue here is trust. Developers adopt AI coding tools to accelerate their work, and that acceleration depends on the tools handling sensitive data responsibly. When a tool like Claude Code exposes secrets because of a local file convention, it erodes that trust. The Explore Supply Chain Analytics with Claude Code in Five-Minute Case Studies article demonstrates how the same tool can be genuinely useful for rapid prototyping and analysis. But utility does not excuse carelessness. The takeaway is concrete: before your team commits any AI-generated configuration, audit the local storage patterns. The "Don't Ask Again" convenience is not worth the cost of a credential leak that takes months to clean up.

From InfoQ

Agentic security firm Apiiro found that Claude Code has been exposing secrets in public repositories due to how it stores them in local file on developers' machines to implement "Don't Ask Again". The company identified 1,122 secrets in claude/settings.local.json files and another 1,160 in git history, in the shared settings.json, and in agent chat transcripts stored in repos.

Read the original at InfoQ