Study says Claude Code permission files leaked keys on GitHub
Start here
Security firm Apiiro found in a study that after Claude Code users select "don't ask again," complete commands containing passwords or keys are written in plaintext to .claude/settings.local.json; that file is only added to the developer's local global Git ignore rules rather than the repository's .gitignore, and is therefore committed to public repositories. Apiiro scanned 104,185 such files in public repositories; 1,122 contained at least one key, totaling 1,379 distinct keys, including 379 database passwords, 23 AWS keys and others; gitleaks and TruffleHog both failed to flag 215 of them. Including Git history and other sources, 2,539 credentials involved 1,994 public repositories and 63 organizations, and one company confirmed its key was valid. The study says deleting the file does not eliminate the leak, and historical versions contain another 734 keys; it recommends rotating credentials first. Anthropic Claude Code lead Boris Cherny said the tool previously did not do secret scrubbing, and the company is exploring prototyping options such as auto-mode blocking and basic secret scanning before the next version.
Generated by AI from reports · Updated 2 days ago
Latest developments
Progress timeline
- WebBoannews (Korea)· Media coverage자동 승인 한 번에 비밀번호까지... 클로드 코드 설정 파일 1122개서 비밀 값 무더기 노출(opens the original post in a new tab)
- WebZenn Security (Japanese)· Media coverageProcedure for checking, in your own environment, the issue where secrets get mixed into Claude Code's "Don't ask again"(opens the original post in a new tab)
- WebAI Threat Watch (aithreat.io)· Media coverageWeek in review: Secret stealer hits GitHub repos, Claude Code turned into remote-controlled implant(opens the original post in a new tab)
- RedditReddit r/cybersecurity· DiscussionWe give AI coding agents access to everything. Are we being way too careless?(opens the original post in a new tab)
- Dark ReadingSelectedAI coding agents leaked thousands of secrets to GitHub
Research by security company Apiiro found that AI coding agents are leaking developer credentials to public GitHub repositories, with 2539 credentials found in nearly 2000 public repositories, involving developers from 63 organizations, including production Azure Postgres passwords and medical records database owner passwords. Taking Claude Code as an example, after a user selects "Yes, and don't ask again", the tool stores the command containing the key in .claude/settings.local.json; that file is only added to the developer's local global Git ignore, the rule does not migrate when the repository is cloned, nor is it written to the repository's own .gitignore, and thus it is committed along with the code. Boris Cherny, head of Anthropic Claude Code, said that Claude Code previously did not perform secret scrubbing, and the company is exploring prototyping solutions such as automatic mode interception and basic secret scanning before the next version.
- WeChat · LLM Security ResearchSelectedApproval fatigue: Claude Code exposed 2539 secrets on public GitHub
A report from security firm Apiiro shows that Claude Code stored complete commands approved by users, along with the plaintext secrets in them, in project settings files; the files were committed to public GitHub, exposing a total of 2539 real secrets. After a user clicked "don't ask again," the entire command was written as an allow rule into .claude/settings.local.json, and that file only goes into the developer's local global ignore rules, not the repository's own .gitignore. Apiiro collected 104185 such files on public GitHub from November 1 to 3, and 1122 contained real secrets; counting historical versions, shared settings and agent conversation records, the secrets were scattered across 1994 repositories and affected 63 organizations, and one confirmed secret was valid at the time. gitleaks and TruffleHog combined still failed to flag 215 files containing secrets, with the gap concentrated in passwords written into commands.
- WebZenn Security (Japanese)· Media coverageHow Claude Code separates deny/ask/allow, and hooks that prevent secrets from being pasted(opens the original post in a new tab)
- Ars Technica AISelectedClaude Code accidentally leaks large numbers of keys on GitHub
AI security researcher Apiiro found that Claude Code, due to negligence in handling settings files, leaked thousands of pieces of sensitive information in public GitHub repositories, including database passwords, API tokens and root login credentials. The leak stems from how Claude Code approves automatic shell commands: after a user selects "Yes, and don't ask again", that option is written as a rule to the local .claude/settings.local.json file, and the command itself is often written verbatim, potentially including sensitive information within it. If the file stayed only on the local machine, the problem would not be serious; Anthropic states in its documentation that the settings file is added to the developer's global .gitignore list, which usually prevents it from being shared publicly.
- X@raghav_227· DiscussionSources: https://t.co/Lcqp02KMVe https://t.co/IFtKMdtBRy(opens the original post in a new tab)
- WebAI Threat Watch (aithreat.io)· Media coverageAnthropic Claude Code’s ‘Don’t Ask Again’ Feature Exposes 2,539 Secrets on GitHub(opens the original post in a new tab)
- X@haristiks· Discussionhttps://t.co/7Uj0ZAODlJ(opens the original post in a new tab)
- CSA Labs ResearchSelectedApprove once, leak forever: secrets in Claude Code settings files
A CSA research note summarizes Apiiro's scan results: of 104,185 public .claude/settings.local.json files on GitHub, 1,122 (about 1.1%) contained at least one secret, totaling 1,379 distinct secrets, including 379 database passwords, 43 public server SSH logins and 23 AWS keys. The cause is that when developers choose persistent approval in permission prompts, Claude Code writes the full command verbatim into that file, so inline passwords or tokens are retained in plaintext, and the built-in protection only adds the file to the user's local global git exclude. In half of the affected repositories the file had been present for at least 217 days, and git history contained another 734 secrets; gitleaks and TruffleHog together missed 215 files. According to Check Point research, 428 public npm packages carry the file, of which 33 contain credentials.
- The Hacker NewsSelectedClaude Code's "don't ask again" file exposed passwords and keys in 1,122 public copies on GitHub
Research by security firm Apiiro found that after a user selects "don't ask again," Claude Code writes the full command, including any passwords and API keys in it, in plaintext into .claude/settings.local.json within the project, and 1,122 of these files in public GitHub repositories contain at least one key. The researchers scanned 104,185 copies across 103,617 repositories; about 1.1% contained keys, 1,379 distinct keys in total, of which 379 were database passwords, 23 were AWS keys, and 42 were GitHub, GitLab and npm tokens, involving 63 organizations. Deleting the file does not eliminate the leak, as old versions remain in git history and forks; the researchers recommend first rotating all credentials that appeared in the file, then cleaning up.
- CybersecuritynewsSelectedClaude Code's "Yes, and don't ask again" option can leak passwords and API keys to GitHub
Apiiro researchers found that Claude Code's "Yes, and don't ask again" option stores shell commands containing passwords or API keys in .claude/settings.local.json as allow rules, and that once the file is committed and pushed to GitHub, credentials can be publicly exposed. The researchers scanned 104,185 public copies of this settings file from November 1–3, 2026, and found real keys in 1,122 of them; including Git history and other sources, this involved 2,539 distinct keys across 1,994 public repositories and 63 organizations, including 379 database passwords, 122 Supabase service-role keys and 43 SSH logins. Apiiro said one of the companies has confirmed that its key is still valid.
- FourWeekMBASelectedApiiro says most of 2,539 leaked credentials were hidden in a single Claude Code file
Security firm Apiiro said it found 2,539 real credentials in 1,994 public GitHub repositories, most of them in .claude/settings.local.json settings files generated by Anthropic Claude Code. The cause is that after developers choose "Yes, don't ask again" for suggested commands, Claude Code writes the full command, including passwords or keys, into that file; Apiiro said this is Claude Code's own behavior rather than model behavior, and reproduced it on Opus 5.5 and Fable 5.1. Of 104,185 public copies of that file, 1,122 contained real credentials, totaling 1,379 distinct credentials, including 636 provider keys and 743 passwords or tokens for public hosts; TruffleHog flagged 643 of them (57.3%), gitleaks flagged 564 (50.3%), and neither flagged 215 (19.2%).
- GBHackersSelectedApiiro research found that Claude Code's "don't ask again" feature led to 2,539 sensitive credentials being exposed in 1,994 public GitHub repositories
Apiiro's research traced the exposure of 2,539 sensitive credentials in 1,994 public GitHub repositories to coding agent configuration files, Git history and session records, involving 63 organizations. The research states that Claude Code's "approve and don't ask again" approval stores commands containing credentials verbatim as allow rules in .claude/settings.local.json, while global Git ignore protections do not propagate with the project; one organization confirmed that its exposed key had been valid. Apiiro scanned 104,185 public settings files and found 1,379 distinct credentials in 1,122 of them, including 379 database passwords, 122 Supabase service-role keys and 43 SSH credentials; historical versions also contained 734 credentials not present in current copies. Gitleaks and TruffleHog flagged only 564 and 643 files containing secrets respectively, and 215 were found by neither.
Related discussion
What people think
By account: 47 hold one of the views above, 34 posted without a clear one, and 184 more only relayed the news. AI drew the views from the posts; a post is placed only when three models, judging apart, all agree. The posts themselves are the record.
- WebBoannews (Korea)자동 승인 한 번에 비밀번호까지... 클로드 코드 설정 파일 1122개서 비밀 값 무더기 노출(opens the original post in a new tab)
- X@Yuki_K25Source: MA-NO "Claude Code: How to Find and Remove Leaked Secrets" https://t.co/TRqCZuRsqp In GitGuardian's survey, of 31,088 secrets, 5,3…(opens the original post in a new tab)
- X@marathivibecodeClaude Code ला "Yes, and don't ask again" दिलं? तुमचा password .claude/settings.local.json मध्ये plain text मध्ये पडला…(opens the original post in a new tab)
- Older than 72 hours · Not included in the 72-hour figures
- WebZenn Security (Japanese)Procedure for checking, in your own environment, the issue where secrets get mixed into Claude Code's "Don't ask again"(opens the original post in a new tab)
- WebAI Threat Watch (aithreat.io)Week in review: Secret stealer hits GitHub repos, Claude Code turned into remote-controlled implant(opens the original post in a new tab)
- RedditReddit r/cybersecurityWe give AI coding agents access to everything. Are we being way too careless?(opens the original post in a new tab)
- WebIThome (China)Officials are fixing it: Claude Code was reported to write passwords into project files, and 2539 real credentials were found on GitHub(opens the original post in a new tab)
- WebZenn Security (Japanese)How Claude Code separates deny/ask/allow, and hooks that prevent secrets from being pasted(opens the original post in a new tab)
- X@Demo44731876838Claude Code's "don't ask again" has this kind of pitfall too. Security company Apiiro found that some commands containing passwords and API keys were stored in the local permission configuration. The configuration files were then committed to public repositories, and the secrets were made public along with them. They found 1,379 in 1,122 files…(opens the original post in a new tab)
- X@HaStriveFirst thing I'm doing today: grep every repo for .claude/settings.local.json. That file is where Claude Code stores ea…(opens the original post in a new tab)
2 likes·Nov 10 08:16Collect
- X@_skinnyguineaPrevention that sticks: - Put secrets in $VAR / a vault, never in the command you approve - Prefer patterns like Bash(n…(opens the original post in a new tab)
- X@_skinnyguineaDo this week: 1. Search org code + every repo's git history for .claude/settings.local.json (and settings.json) 2. Rota…(opens the original post in a new tab)
Attention trend
New sources per day
- Nov 23: 1 new sources (0 outlets, 1 accounts)
- Nov 24: 2 new sources (1 outlets, 1 accounts)
- Nov 25: 0 new sources (0 outlets, 0 accounts)
- Nov 26: 0 new sources (0 outlets, 0 accounts)