Security

Claude Code leaks credentials in public GitHub repositories

Anthropic's AI coding agent is inadvertently exposing sensitive data in public repositories due to a local storage feature. Security firm API Row identified over 2,500 active credentials in nearly 2,000 public projects.

· 1 source · AI security flaws

AI coding agents, specifically Anthropic's Claude Code, are inadvertently leaking sensitive credentials into public GitHub repositories. The issue stems from a convenience feature that stores database and API access credentials locally in the project folder when users confirm prompts. Security firm API Row analyzed approximately 100,000 public cloud configuration files on GitHub and discovered real secrets in over 1,100 files. The analysis identified more than 2,500 active credentials across nearly 2,000 public projects. These leaks include database passwords, cloud keys, API tokens, and root logins.

The core problem is unconscious secret transfer. If a folder is converted to a Git repository after credentials are saved, or if a repository is cloned from another machine, automatic protection fails. In many cases, the AI itself committed the files as a co-author. Anthropic is currently evaluating integrated secret scanning to address the vulnerability. Companies are advised to audit their GitHub organizations and rotate compromised credentials immediately to mitigate the risk.