# Claude Code's "Don't Ask Again" button leaked real secrets into 1,122 public GitHub files

Original title: Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files

> Hacker News story 50407882 · language: en · submitted 2026-11-07
> Web version: https://zeli.app/story/50407882
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 578 · by [shmulc](<https://news.ycombinator.com/user?id=shmulc>) · 💬 390
[original](<https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again>) · [HN discussion](<https://news.ycombinator.com/item?id=50407882>)

## Summary

Apiiro scanned 104,185 public copies of Claude Code's .claude/settings.local.json and found 1,122 holding real credentials — database passwords, cloud keys, API tokens, even root SSH logins — across 63 organizations. The culprit is the "Yes, and don't ask again" option, which saves the exact command, secret included, into a project file that nothing marks as private. Counting git history, shared settings files, and agent transcripts, the total reaches 2,539 secrets in 1,994 repos. Generic scanners miss many of them.

## Key quote

> The key was in a command, the command was approved, and the file was committed with everything else.

## HN discussion (390 comments)

### [bcherny](<https://news.ycombinator.com/item?id=50408126>)

> Boris from the Claude Code team here. Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this.
>
> That said, a few thoughts:
>
> 1. .claude/settings.local.json is meant to stay local. This is not a file you should check into source control. We automatically gitignore it when Claude creates the file, so in this case the files were manually created and checked in (docs: https://code.claude.com/docs/en/settings)
>
> 2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.
>
> 3. Regardless of what agent you use, you should have secret scanning enabled. GitHub and other source control hosts offer it. There are many threat models that it protects against and you should absolutely use it if you can. (see https://github.com/security/plans)

### [Aurornis](<https://news.ycombinator.com/item?id=50408084>)

> Confusing headline. They scanned for repos where people had committed their .claude/ folder and local settings and then scanned those files for commands which contained keys or passwords.
>
> So pressing “Don’t Ask Again” by itself doesn’t expose passwords by itself. If you commit your local Claude settings and in those settings you have manually approved commands containing secrets directly in the command and then you publish the repo, that’s exposed.

### [tsergiu](<https://news.ycombinator.com/item?id=50409507>)

> I'm super paranoid about the level of access AI agents have. At the same time, I want them to take away the tedium of a bunch of tasks I'm required to do, and it sucks to have to micromanage them.
>
> The best solution I've been able to come up is using an ephemeral vm (on an isolated network) per task, using --dangerously-skip-permissions so it doesn't bother me. I couple that with an API proxy that lets me restrict the permissions it has to external services. So e.g. where a quickbooks API key gives the holder "god mode" access, the proxy lets the agent do certain read commands without confirmation, but all write endpoints except uploading receipts require confirmation on my phone before they'll be allowed to hit the quickbooks servers. I no longer need to trust that the agent will interpret my readonly wishes correctly.
>
> Tooting my own horn here, but this setup works incredibly well! I've been able to connect dozens of services safely where I absolutely do not trust giving raw, overpowered credentials or oauth integration to the agent directly. I actually just released the API proxy today at https://keycontain.com

### [tomrod](<https://news.ycombinator.com/item?id=50413217>)

> More and more, I want a hard sandbox on these. For those of a similar security mindset, how are you sandboxing?

### [tim-projects](<https://news.ycombinator.com/item?id=50410228>)

> Here is how to solve this:
>
> Use a private dev repo and do all your dev inside it.
>
> Releases go to a seperate public repo
>
> In the private dev repo use a script which Cherry picks release files from a whitelist that you maintain in the public repo.
>
> Essentially, you define the files and folder structure of a release and that ensures every release looks great with no cruft and it's never going to have .secret.json in or whatever
>
> Hardcoded secrets is seperate and you can have another script to grep for those

### [lacoolj](<https://news.ycombinator.com/item?id=50408093>)

> This page is like 80% repeating itself
>
> If you post output from AI, please remember to edit before publishing

### [algonney](<https://news.ycombinator.com/item?id=50413135>)

> From my point the best way is to give the AI all the permissions every thing that he needs to not stop on the middle of his work and after he done from the project you should change all the secrets api's, database whatever and by that you will be  on the safe side.

### [binarymax](<https://news.ycombinator.com/item?id=50408405>)

> I keep all my creds in a password manager (1Password in my case) and Claude can’t see them - when a cred is needed it runs a script that calls the op CLI and I tap my fingerprint for access.  Sometimes I need to do it a bunch of times for complex operations, but it’s worth it.

### [tiku](<https://news.ycombinator.com/item?id=50412745>)

> Why does git even allow easy hidden file adding? It should be hard to add a .folder so noobs won't do that.

### [ivan_gammel](<https://news.ycombinator.com/item?id=50411501>)

> This may not be a popular answer here, but it works as expected. Basic security hygiene means that you use password manager CLI, SSH agent, at worst temporary git-ignored env files, so that the secrets would never appear in the command line and you would never pass them to Claude.
>
> And you git-ignore any local settings by default, to prevent accidental leaks. It is not hard thing to learn, many juniors I interviewed know this. Developers who like to shoot themselves in the legs should pay the price. People who hire careless workers and do not put them in compliant environment should pay the price too.

---

## Cite

- Page: https://zeli.app/story/50407882
- Date: 2026-11-07
- Source: apiiro.com (https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again)
- Hacker News: https://news.ycombinator.com/item?id=50407882

## Other languages

- zh: https://zeli.app/zh/story/50407882 · markdown: https://zeli.app/zh/story/50407882.md
- ja: https://zeli.app/ja/story/50407882 · markdown: https://zeli.app/ja/story/50407882.md
- ko: https://zeli.app/ko/story/50407882 · markdown: https://zeli.app/ko/story/50407882.md
- de: https://zeli.app/de/story/50407882 · markdown: https://zeli.app/de/story/50407882.md
- es: https://zeli.app/es/story/50407882 · markdown: https://zeli.app/es/story/50407882.md
- ru: https://zeli.app/ru/story/50407882 · markdown: https://zeli.app/ru/story/50407882.md
