logoalt Hacker News

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

267 points • by shmulc • yesterday at 8:45 PM • 175 comments • view on HN

Comments

bcherny • yesterday at 9:13 PM

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)

➕ show 33 replies
Aurornis • yesterday at 9:08 PM

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.

➕ show 2 replies
tsergiu • today at 12:49 AM

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

tim-projects • today at 3:39 AM

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 • yesterday at 9:09 PM

This page is like 80% repeating itself

If you post output from AI, please remember to edit before publishing

➕ show 2 replies
binarymax • yesterday at 9:55 PM

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.

➕ show 2 replies
theapiartist • today at 2:46 AM

This could easily be prevented with credential management tools built specifically for ai agents.

Tools like AgentSecrets, infiscal, Doppler. People just don't want to invest in securing their credentials, maybe because the majority don't realize that credentials are the crux of inter software communication. It's literally access to your services.

qezz • yesterday at 9:06 PM

  > Is it public? 
  > 
  > Search your GitHub organization for .claude/settings.local.json and .claude/settings.json. Each hit is a file anyone can read right now.
So, it's not necessarily "public", it's simply in the repository, and whether it's actually public or not depends on the repository settings.

Or am I missing something

➕ show 2 replies
vcryan • today at 4:10 AM

This is also an example of how someone's personal settings don't belong in a source code repo at all.

I find it pretty annoying when someone commits their harness specific files into a repo - put that stuff under $HOME/.claude/

skeledrew • yesterday at 10:35 PM

According to Claude docs, settings.local.json isn't to be committed. This is just people being the usual sloppy with secrets in repos, not something particular to Claude or AI in general.

➕ show 1 reply
jedisct1 • yesterday at 9:11 PM

If you really need to commit private files to GitHub, use Turbocrypt https://github.com/jedisct1/turbocrypt/blob/main/docs/git.md

➕ show 1 reply
GeoAtreides • yesterday at 9:13 PM

"git add . " considered harmful

➕ show 3 replies
flufluflufluffy • yesterday at 9:18 PM

This just in checking your secrets into source control exposes your secrets!

GaryBluto • yesterday at 10:11 PM

People chose to upload a file containing their password and make it publicly accessible, I don't see a problem here.

system2 • today at 12:04 AM

I still don't understand why people are using GitHub for their vibecoded projects. Just install git locally on your own NAS and control it there. What a weird fetish to publish online.

➕ show 3 replies
semiquaver • today at 12:59 AM

The solution, ironically, is always run in YOLO mode

cluckindan • today at 12:42 AM

The irony that the article is written with Claude…

➕ show 1 reply
mococa • today at 12:29 AM

Plain text secrets? Super rookie mistake!

haifeng • today at 3:00 AM

[flagged]

fiveapi_dev • yesterday at 10:15 PM

[flagged]

sick_of_slop • yesterday at 10:31 PM

[dead]

fuckaiagi • yesterday at 11:34 PM

Why this fucking crapware is leaking secrets? It is not AGI yet?

➕ show 1 reply
rvz • yesterday at 9:11 PM

Vibe coders in open source proudly don't read the (slop)code and place all their agents in autonomous loops without them knowing that Claude leaked their passwords and environment variables on GitHub.

This incident would have been caught in an open source harness. This one is closed source malware, and you don't know what Claude Code does internally to behave like this.

Yet another reason why you cannot trust a closed harness.

➕ show 2 replies