Anthropic's Claude Code AI assistant exposed thousands of sensitive developer credentials, including database passwords and API keys, by saving raw commands to local configuration files that were subsequently committed to public GitHub repositories and Docker Hub images.
Anthropic's Claude Code AI coding assistant reportedly stored credentials embedded in commands approved for reuse. When settings files containing those approvals were published, developers' and organizations' credentials reportedly became public. Researchers reportedly found 31,088 distinct secrets in local settings files in public GitHub repositories, including 5,343 that worked when detected. Credentials also reportedly appeared in public container images on Docker Hub.
Domain classification, causal taxonomy, severity scores, and national security assessments were LLM-classified and may contain errors.
AI systems that memorize and leak sensitive personal data or infer private information about individuals without their consent. Unexpected or unauthorized sharing of data and information can compromise user expectation of privacy, assist identity theft, or cause loss of confidential intellectual property.
Also classified as
The vulnerability lies in the AI toolchain's design, which persists plain-text credentials in local settings files that are easily exposed to version control and container builds.
The AI tool lacked the capability to scrub sensitive credentials or recognize passwords within commands before persisting them to disk.
The incident directly resulted in the exposure and leakage of thousands of non-public sensitive credentials, including database passwords, cloud tokens, and API keys, on public platforms.
AI system
Due to a decision or action made by an AI system
Unintentional
Due to an unexpected outcome from pursuing a goal
Post-deployment
Occurring after the AI model has been trained and deployed
The risk was caused by the automated behavior of the Claude Code AI tool saving raw commands containing secrets to local configuration files, which was an unexpected and unintentional outcome of its permission-saving feature.
Anthropic's Claude Code AI assistant unintentionally exposed over 31,000 developer credentials, including 5,343 valid keys and database passwords, on public repositories. While the national security impact is minor and manageable through credential rotation, it highlights emerging supply-chain and data-exposure risks associated with the integration of autonomous AI coding agents.
The report describes Claude Code as an AI agent that executes shell commands, manages permissions, and co-authors git commits autonomously, maintaining state through local configuration files.
Limited Risk: The system is an AI-powered coding assistant and chatbot that interacts with users, falling under the transparency obligations of Limited Risk systems.
Claude Code is an AI coding assistant designed to help developers write, test, and manage code, which primarily falls under Code Generation.
The reports from GitGuardian and Apiiro provide highly detailed, empirical, and consistent data regarding the mechanism of the leak, the number of affected repositories, and the validity of the exposed credentials. There is little ambiguity about how the vulnerability occurs or its scale.
None. The technical facts of the credential exposure are clear and agreed upon by both security firms.
Technology
Storing Exact Command Strings
Claude Code saves the literal command with secrets to persist permissions.
Lack of Built-In Secret Scrubbing
The tool does not scrub or mask credentials before writing to the config file.
Inadequate Git Tracking Detection
The agent detects tracked files but appends approvals without warning the user.
Data Inputs
Hardcoded Secrets in Commands
Developers input raw keys and passwords directly into the agent prompt.
Unfiltered Agent Transcripts
Agent memory and transcripts record and save raw credentials to the repository.
Human Factors
Habitual Approval Clicking
Developers click 'don't ask again' to avoid frequent command interruptions.
Neglecting Docker ignores
Developers use broad COPY commands without setting up a .dockerignore file.
Process and Methods
Ineffective Global Gitignore
Global gitignore fails when folders become repos later or on other clones.
Inadequate Secret Scanning
Generic scanners miss passwords in commands, looking only for key formats.
Claude Committing Settings File
Claude Code commits its own settings file due to incomplete commit exclusions.
Management
Ignored User Bug Reports
Anthropic ignored GitHub issues detailing this leak mechanism since August 2025.
No Default Security Review
Management deployed the tool without assessing local file persistence risks.
AI system involved
Identified by automated extraction; can differ from the alleged developers above.