Image: storage.ghost.io · rights & removal
Claude Code settings.local.json Secrets: 17 months of exposure on GitHub, & Docker Hub
Reporting by AI Incident DatabaseRead the original at blog.gitguardian.com
Overview
- GitGuardian discovered 31,088 distinct secrets in Claude Code settings files on public GitHub, with 5,343 confirmed valid at detection.
- Approving shell commands permanently saves allow rules containing exact command strings, including API keys, into local project settings files.
- Container images built with broad copy instructions unintentionally ship ignored configuration files containing valid credentials to public registries like Docker Hub.
- Monthly secret occurrences in local settings files peaked at 12,535 in April 2026 before declining significantly by October.
Executive Summary
The intersection of developer productivity tooling and security hygiene has exposed tens of thousands of sensitive credentials on public code repositories and container registries. Autonomous coding assistants, specifically Claude Code, facilitate workflows by requesting permission to execute shell commands. When users grant permanent approval using broad options, the system writes exact command strings—including API keys, database connection strings, and bearer tokens—directly into local project configuration files. While these files are typically excluded from local version control, they frequently end up committed through older clones, secondary machines, or inadvertent repository tracking. Furthermore, containerization processes that copy entire working directories into images can propagate these hidden files to public registries, persisting long after original repositories revoke access.
Security analysis reveals that while generic detectors struggle with unformatted or parameter-based credentials, database connection strings and SSH passwords represent a significant portion of active vulnerabilities. The exposure spans individual developers, corporate entities, academic institutions, and government sectors alike. Remediation requires immediate credential rotation, comprehensive repository and container auditing, and the adoption of narrow command prefixes or environment variable references rather than literal secret strings. Tooling adaptations, such as pre-tool-use hooks, aim to intercept credentials before they ever reach permission prompts or configuration files, addressing the core friction point between seamless automation and baseline security.
Facts Only
GitGuardian identified 31,088 distinct secrets in Claude Code settings files across public GitHub repositories, with 5,343 verified as valid at the time of detection.
Approving commands with permanent permissions causes Claude Code to save exact command strings, including embedded API keys, into local settings files within project folders.
Repository copies and older clones frequently commit these local configuration files despite local exclusion rules, leading to widespread public exposure.
Public Docker Hub images carry thousands of secret occurrences because broad copy instructions capture working trees rather than filtered git indexes.
Monthly secret leaks in local settings files peaked at 12,535 occurrences in April 2026 before dropping to 959 by October of the same year.
Database credentials and SSH passwords constitute a large portion of actively working secrets found within the analyzed configuration files.
Shared project configuration files occasionally leak third-party gateway tokens and authentication keys for AI services through environment blocks.
Multiple other coding agents exhibit similar vulnerabilities, though specific implementation details regarding command persistence vary across platforms.
Remediation guidance emphasizes credential rotation, updating ignore files, deleting sensitive rules, and utilizing pre-tool-use scanning hooks to intercept secrets.
Full Take
This analysis highlights a structural tension between frictionless developer experience and fundamental security hygiene. The vulnerability does not stem from malicious actors breaching perimeter defenses, but from standard administrative tooling designed to optimize user workflow by automating repetition. When an assistant records an approved shell command verbatim, it treats convenience as the primary objective, transforming a transient operational action into a permanent artifact of technical debt and exposure. This dynamic illustrates how modern productivity features can inadvertently bypass traditional mental models of security boundaries, moving secrets from memory to disk without explicit user awareness.
The lifecycle of these leaks—moving from local laptops to public git repositories, downstream forks, and container registries—demonstrates the cascading nature of digital artifacts. Deleting a file from a primary branch provides false comfort once history and container tags have already propagated the data outward. This phenomenon forces a shift in threat modeling: auxiliary configuration files associated with local development environments, agent instructions, and authentication caches must be treated with the same scrutiny traditionally reserved for core source code and production environment files.
Patterns detected: none
What assumptions govern the design of developer tools regarding ephemeral versus persistent state? How can tooling architecture evolve to make secure parameterization easier than hardcoded credential approval? What responsibility do platform creators bear when default behaviors generate systemic security risks?
From the original · AI Incident Database
TL;DR - 31,088 secrets, 5,343 valid: GitGuardian found 31,088 distinct secrets in Claude Code’s .claude/settings.local.json on public GitHub, across 23,276 repositories, and 5,343 of them worked when we detected them. - “Yes, and don’t ask again” writes the key: approving a command permanently makes Claude Code save an allow rule that is the command string itself, API key included, in the…Read the full story at blog.gitguardian.com
Sentinel unavailable
The automated check of the source article's wording did not complete, so no result is shown.
This looks only at the wording of the original source article, not at this page's AI-written sections. A small local AI model made this estimate. It has not been checked against known human and machine texts, so treat it as provisional. It cannot show who wrote an article.
Sponsored-content signals
Patterns that vendor press releases and paid placements tend to share, counted in the source text. They are evidence to weigh, not a finding that this story is sponsored: trade news quotes executives too. How these are counted.
No attributed quotes we could class. 6 more could not be classed.
No subscription, as-a-service or "no upfront cost" phrasing.
No figure from an outside data source is followed by a product offered as the answer.
1 link to outside sites: 0 to public or research sources, 1 to apiiro.com.
Not compared yet: we had 0 earlier stories from this publication and compare from 20.
