The Claude Code secrets leak is a permissions problem, not a model problem
Apiiro published a piece that hit the top of Hacker News this week: Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files. The title tells most of the story. A convenience option in a coding agent, and more than a thousand public files with passwords in them.
The easy reading of the Claude Code secrets leak is "the AI did something dumb". I don't think that's the right one. The model didn't decide to publish passwords. A human clicked a button that said, more or less, trust this forever.
"Don't ask again" turns a one-time judgment into a standing policy. In the moment, the developer is probably right: yes, run this command, it's fine. But the approval doesn't stay in the moment. It sticks around, nobody looks at it again, and three weeks later it covers a situation the developer never thought about. That is a permissions design problem, and we have known how to think about permissions for a long time.
Secrets hygiene was always a process problem. When I was a tech lead doing daily code reviews on e-commerce sites with Stripe integrations, a key in the wrong file was not rare. What caught it was friction: a reviewer reading the diff, someone asking "wait, why is this here?". Not genius. Just a slightly annoying human in the loop.
Coding agents remove exactly that friction. That's the whole point of them, and I'm not against it. But if you remove the friction without replacing what it was quietly doing, you get 1,122 files. Coding agents security, for me, is mostly about putting back on purpose the checks that used to happen by accident.
So here is what I would set as team rules, before anyone argues about which model is safer:
- Scoped credentials. The agent works with keys that can do little and expire soon. Test keys in dev, never production ones.
- Pre-commit secret scanning. Not as a nice-to-have. Every repo, every machine, agent or no agent.
- Agent approvals treated like access grants. They get written down, reviewed, and they expire. If "don't ask again" means "until Friday", fine. Forever is too long.
The scanning part is cheap. With the pre-commit framework and gitleaks it's a few lines in .pre-commit-config.yaml:
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaksThen pre-commit install, and a commit with a password in it fails before it leaves the laptop. It catches the boring, common stuff, which is most of what leaks.
The third rule is the one teams will skip, because it feels like bureaucracy. But think about the same request from a new contractor: "Can I have permanent access to run anything I want in your repo?" Nobody says yes without a conversation. With AI coding agent permissions we say yes with one click, because the dialog appeared when we just wanted to get on with the task.
Tool makers are not off the hook. Defaults matter, and a button that grants permanent trust deserves more friction than one that grants it for a single run. But I wouldn't wait for them. Good developer security practices were never something a vendor shipped to you. They were rules a team agreed on and actually followed, mostly because someone in review kept asking annoying questions.
The agent will keep not asking. Somebody on the team still has to.