Live data from Hacker News

Running Claude Code dangerously (safely)

blog.emilburzo.com

61–70 of 265 posts

Re: Running Claude Code dangerously (safely)

#61

Here is what I do: run a container in a folder that has my entire dev environment installed. No VMs needed. The only access the container has are the folders that are bind mounted from the host’s filesystem. The container gets network access from a transparent proxy. https://github.com/dogestreet/dev-container Much more usable than setting up a VM and you can share the same desktop environment as the host.

I did this for a while, it's pretty good but I occasionally came across dependencies that were difficult to install in containers, and other minor inconveniences. I ended up getting a mini-PC solely dedicated toward running agents in dangerous mode, it's refreshing to not have to think too much about sandboxing.

I totally agree with you. Running a cheapo mac mini with full permissions with fully tracked code and no other files of importance is so liberating. Pair that with tailscale, and being able to ssh/screen control at any time, as well as access my dev deployments remotely. :chefs kiss:

Re: Running Claude Code dangerously (safely)

#62
post #25

Earlier quoted context omitted.

Until it decides to delete your home directory: https://old.reddit.com/r/ClaudeAI/comments/1pgxckk/claude_cl...

You can use the /hookify plugin to add hooks for preventing dangerous commands like this.

https://github.com/anthropics/claude-code/tree/main/plugins/...

So it's basically adding "don't delete my files pretty please" to the prompt?

EDIT: I misread, the natural language description of the rule is just a shortcut to generate the actual rule which is based on regexp patterns.

Still, it only protects you against very specific commands. Won't help you if the LLM decides to fill your disk with `cat /dev/urandom > foo` for example.

Re: Running Claude Code dangerously (safely)

#63
post #57

> VirtualBox 7.2.4 shipped with a regression that causes high CPU usage on idle guests. What are the odds. I have such a love/hate relationship with VirtualBox. It's so useful but so buggy. My current installation has a bug that causes high network latency, but I'm afraid to upgrade in case it introduces new, worse bugs. VMware is a million times better, but it is also Proprietary™

As VMWare Workstation is now free on Linux and Windows, and allows you to create and rollback snapshots. Why not use it even if proprietary?

Re: Running Claude Code dangerously (safely)

#64

Of course it depends on exactly what you're using Claude Code for, but if your use-case involves cloning repos and then running Claude Code on that repo. I would definitely recommend isolating it (same with other similar tools). There's a load of ways that a repository owner can get an LLM agent to execute code on user's machines so not a good plan to let them run on your main laptop/desktop. Personally my approach h…

In what situations where it require bare metal?

Re: Running Claude Code dangerously (safely)

#65
It's a practical approach, I used vagrant many years ago mostly successfully. I also explored the docker-in-docker situation recently while working on my own agentic devcontainer[0]- the tradeoffs are quite serious if you are building a secure sandbox! Data exfil is what worries me most, so I spent quite some time figuring out a decent self-contained interactive firewall. From a DX perspective, devcontainer-integrated IDEs are quite a convenient workflow, though docker has its frustrating behaviours

[0]: https://github.com/replete/agentic-devcontainer

Re: Running Claude Code dangerously (safely)

#67
I've been working on a TUI to make bubblewrap more convenient to use: https://github.com/reubenfirmin/bubblewrap-tui

I'm working on targeting both the curl|bash pattern and coding agents with this (via smart out of the box profiles). Early stages but functional. Feedback and bug reports would be appreciated.

Re: Running Claude Code dangerously (safely)

#68
post #57

> VirtualBox 7.2.4 shipped with a regression that causes high CPU usage on idle guests. What are the odds. I have such a love/hate relationship with VirtualBox. It's so useful but so buggy. My current installation has a bug that causes high network latency, but I'm afraid to upgrade in case it introduces new, worse bugs. VMware is a million times better, but it is also Proprietary™

As VMWare Workstation is now free on Linux and Windows, and allows you to create and rollback snapshots. Why not use it even if proprietary?

It's a good question and I'm pretty on the fence about it, and next time I'm reinstalling things I might switch.

I do believe in the whole RMS "respects the user's freedoms" spiel, so all things being equal I prefer FOSS, even if it's worse - but there are limits.

Re: Running Claude Code dangerously (safely)

#69

Of course it depends on exactly what you're using Claude Code for, but if your use-case involves cloning repos and then running Claude Code on that repo. I would definitely recommend isolating it (same with other similar tools). There's a load of ways that a repository owner can get an LLM agent to execute code on user's machines so not a good plan to let them run on your main laptop/desktop. Personally my approach h…

In what situations where it require bare metal?

In my case I was using Claude Code to build a PoC of a firecracker backed virtualization solution, so bare metal was needed for nested virtualization support.
Post reply on HN