Incident sheet · SIG-3316 · /security
- Signal
- SIG-3316
- System
- SEC · Security & Risk
- Filed
- Read
- 3 min · 612 words
- Severity
- Routine
Claude Code 'Don't Ask Again' Feature Exposed 31,000 Secrets on GitHub
GitGuardian found 31,088 secrets in Claude Code's settings files across 23,276 public GitHub repos, with 5,343 still valid — plus 613 more in Docker Hub images.

Event log
- GitGuardian identified 31,088 distinct secrets in Claude Code's settings.local.json files across 23,276 public GitHub repositories, 5,343 still valid.
- Monthly leaks peaked at 12,535 occurrences in April 2026 before falling to 959 by October, according to researcher Guillaume Valadon.
- 67% of occurrences with verifiable validity were working credentials; database identifiers led with 2,280 distinct entries.
- 613 distinct secrets, 99 valid, were found in Docker Hub images across 543 repositories and 7,625 tags.
- Anthropic's Claude Code lead Boris Cherny acknowledged the issue and said built-in secret scanning and an auto mode are being explored.
A single convenience feature in Anthropic's Claude Code has leaked 31,088 distinct secrets — including 5,343 that were still valid at the time of detection — into 23,276 public GitHub repositories, according to code security firm GitGuardian.
The exposure stems from the file .claude/settings.local.json, a project-level configuration file Claude Code uses to store local command permissions. The credentials found inside it include database connection strings, cloud provider tokens, SSH passwords, Google API keys and AU service credentials.
The scale is not static. "Monthly leaks in settings.local.json peaked at 12,535 occurrences in April 2026, then fell to 959 by October, and we do not yet know what changed," GitGuardian researcher Guillaume Valadon said in a blog post.
Put plainly: in a single month, more than twelve thousand credential-bearing entries appeared in public repos.
How does an approval button spill secrets?
Claude Code asks developers for permission before executing certain shell commands. When a developer selects the "Yes, and don't ask again" option, the tool writes an allow rule into .claude/settings.local.json.
The mechanism has a flaw. The saved rule contains the actual command string — including any credentials embedded in it. If a developer approves a curl command carrying an API key in its HTTP header, Claude Code stores that entire command as an approved rule, leaving the credential sitting in the file.
Claude Code does add the file to its local Git ignore settings automatically. But that protection does not carry over to other machines or repositories, Valadon said. Developers can accidentally commit the file when working across different clones, or when the file has already been tracked by Git.
How many of the leaked credentials actually work?
Of the occurrences where GitGuardian could establish validity, 67% were working credentials. Database identifiers formed the largest category of valid secrets, with 2,280 distinct credentials, followed by cloud provider tokens and AI tokens.
Traditional defenses would miss much of this. Passwords embedded in command-line arguments and environment variable assignments often lack the recognizable formats that provider-specific secret-scanning rules look for.
What leaked through Docker Hub?
The problem extends beyond GitHub. GitGuardian examined public Docker Hub images and found 613 distinct secrets in Claude Code settings files, 99 of them valid at detection, spread across 543 image repositories and 7,625 tags.
The cause here is Docker's COPY . . instruction, which copies an entire project working directory into an image. Unlike Git, Docker does not respect the repository's .gitignore file — so a configuration file excluded from version control still lands in the container image unless developers explicitly block it via .dockerignore.
The persistence is striking. One valid Cloudflare API token appeared across 559 image tags. A single database password turned up in 643 tags across seven image repositories.
What should security teams do now?
Deleting the file from GitHub does not recall credentials already distributed through published images. GitGuardian advises three actions:
- Rotate every exposed credential.
- Remove sensitive configuration files from both Git and Docker build contexts.
- Check previously published images for lingering secrets.
Longer term, the firm recommends treating AI coding assistant configuration files as secret-bearing assets, scanning them alongside conventional environment files, and using environment variables rather than hardcoding credentials into commands.
Anthropic did not immediately respond to a request for comment. GitGuardian said Claude Code lead Boris Cherny acknowledged the issue, saying the company was looking into it and exploring additional safeguards, including built-in secret scanning and an auto mode.
The takeaway: a developer convenience setting quietly became a credential pipeline into public infrastructure — and rotating keys is now the only reliable fix.
via infoworld.com/feed/ (Source)
More from Amara Osei
Show full bio
Correspondent covering regulation, policy and their impact on enterprise information technology and the leaders who run at CIO Monitor.
114 articles
The newsroom digest
One email a day with the stories that matter. No noise.
Cross-references
- Claude Code leaked 1,379 secrets across public repositories
- 4,837 GitHub accounts hijacked to steal cloud and CI credentials
- Apify Rotates API Tokens, Advises 2FA Resets After Internal Breach
- Railway Breach Cost $740,000 in Fraudulent AI Usage
- Atlassian's CVE-2026-21589 Hits Eight Data Center Products at 9.3 Severity