Claude Code's "Yes, and don't ask again" option can leak passwords and API keys to GitHub
Claude 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.
The research shows that credential leaks can occur without a malicious attack, through routine authorization flows, and teams using Claude Code can use this to check their local settings files and Git history.