by orliesaurus · 11mo ago · 0 comments
The `--dangerously-skip-permissions` flag does exactly what it says. It bypasses every guardrail and runs commands without asking you. Some guides I’ve seen stress that you should only ever run it in a sandboxed environment with no important data Claude Code dangerously-skip-permissions: Safe Usage Guide[1].
Treat each agent like a non human identity, give it just enough privilege to perform its task and monitor its behavior Best Practices for Mitigating the Security Risks of Agentic AI [2].
I go even further. I never let an AI agent delete anything on its own. If it wants to clean up a directory, I read the command and run it myself. It's tedious, BUT it prevents disasters.
ALSO there are emerging frameworks for safe deployment of AI agents that focus on visibility and risk mitigation.
It's early days... but it's better than YOLO-ing with a flag that literally has 'dangerously' in its name.
[1] https://www.ksred.com/claude-code-dangerously-skip-permissio...
[2] https://preyproject.com/blog/mitigating-agentic-ai-security-...
That was the last time I ran Claude Code outside of a Docker container.
That said running basic shell commands seems like the absolute dumbest way to spend tokens. How much time are you really saving?
No thanks, containers it is.
"Read" is not at the top of my list of fears.
I self-hosted DevPods and Coder, but it is quite tedious to do so. I'm experimenting with Eclipse Che now, I'm quite satisfied with it, except it is hard to setup (you need a K8S cluster attached to a OIDC endpoint for authentication and authorization, and a git forge for credentials), and the fact that I cannot run real web-version of VSCode (it looks like VSCode but IIRC it is a Monaco fork that looks almost like VSCode one-to-one but not exactly it) and most extensions on it (and thus limited to OpenVSIX) is a dealbreaker. But in exchange I have a pure K8S based development lifecycle, all my dev environment lives on K8S (including temporary port forwarding -- I have wildcard DNS setup for that), so all my work lives on K8S.
Maybe I could combine a few more open source projects together to make a product.
What I've done is write a PreToolUse hook to block all `rm -rf` commands. I've also seen others use shell functions to intercept `rm` commands and have it either return a warning or remap it to `trash`, which allows you to recover the files.
One obviously safe way to do this is in a VM/container.
Even then it can do network mischief
I could certainly see it happening in a VM or container with an overlooked mount.
Why special-case it as a non-human? I wouldn't even give a trusted friend a shell on my local system.
Another way to prevent this is to run a filesystem snapshot each mutation command approval (that's where COW based filesystems like ZFS and BTRFS would shine), except you also have to block the LLM from deleting your filesystem and snapshots, or dd'ing stuff to your block devices to corrupt it, and I bet it will eventually evolve into this egregiously.
AI is either an untrustworthy tool that sometimes wipes your computer for a chance at doing something faster than you would've been able to on your own, or it's no faster than just doing it yourself.
This is extremely disconnected from reality...
With Claude the basic command filters are pretty good and with hooks I can go to even more granular levels if needed. Claude can run fd/rg/git all it wants, but git commit/push always need a confirmation.
That way it doesn't need to go outside of it
I am! To the point that I don’t believe it!
You’re running an agentic AI and can parse through logs, but you can’t sandbox or back up?
Like, I’ve given Copilot permission to fuck with my admin panel. It promptly proceeded to bill thousands of dollars, drawing heat maps of the density of built structures in Milwaukee; buying subscriptions to SAP Joule and ArcGIS for Teams; and generating terabytes of nonsense maps, ballistic paths and “architectural sketch[es] of a massive bird cage the size of Milpitas, California (approximately 13 square miles)” resembling “a futuristic aviary city with large domes, interconnected sky bridges, perches, and naturalistic environments like forests, lakes, and cliffs inside.”
But support immediately refunded everything. I had backups. And it wound up hilarious albeit irritating.
> I am! To the point that I don’t believe it!
> You’re running an agentic AI and can parse through logs, but you can’t sandbox or back up?
When best practices for using a tool involves sandboxing and/or backing up before each use in order to minimize the blast radius of using same, it begs the question; why use it knowing there is a nontrivial probability one will have to recover from it's use any number of times?
> Like, I’ve given Copilot permission to fuck with my admin panel. It promptly proceeded to bill thousands of dollars ... But support immediately refunded everything. I had backups.
And what about situations where Claude/Copilot/etc. use were not so easily proven to be at fault and/or their impacts were not reversible by restoring from backups?
Because the benefits are worth the risk. (Even if the benefit is solely sating curiosity.)
I’m not defending this case. I’m just saying that every one of us has rm -r’d or rm*’d something, and we did it because we knew it saved time most of the time and was recoverable otherwise.
Where I’m sceptical is that someone who can use the tool is also being ruined by a drive wipe. It reads like well-targeted outrage pork.
> Because the benefits are worth the risk. (Even if the benefit is solely sating curiosity.)
Understood. I personally disagree with this particular risk assessment, but completely respect personal curiosity and your choices FWIW.
> I’m not defending this case. I’m just saying that every one of us has rm -r’d or rm*’d something, and we did it because we knew it saved time most of the time and was recoverable otherwise.
And we then recognized it as a mistake when it was one (such as `rm -fr ~/`).
IMHO, the difference here is giving agency to a third-party actor known to generate arbitrary file I/O commands. And thus in order to localize its actions to what is intended and not demand perfect vigilance, having to make sure Claude/Copilot/etc. has a diaper on so that cleanup is fairly easy.
My point is - why use a tool when you know it will poop all over itself sooner or later?
> Where I’m sceptical is that someone who can use the tool is also being ruined by a drive wipe. It reads like well-targeted outrage pork.
Good point. Especially when the machine was a Mac, since Time Machine is trivial to enable.
EDIT:
Here's another way to think about Claude and friends.
Suppose a person likes hamburgers and there
was a burger place which made free hamburgers
to order 95% of the time. The burgers might
not have exactly the requested toppings, but
were close enough.
The other 5% of the time the customer is punched
in the face repeatedly.
How many times would it take for a person getting punched in the face before they ask themself before entering the burger place if they will get punched this time?I noticed the nonsense due to an alert that my OneDrive was over limit, which caught my attention, since I don’t use OneDrive.
If I prompted a half-decent LLM to run up billables, I doubt I could have done a better job.
I like Kagi’s Research agent.
Personally, I was curious about a technology and ready for amusement. I also had local backups. So my give a shit factor was reduced.
Sounds like really throwing caution to the wind here...
Having backups would be the least of my worries about something that
"promptly proceeded to bill thousands of dollars, drawing heat maps of the density of built structures in Milwaukee; buying subscriptions to SAP Joule and ArcGIS for Teams; and generating terabytes of nonsense maps, ballistic paths and “architectural sketch[es] of a massive bird cage the size of Milpitas, California (approximately 13 square miles)” resembling “a futuristic aviary city with large domes, interconnected sky bridges, perches, and naturalistic environments like forests, lakes, and cliffs inside.”
It could just as well do something illegal, expose your personal data, create non-refundable billables, and many other very shitty situations...