629 points · by shmulc · 4w ago · 433 comments
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)
My view is that if the agent can decide to do something, nothing stops that thing from being done accidentally, and any attacker that can inject text into its context can do that thing.
I definitely prefer auto-mode to the granularity of prompts I was getting from Claude. But I also want to be able to use deterministic rules, and Claude Code's functionality for it sucks.
This is an absolutely crazy statement without also bundling proper sandboxing. Nobody should be using auto mode outside of an environment they'd be happy with an 'everything is approved' mode too.
The fuck we will give free reign to Claude to vibe what's secure and what's not and what it can't do.
I want fully static control over certain folders. Permissions rules should be ABSOLUTELY enforced sandboxing (even without the user bothering with custom sandboxing themselves) on top of any mode, manual or auto.
Built my own with Apple's (to be "deprecated") seatbelt backend, which I think anthropic also uses, with a much nicer interface, easy per working project setup, etc.
Whereas that should probably be default on instead, and this should apply to other known sensitive folders. A simpler system like .agentignore would be even better.
I like auto mode but "the agent supervises itself" is a bad compliance/safety answer on its own.
I appreciate that you're trying to make Claude Code safer, but the agent really needs to be a lot more restricted in its reach rather than its actions.
The agent should NOT have ANY access to:
- Your ENV
- Your homedir
- The network at large
- ANY other directory on your system
- No, not even your workdir.
The only safe way to use an agent is COMPLETELY isolated by a container or VM, using git semantics to extract its output.
But even that wouldn't be enough because LLMs are nondeterministic, and these kinds of issues are the inevitable results.
Only a mechanical, deterministic failsafe can protect you from it.
But now I am doing all my software development back inside ephemeral VMs, AI or otherwise - the UX there is much better, I significantly mitigate supply-chain attack risks, and agents are already constrained to a secret-less, low privilege environment, should I use them. There's a significantly higher likelihood of rogue software in third party dependency trees than there is in a small subset of programs you regularly use.
Claude Code doesn't even have a basic 'enqueue' prompt feature. Even though Copilot CLI, Codex and many other harnesses have had this for a long time now. And the GitHub feature request for this was closed, by you, referencing a completely unrelated feature.
This is called "approval fatigue".
If you think this can't possibly happen to you, you might be in for a surprise. This is an almost textbook case of classic conditioning. You'll find yourself hitting that button faster and faster even while fighting back the urge. So a human is no guaranteed backstop.
This is the scenario that cc auto mode guards against. It cuts down the number of permission prompts to something manageable, so that your fingers don't get trained into clicking 'approve' on 'rm -rf' in the very eyeblink that it appears.
So maybe you feel it doesn't work in theory; but weirdly enough, in practice this particular approach is actually one of the better ones; especially when used in combination with other common sense measures where practical.
With e.g. VM or container sandboxing, we can say things like "If there are no vulnerabilities in the hypervisor or hardware, then the agent can only access these files, these network services, etc". Auto mode doesn't even try to provide any guarantees, so it's impossible to reason about. It amounts to just using the models judgment about what's "malicious" or not, a definition which is subjective, changes model to model, and can be influenced by attacker input.
Empirical evaluations of how many vulnerabilities manual vs auto mode let through are not super meaningful because auto mode changes dramatically with model releases, the type of task being performed, whether the attacker is making targeted attacks designed to bypass auto mode, etc. A security feature cannot rely on these sorts of factors if it's to be taken seriously.
Further, percent of malicious tool calls accepted is a bad metric. It's like measuring the security of ssh in terms of what percent of unauthenticated logins succeed. The only acceptable value is zero. It's pass/fail, not a spectrum. So both auto and manual mode should fail equally here. Further, the set of malicious tool calls admitted in auto mode may not be a subset of those admitted in manual mode.
Doesn't matter, that would be on me.
It's also a false dillema. Those aren't the only options. A strictly enforced sandbox with sane defaults (for example ~/.ssh), that acts as a hard OS level limit, and not just as a suggestion to the agent, would not have "approval fatigue".
But this is the downside. It might be fine 99% of the time, but 1% of the time you get a critical secret published to GitHub, even after human review.
Is this even worse than what us humans did on our own before LLMs? I’m not sure. It’s not like secrets never got accidentally committed before, it just illustrates the new paradigm we’re working in.
Either you let your agents run wild, and you cross your fingers that they don’t do anything bad, or you need to accept that your new job is to be an agent babysitter, and audit every command.
Rather what has happened is that I have gotten very good at scanning what it is trying to do and know within a second or two whether there is anything fishy I need to look at more closely.
And by "fishy", I do not mean only security issues, but also architecture, code, etc issues. Sometimes it even adds unrelated unapproved changes to what it is supposed to be working on, and I stop it.
And I'm glad I work this way, because countless times I have stopped it from going down a path that is nonsensical or I strongly dislike.
There are techniques I have adopted to speed up working this. Sometimes I allow Claude to make larger changes at once, to batch several changes at once, etc. But these decisions are under my control.
I prefer to work this way than to wade through enormous PRs trying to wrap my head around what was done, where I am likely to just give up and approve it after a cursory review.
Many of the problems when it comes to the manual approval feel like they stem from the expectation of using auto mode in the first place. After all, what's the point of improving the manual approval and safety matching if auto mode is the end all be all, and what's the point of training the model to output commands in a manner that can be parsed by a human if auto mode is always meant to be used? It's very rare for me to not see "command could not be statically analyzed", because the model keeps outputting bash golf.
Or even reject anything auto mode rejects while still allowing the user to reject things auto mode accepts. If what's approved is the intersection of what the user is approving and what auto mode thinks is safe then it would be strictly safer than either mode alone.
This would also be a way for users to gain confidence in auto mode before going all in on it.
- from the linked article
Ideally I would never use Claude at all outside a disposable container, even on a box with no sensitive information and with the sandbox enabled. It's like having an attacker breach your system — you don't know what it did.
"Measuring the Permission Gate: A Stress-Test Evaluation of Claude Code's Auto Mode" https://arxiv.org/abs/2604.04978
(Shared by hkalbert71 the other day in: https://news.ycombinator.com/item?id=50387838)
Meanwhile I have seen it rejecting perfectly safe commands.
It is a worse version of YOLO mode.
If the command is explained, and then we get a chance to edit it, maybe make the rm -rf into a mv; give us UI to edit the filter being applied. I have no problem hitting "Always allow" so claude can run "git status --flags a/b/c/filename" but as a human, I'd like to be able to edit the permission blanket to be "git status *.
Which I can do manually specify in the config file, but that's annoying. I'm fully capable of opening my terminal app and editing that in vim, but I'd rather not have to. It's like this for every project too. If I start fresh on a new machine, new Claude account, how much do I need to redo?
What if the 'settings' being described here aren't 'project settings' they're 'personal settings for the project'.
I imagine we're following dev ecosystem conventions where everybody puts their tool settings in the project folder so they know where to find it and can share it; but are agent directives like this closer to a 'tool', or closer to a 'contributor'?
If the latter, I wouldn't expect to see "Joe's personal list of naughty and nice commands" in my project files either, certainly not under 'settings'. So just don't put them there.
I ended up having to build a full shell argument decomposition and parser, with it I can manage allow list of rich tree structured commands. Centralizing a curated collection of known command structures and their side effects would help a lot. I don't know if Claude does this already, but it doesn't work with things like `gcloud` from my experience, and that has resulted in it slurping secrets (even a partial read I've had to rotate keys for).
Claude uses bigquery in the command line by piping sql files from /tmp into the `bq` command. I had Claude create a hook that expands the SQL file into the permission prompt giving me a real chance to review these, but the TUI truncates long commands with no scroll option. Making that the default behaviour and adding a pager would allow better review of lots of executable scripts.
As long Claude is running as the user's account there's no guarantees. An approach like 1password's `op read` to physically separate secrets from repo read access and printing would he helpful (as in, make sure that no standard key formats can be ingested into the agent's context or logging).
Again, I don't know if any of these are implemented, they've very likely to have been tried by the Claude team, but maybe there's a long shot chance that it helps.
$Trillion AI company asking for ideas from the community whose work they hoovered up to make money, ruin an entire industry and make lifetimes of hard earned skill completely valueless in the span of 2 years.
Along with how Claude checks it in.
Obviously I've not given this enough design thought, but some means of providing an agent stand in secrets that cannot be used in other contexts would be a big improvement for trustability in things like cc.
Claude respects nothing, especially in auto mode, and effectively behaves like a virus trying to get out of its sandbox. That Anthropic employees are so relaxed about it is incompetence.
Imagine people who naively run Claude natively on their host machine and have client lists in other directories.
Recent GPT and Claude models have this tendency of using super complex Bash commands. This makes sense, if your RL rewards optimize for min(tokens) and max(performance), it is better to waste a few tokens on a complex inline Bash script that runs a few commands at a time and returns just the output you need, rather than doing one simple command per turn and paying the cache read on every turn, like older models used to do.
This, however, is a problem both for command reviewability and sandboxing. With the older way of doing things, without auto mode, most commands would run sandboxed just fine (especially in Codex), and you would only be asked for approval when a command couldn't run in the sandbox. With everything being stuffed into one complex script, almost every script fails in the sandbox and requires you to manually approve it, and the complexity of the script makes it hard to understand what you're actually approving.
In other words, new models optimize for effectiveness, with some attention paid to human understandability of their output, but almost no attention paid to human understandability of tool call arguments (Bash, inline Python). This suits auto mode and giving the model larger tasks, but not the way of working that some people prefer where you watch over the model's shoulder.
More and more I feel like I'm fighting Claude: it edits multiple files using python scripts and it edits in parallel so if I stop it, I have to stop each individual edit. Both of which I've told it not to do repeatedly, but it still does then apologies which is worse.
Even if I could follow them I would also prefer it use the edit tool, since I find Claude also introduces lots of "minor" changes I did not ask for when it rewrites code in bulk.
This instruction is in my toplevel CLAUDE.md but is somehow generally ignored.
Would love to hear the rationale/explanation behind this.
What I'd love is for Auto Mode to show the full diffs one-by-one as they're being implemented in the CLI (or VS Code).
On top of that, an option where Claude explains what it's doing in every step, as if you're watching someone talk while they implement a coding challenge, would be really helpful (and would also reduce interrupting it when it looks like it's deviating from the Plan).
The use-case this would support is to have a full understanding and confidence in what Claude is doing while it's implementing a Plan in Auto Mode. The reason is that it's much less tiring/overwhelming for me to follow along an implementation compared to reviewing a giant PR after the fact, and it's helped reduce my coding fatigue by a lot.
Edit Tool:
Currently I tell it to use the Edit tool because it doesn't reliably show the diffs in Auto Mode (I have the latest version; I've sent numerous feedback reports on this), and later in a session (when implementing my feedback) it will often make multiple edits in some unreadable bash command. So my only option to see the full diffs during implementation and to have it explain/break down bash commands is to go into Manual Mode.
Documentation & Comments:
Even with an initial prompt instructing it so, Claude always needs to be interrupted so that it will rewrite comments to something readable to humans.
While very long "technical"/Claudish paragraph comments and MD files might work for future Claude's (and improve benchmarks/coding scores by making implementations technically more comprehensive), my goal is that a human coder should be able to understand how the codebase (React/Node/Python/Polars) works by reading on their own rather than needing their own AI to summarize everything.
I've even seen it rewrite existing human-written concise comments into blocks of Claude-ish, as if it's trying to make everyone dependent on it in order to do anything to the codebase.
I wonder if an optional built-in skill could help improve this, as I admit I haven't experimented with building any of my own (my concern with customizing Claude.md is to not overload it with too many instructions; I'm on vanilla Claude Code). Note: This is all on Fable on xhigh.
BTW, I just checked and my .gitignore files ignore .claude
Claude and any other program in my laptop could upload it anyway to any attacker controlled server. It's the usual threat analysis: who you want to defend against, what and the tradeoffs between cost of the defense and probability of the attack. Auto mode of not auto mode is in the cost of defense part IMHO.
Their "auto mode rules", meant as additional rules described in natural language to adjust auto mode because, doesn't even help. I have to add a PreToolUse hook to stop that.
Claude will have auto mode turned on whenever she's locked down on a meticulously isolated machine, with carefully managed proxies that I control deciding (and logging) which agent with which access patterns is allowed to access which resources, locally and on the network. Anything else is malpractice.
My opinions do not represent those of my erstwhile employer NVIDIA Corporation.
That's a feature not a bug
1. After a command is blocked, run /permissions to retry and allow it going forward
2. More deeply configure the classifier itself: https://code.claude.com/docs/en/auto-mode-config
We are working on making these easier and more automated.
I frequently hit stop on and auto mode task to prevent it from completely flooding my context with some completely unrelated garbage.
Claude really should push away tasks that end up needing more exploration in worker contexts. That way the workers can maintain a sensible amount of context without pushing the main chat into the dumb region.
I... question whether the second one is perfectly safe.
Agents should be seen as extremely smart developers that are for sure spies.
You put them in a prison within a prison and give them just what they need to accomplish their work.
Perhaps Claude Code isn't the product you are looking for then? Anthropic offers Claude Managed Agents if you want to follow the prison within a prison model.
No?
All issues will be fixed today.
No?
It's early days, the models will improve and fix all issues.
Dumb if you don’t turn on auto-mode, dumb if auto-mode commits .claude.
No way to hold it right I guess?
If it's keys or secrets of any kind, you're even dumber.
If it's in a hidden directory, you are even dumber still.
If you rely on somebody stupid enough to do any of that not to commit it, you have gone beyond the valley of the ultra-dumb. Actually that's true even if you rely on smart people not to do it.
You got your dumb card fully punched when you created `.keys` to begin with.
and teach Claude to not git add .
While we're at it, maybe we can also discourage the spurious use of -f for rm -- me personal pet peave
It already doesn't do this. This is from users committing the `.claude` directory themselves.
> Ask Claude Code to check a database or call an API, and the command it proposes carries the secret from your config file. It asks before running it. Pick "Yes, and don't ask again" and it saves that exact command, secret included, to .claude/settings.local.json inside the project folder. Nothing in the repo marks that file as private, so it gets committed with the rest of the code.
Why are these repos not gitignoring the .claude folder?
Although, I feel that it would make more sense to not have a .claude folder inside of the project to begin with. Instead use the ~/.claude/porject/<project_path> folder, like you do for the memory files to store anything related to the project. This solves the problem and at the same time is a cleaner architectural choice in my opinion.
Boris, this comes off as incredibly tone deaf. I don’t want to trust the machine. Trusting the machine is how we end up here. I want to specify exact, deterministic rules that are always followed.
> "but we are looking into what we can do to prevent this"
I would presume that CC's auto-review of tool-call turns would already solve this >99% of the time, no? From my read, any harness-side deterministic solution here would be saving the user from themselves, which seems like a bad pattern. Somewhat dulling the scalpel in my mind.
If we've already crossed the bridge to being confident in a non-deterministic reviewer for auto-mode, then, I see no obvious reason as to why we couldn't have the proposed rules be generated by a model. If that were reality, then- all rules placed in settings.local could be secretless, with the confidence of whatever model we tell 'make sure the rule does not contain secret material, consider its destination as potentially public'.
[1] https://code.claude.com/docs/en/permissions#wildcard-pattern... AFAICT, CC will either save off a prefix+wildcard rule, or exact command. Sounds like the former is likely not the cause of the problem here.
This is bullshit.
I'm one of the people who actually reads the commands, and it doesn't always get stuff right. Please don't delude yourself into thinking "auto mode" is some magic that's the right fit for everyone and every situation.
Okay, sorry, I am out. It's too beautiful a day to have silly arguments.
Use this instead for free https://github.com/awslabs/git-secrets
This is such a typical blame the user response. You realize if I’m a sysadmin managing fleets of machines, this is an actual wake up in a cold sweat nightmare, even if those files never leave disk? In the past it was less a big deal, way bigger now that your machine god will just download packages and libs that have upstream malware that aggressively scans the file system for stuff like this. guess where it’s going to look first?
have more humility. jesus.
If only tools, including major ones, actually did that. Plenty of the biggest package managers in the world still write API keys in plain text to files. uv and npm are two of them.
claude unleashed on an organization is a whole other beast.
Instead of telling people they're holding it wrong, make it safe to be held however they could hold it.
Wait, I'm confused. You said yourself coding was solved, surely all you need to do is ask your AI God to come up with an idea, right?
You should be careful about trying to dictate what your customers are doing. They may understand security, and PR for that matter, better than you do. The current evidence makes that certain in many cases.
I’m wondering if it’s just me or does this response sound like it’s coming from someone who is out of touch with the reality of how people are using their product and instead of being empathetic, curious, and helpful is telling people in so many words it’s not our fault, you’re doing it wrong and “everyone” should be doing it the “right” way, which is how we do it.
I know it might come as a shock but not everyone who uses product has read the docs.
Also there is arguably nothing about using AI harnesses that’s “old hat” The technology came on the mainstream radar this year. Most people who use harnesses are still figuring out how to use them. And the rest of humanity probably doesn’t even know what the terms means.
Rather than telling everyone how they got it wrong, maybe next time you can elaborate on something like what “we are looking into what we can do to prevent this” means.
For the record, besides finding Claude overzealous and Anthropic’s usage limits relatively stingy (at least back in April when I dropped them), it was the arrogance of Anthropic’s staff and their public pontificating that led me to rolling with Codex, Gemini, and Qwen as my model stack.
You have to wonder how much of the AI backlash is driven by people not feeling how industry insiders communicate with them.
Anyways, we need good homegrown AI solutions. So, I’m hoping Anthropic follows through on helping prevent future incidents. And the other labs are paying attention so their leadership aren’t the next ones on HN playing defense when their products get called out.
Ref: https://www.anthropic.com/research/investigating-unintended-...
No thanks.
"you are holding it wrong". No, it's not an excuse. Every mode should work correctly, or should not be selectable.
Then don't put it in the fucking tree, you idiots.
No, .gitignore is obviously not enough.
Then you can have it your way :))
i bet most of the commited ones were done by claude because nobody else us gonna care to make it
The linked docs have an unmistakable slop aura, with the extreme overuse of commas that recent models seem to love. I don't blame people for not referring to them (also because, you know, the whole thing with AI is not having to read, think, or understand for yourself)
More and more it seems we are being prescribed a particular way to use Claude Code: move fast, break things, do not look at the edits, etc. Basically, Claude Code is designed for vibe-coding.
I hate this, and I suspect a lot of devs do too. I use the TUI, and believe it or not, I like to review every edit or change before Claude makes it. I used to allow auto mode and don't ask again sometimes in the past, but now almost never do. The number of incredibly nonsensical things I catch Claude trying to do sometime just reinforced my commitment to this way of working.
So now this idea that permissions are old hat and auto mode is the way to go rubs me the wrong way, very much. And here are a litany of other ways Claude Code TUI is making it hard for me to work:
1. Scroll-back glitches, too numerous to enumerate. Suffice it to say I rely on it a lot, to refer back to something the agent said before, to review the general progression of the session, etc, etc. And it barely works now: missing/overwritten conversation text, messages that have inexplicably disappeared; even sometimes the agent own last response is garbled or hidden or overwritten by some previous message that keeps floating on top.
2. I use iTerm2 on macOS, and frequently use split panes. Whenever change the width of a pane, Claude Code messes up the conversation text so that is often unreadable, and nothing I do will restore it.
3. As other sibling comments have noted, the current preference of Claude to use incomprehensible scripts for editing files is off-putting and a hindrance to being in control of my work. I have resorted to using the permissions setting to ban it from using Go, Perl, Python, and sed (for in pace editing), etc, to cope with this.
4. Even basic text editing is messed up in Claude Code TUI. I used to be able to navigate around lines effectively by using up/down keys; this was removed, which has significantly impacted by work. I cannot disable copying on selection, which I don;t want, because if I disable it, the copying does not work at all, etc
At this point, due to all the impediments Claude Code places to my style of working, the only reasonable conclusion I can reach is: I am supposed to be vibe coding, letting the agents loose to vomit out massive amounts of slop. But if vibe coding of the Claude Code TUI itself is producing such garbage, why should anyone be convinced that it is a good thing?
I will never let Claude Code loose to do its thing; I will not surrender my control to it, no matter how much many times I hear I no longer need to look at code.
I don't mind. I put it out there for everyone to borrow ideas from it. There's documentation too.
While you're at it, please bring Claude Code up to par in Windows with the OS level sandboxing (Job Objects, AppContainer).
There are actually many things you can (and I think should) be doing.
And to recommend auto made to devs is absolutely crazy.
Have a nice day
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.
A fresh clone wouldn’t have the file. This claim doesn't make any sense.
The only way I can see this getting committed is if someone edited their global .gitignore or, more likely, did a whole directory transfer to do a different machine to work on.
Anyways this probably indicates that these repos don’t have a good code review process. The settings.local.json file name screams it’s local and shouldn’t be committed.
> Don't post generated text or AI-edited text. HN is for conversation between humans.
Also, it's wrong. Many people have since replied pointing out the basic error it made
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
Consider reframing. Is the problem really that the task is tedious? Or that it's required? Maybe you should be leaning more on deterministic automations (which the LLM can help set up) rather than LLM-powered ones.
- Research and buy me a domain name for xyz product, set up all of its DNS the way I want for this product, set up email, set up app store submissions including screenshots and description, set up firebase notifications, set up my Google cloud project and any apis I need to enable for this app, deal with app store review feedback.
- Do an audit of my books, make sure every transaction has a receipt uploaded, and make sure the receipt matches the journal entry. Pull statements from all my my bank accounts and reconcile against my books. Fix mistaken transactions with my confirmation.
- Freely push to my source control, but only to specific branch prefixes (surprised that GitHub, gitlab, gitea, etc don't have this built in already). Merge with my confirmation.
- Freely read the subject lines in my Gmail and full emails from my accountant, freely search emails (but still can't read them), freely compose drafts, ask me to read full emails other than my accountant's, ask me to send drafts. No way for it to read password reset links, for example.
Not to mention that I only have to have a single key that gives access to all my services. If the key leaks, I just have to rotate one key because the agent never has access to the 30 upstream service keys. If I need to give weaker or stronger keys for a specific agent, I can easily configure that in one place (and I can even request that the agent make that change for me with my confirmation). I don't need to create 20 new keys every time, and I don't need to remember the intricacies of every upstream service's UI for creating new keys.
Edit: forgot to mention one more really convenient thing the API proxy enables: I can ask my agent to just configure things for me e.g. changing CI settings, adding Google workspace users or groups, etc. without having to use the to UI. So now nearly all of the admin configuration for all services is done from a single interface (my agent cli)
For instance: that's a ton of surface area. Did you have your AI agent decide which endpoint is destructive or did you manually do this?
For instance: has this classification been wrong?
I ask this because I've used a similar thing before and it failed in the ways I've named.
This setup also permits your agent to exfiltrate enormously sensitive data (website gives the example of QuickBooks invoices and Cloudflare config) without your involvement.
And yes, it has tried to make bad requests! Which it wasn't able to do because it was either rejected outright or asked me for confirmation and I didn't let it through.
The "surface area" you're talking about is just the coverage of the service APIs, which is there just as a nicety to give a semantic preview of what the request is about to do e.g. we know what a gmail request looks like so we can render a preview of the attachment the agent is sending so you can inspect it. Otherwise you'd have to inspect each http request (which you can always do by using the generic http acl).
I somewhat agree with "exfiltrate enormously sensitive data". The thing I'm paranoid about is catastrophic mistakes that can instantly kill the business e.g. "Oops I sold the domain name". Leaking financials is not great, but also not catastrophic. Deleting all our books would be catastrophic, which the underlying QuickBooks key allows you to do!
But in any case, you can choose your level of paranoia and give exactly the amount of access you're comfortable with. For example, I view read access to emails as catastrophic (must worse than read access to financials), so I don't let it do that.
If you post output from AI, please remember to edit before publishing
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
https://news.ycombinator.com/item?id=45478553
https://codeberg.org/manchicken/1password-cli-vuln-disclosur...
Risk of exposing a single credential is nothing compared to the risk of exposing everything through op cli’s expected behavior. Has there been any improvement on this?
Belt and braces on top of that:
- add .claude/settings.local.json to a global gitignore (git config --global core.excludesFile), not just the repo's, so a fresh clone or `git add .` can't pick it up
- run a secret scanner like gitleaks as a pre-commit hook; it catches this and the classic .env commit
- if you find a hit, rotate first and clean history second. Once it's been public, deleting the file doesn't un-leak it.
Two rules that stuck for us: secrets go into commands only via env vars ($TOKEN, never the value), and .claude/ lives in the machine-wide global gitignore, not in the repo. With those, "Don't ask again" is fine and a commit has nothing to leak.
Example
``` # cat -A /tmp/foo/bar/baz.md
# permission options cat -A /tmp/foo/bar/baz.md cat /tmp/foo/bar/baz.md cat /tmp/foo/bar/* cat /tmp/* cat * ```
I'm sure there's improvements to make but I always found it silly to over complicate the permissions if I'm trying to prevent common operations from being prevented
Here's a few for Pi: https://pi.dev/packages/@k3_2o/pi-secrets https://pi.dev/packages/@spences10/pi-redact https://pi.dev/packages/keyshroud
A couple for OpenCode: https://github.com/boxpositron/envsitter-guard https://github.com/kenryu42/cc-safety-net https://github.com/inkdust2021/opencode-vibeguard
I always have it write a script and then write the secret to a different file myself, then instruct the agent to use the secret file in the script. That way the secret never goes through an external entity.
I had thought this was common sense but now I’m realizing of course it isn’t, we have people with minimal experience using these tools and they don’t even consider that sending their bank password (or whatever) to a third party (even a relatively trustworthy one) is extremely risky.
We released a free Secret Hygiene Skill, Node and git only and nothing sent anywhere, that checks your project, built npm package and machine for them, never prints a secret, and tells you what to rotate first: vektormemory.com/downloads.
> 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
Even then, you might not want every developer in your company to have the password to the production SQL database...
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.
Review your code before committing. Do code reviews on PRs.
secrets, encryption, publishing to public internet, scanning for vulnerabilities in your packages etc. etc. you need to take your own responsibility for and never rely on some bot automation or third party.
that includes if its important projects not relying on scanning tools but opening files yourself and verifying what's in there.
read things before you put them in a place where everyone can see them forever....
this is basic stuff. you guys did it beforen LLMs surely.
YOU are responsible. not Claude, not any external vendor, not any downloaded script. You as a person.
Sandbox don’t scale anymore and secrets or confidential files shouldn’t be exposed to frontier models.
I find it pretty annoying when someone commits their harness specific files into a repo - put that stuff under $HOME/.claude/
From the head of Claude Code, Boris Cherny
https://www.lennysnewsletter.com/p/head-of-claude-code-what-...
My comment is somewhat tongue in cheek: I know that Claude Code (and AI agents generally) do not mean the end of software engineering altogether, because I have been creating code with AI for a year, written a coding harness, and have non-coder colleagues who use said harness to create software.
But "where people get that from" is precisely from the same guy who is now saying "oh well, if you're going to commit your passwords then well!! you should know better than that!!"
I mean it'd be crazy if this worked:
https://github.com/search?q=path%3A**%2F.claude%2F*.json+CLI...
oh look..
> Often Claude commits the file itself. In 539 of the 1,105 repos with a real secret that we traced, a commit co-authored by Claude changed the file. Those commits name every recent model, from Sonnet 4.5 to Opus 5.5.
They violate it so regularly that my “git” command is now a wrapper, when the agent fucks up and tries to add/commit-all anyway, it now gets a nastygram error chiding it for not following instructions.
For all the same reasons they used it pre-LLM for hand-written toy projects.
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.
Same thing could/would happen with an open source harness.
> Often Claude commits the file itself. In 539 of the 1,105 repos with a real secret that we traced, a commit co-authored by Claude changed the file. Those commits name every recent model, from Sonnet 4.5 to Opus 5.5.
Could open source harnesses do that? Sure, if they were programmed in a similar fashion as Claude Code. Do you have any evidence of it happening?
None of this has anything to do with open vs. closed source.
Humans do it!