AI Agent News/stories/claude-code-settings-files-expose-thousands-of-secrets-on-public-github.md

Infrastructure

Claude Code settings files expose thousands of secrets on public GitHub

Security researchers at Apiiro found Claude Code settings files containing secrets such as database passwords, API tokens and root logins in public GitHub repositories. The files were leaked because a local settings file that stores approved shell commands is not reliably excluded from git at the repository level.

Source: arstechnica.com/ai/2026/11/claude-code-settings-files-expose-thousands-of-secrets-on-github

Apiiro found over 100,000 public GitHub repositories containing Claude Code's local settings file, according to the report. About 1,100 of those files, from 63 organizations, held secrets such as public API tokens, database passwords or private keys.

The problem comes from how Claude Code saves approvals. When a user picks "Yes, and don't ask again" for a shell command, the command is often written as is into .claude/settings.local.json, including any sensitive values it contains. Anthropic's documentation says this file is added to the developer's global .gitignore, but that protection is not reflected at the repository level, and Claude Code may commit changes to the file on its own.

A bug report flagged the issue in August 2025, but related reports were closed without action after 60 days of inactivity. Claude Code's Boris Cherny said the team is looking into prevention and that the files should not normally be checked in. Apiiro also found 215 of the roughly 1,100 secrets were missed by gitleaks and TruffleHog.

Why it matters if you build agents

If your agent runs shell commands through Claude Code, check that .claude/settings.local.json is ignored in each repository and is not committed, and remove any stored credentials from it.

Secret scanners can miss some of the leaked values, so do not rely on them alone. Rotate any credential that may have appeared in an approved command.

Get stories like this every weekday

One short email with the day's agent tooling news.

Subscribe