Sensitive passwords, database credentials, and high-privilege API keys typed by developers into commands executed through Anthropic’s AI coding assistant, Claude Code, are ending up exposed in public GitHub repositories. Security researchers warn that thousands of configuration files containing plaintext secrets have been inadvertently committed, leaving projects vulnerable to unauthorized access and supply chain compromise.
The vulnerability stems from how Claude Code manages user permissions and automated workflows. When a user interacts with the AI agent and selects the prompt option "Yes, and don’t ask again," Claude Code records the approved command verbatim—including any sensitive parameters, plaintext passwords, or secret tokens embedded within it—into a local project settings file.
According to findings published by software security firm Apiiro, thousands of public copies of this configuration file currently harbor active secrets. Although the researchers did not actively test whether every single credential remained functional, one impacted corporation contacted during the early disclosure phase confirmed that its exposed key was actively live and vulnerable at the time of notification.
The core of the issue resides within the .claude/settings.local.json file generated inside project directories. Security analysts emphasize that simply deleting this file from a repository does not remediate the leak. Because older versions of the file persist indefinitely within git history and across repository forks, standard deletion is insufficient. Experts strongly advise affected teams to prioritize credential rotation first—immediately changing every password, token, and API key that the file has ever held—before undertaking cleanup procedures to purge historical data.
How Secrets Find Their Way into Configuration Files
By default, Claude Code is designed to prompt developers for explicit confirmation before executing most shell commands. However, to streamline development workflows, the tool provides an option allowing users to authorize specific command patterns or exact command strings permanently. Documentation for Claude Code outlines that selecting the persistent approval option automatically writes an allow-rule into the .claude/settings.local.json file. Subsequent matching commands are then executed seamlessly in future development sessions without triggering further prompts.

Depending on the context, these stored rules may capture broad patterns, such as standard test scripts, or exact command strings containing explicit runtime arguments. When an exact command string includes inline credentials—such as database connection strings or authentication tokens—the plaintext secret is permanently recorded to the configuration file. Security researchers investigating the behavior successfully reproduced this exact leakage mechanism using advanced model variants, confirming that the issue persists across current iterations of the technology.
While Claude Code attempts to prevent accidental commits by adding the file to the user’s global git excludes configuration the first time it is generated within a repository, this built-in protection has significant limitations. The global ignore rule applies exclusively to a single user’s local environment on a specific machine. It provides zero protection for files that have already been committed, nor does Claude Code automatically append the file to the project’s shared .gitignore configuration. Consequently, the protection mechanism fails to travel with the project when it is shared or cloned by other contributors.
Compounding the problem, Apiiro’s analysis revealed that in hundreds of traced repositories, a commit listing Claude as a co-author had modified the configuration file, strongly suggesting that the AI agent itself occasionally commits the file directly to the project tree.
Scale of the Exposure Revealed by Apiiro
Apiiro’s comprehensive scan of public GitHub repositories uncovered more than 104,000 copies of the targeted settings file distributed across upwards of 103,000 unique repositories. Out of that massive pool, approximately 1.1 percent—representing 1,122 individual file copies—were found to contain at least one hardcoded secret, aggregating a total of 1,379 distinct sensitive values.
The security firm classified a data point as a secret whenever it matched recognized cryptographic or API key formats, or when a plaintext password or token was found directly associated with a public server address. Every identified instance was further subjected to verification by an AI review system. The exposed credentials span a wide range of administrative vectors, with more than one-third directly threatening database security. This includes 379 distinct database passwords, alongside 43 Secure Shell (SSH) logins for public servers, 42 authentication tokens for platforms like GitHub, GitLab, and npm, and 23 Amazon Web Services (AWS) keys.

Among the entities caught in the exposure are at least 63 distinct organizations, ranging from small-scale software shops to established enterprises. Notable discoveries among the leaked assets include administrative-level cloud keys belonging to a prominent database vendor and master owner passwords for sensitive medical-records databases.
Long-term persistence remains a major concern. Investigators observed that every single file containing a secret remained present on its repository’s default branch. In half of those affected repositories, the vulnerable files had remained publicly accessible for at least 217 days. Furthermore, historical versions of the configuration files harbored hundreds of additional secrets across repositories where the current files had otherwise been cleaned or deleted. Repository forks further amplified the spread, with numerous forks carrying identical secrets inherited from their parent projects.
Additional secrets were also identified within shared .claude/settings.json files, which development teams intentionally commit to repositories as part of shared team configurations. When factoring in historical file versions, repository forks, and archived agent chat logs, the researchers identified a total of 2,539 exposed secrets spread across nearly 2,000 repositories. Among a comparative analysis of 16 different AI coding agents, Claude Code stands out as the only assistant confirmed to store complete, approved commands containing raw credentials inside a project-level settings file by default.
Detection Challenges and Broader Implications
Beyond public code repositories, exposed configuration files present severe risks on local developer workstations and internal development environments. Because the file is stored as plain JSON within project directories, it can easily be bundled into published npm packages, Docker container images, compressed archives, or synchronized cloud folders.
Malicious actors and automated malware strains frequently target developer workstations specifically to harvest stored credentials. In previous supply chain incidents, such as automated worm infections scanning compromised machines with popular secret-detection utilities, a significant proportion of exposed developer environment files were readily flagged as containing sensitive material.

Standard automated secret-scanning tools often struggle to catch these specific exposures. When researchers tested common open-source scanners against the dataset, tools like Gitleaks and TruffleHog failed to flag a substantial portion of the files without extensive custom configuration. Most scanners rely heavily on detecting specific, well-known key formats and structural patterns. Plaintext passwords embedded mid-command—such as those following standard administrative command flags—frequently masquerade as ordinary alphanumeric text strings to automated scanners, allowing critical database passwords and server credentials to bypass standard security gates undetected.
Prior user reports indicate that this behavior has been known to the community for months. An issue ticket filed on GitHub in August 2025 explicitly warned that approved commands containing API keys and authentication tokens were being stored verbatim in local settings files. However, automated repository management systems ultimately closed that report and subsequent related disclosures due to inactivity without receiving substantive public responses from Anthropic representatives. As security analysts continue to map the extent of the leaks, industry experts emphasize the urgent need for developers using AI coding assistants to audit their local environments, review permission configurations, and adopt rigorous credential rotation protocols.
