Live data from Hacker News

Running Claude Code dangerously (safely)

blog.emilburzo.com

91–100 of 265 posts

Re: Running Claude Code dangerously (safely)

#91
post #50

For deploying Claude Code as agent, Cloudflare is also an interesting option. I needed a way to run Claude marketplace agents via Discord. Problem: agents can execute code, hit APIs, touch the filesystem—the dangerous stuff. Can't do that in a Worker's 30s timeout. Solution: Worker handles Discord protocol (signature verification, deferred response) and queues the task. Cloudflare Sandbox picks it up with a 15min tim…

This sounds handy! Have you published any code by any chance?

Re: Running Claude Code dangerously (safely)

#92
post #72

I'm pursuing a different approach: instead of isolating where Claude runs, intercept what it wants to do. Shannot[0] captures intent before execution. Scripts run in a PyPy sandbox that intercepts all system calls - commands and file writes get logged but don't happen. You review in a TUI, approve what's safe, then it actually executes. The trade-off vs VMs: VMs let Claude do anything in isolation, Shannot lets Claud…

I'm struggling to see how this resolves the problem the author has. I still think there's value in this approach, but it feels to be in the same thrust as the built in controls that already exist in claude code.

The problem with this approach (unless I'm misunderstanding - entirely possible!) is that it still blocks the agent on the first need for approval.

What I think most folks actually want (or at least what I want) is to allow the agent to explore a space, including exploring possible dead ends that require permissions/access, without stopping until the task is finished.

So if the agent is trying to "fix a server" it might suggest installing or removing a package. That suggestion blocks future progress.

Until a human comes in and says "yes - do it" or "no - try X instead" it will sit there doing nothing.

If instead it can just proceed, observe that the package doesn't resolve the issue, and continue exploring other solutions immediately, you save a whole lot of time.

Re: Running Claude Code dangerously (safely)

#94
I'm currently building a Docker dev environment for VSCode (github.com/dg1001/xaresaicoder) usable in a browser and hit the same issue. Without docker-in-docker it works well - I even was able to add transparent proxy in the Docker network to restrict outbound traffic and log all LLM calls (pretty nice in order to document your project). For docker-in-docker development and better security isolation, I'm considering Kata Containers instead of Vagrant. Which gives me real VM-level isolation with minimum perf overhead, while still be able to use my docker stuff. Still on my TODO list though. Has anyone actually run Kata with vs code server? Curious about real-world quirks - I've read that storage snapshot performance can be rough.

Re: Running Claude Code dangerously (safely)

#95
post #11

Earlier quoted context omitted.

Something that contains Claude even more in this respect is if you explicitly gives it a directory that you tell it is entirely under its control, and tells it to write md files and other intermediate work products there (and this seems to work better than telling it where it isn't allowed to leave things).

I've often found that LLMs don't listen to "Don't do" commands with anywhere near the same gusto as "Do" commands.

People don't usually think about pink elephants, unless you ask them not to think about pink elephants :)

Re: Running Claude Code dangerously (safely)

#96
post #39
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're not running it on a filesystem that takes snapshots and is easily reversible?

Many moons ago, I accidentally rm -rf'd the wrong directory with all my code inside poof, gone. I still had PyCharm open, I checked its built-in version tracker and lo and behold, my code as it was before I rm -rf'ed up my code. I believe Claude has ways to undo file changes, but something like rm is just outside of its scope.

Re: Running Claude Code dangerously (safely)

#97
post #25
post #17

I have been running two or three Claude’s bare metal with dangerously skip permissions all day every day for two months now. It’s absolutely liberating.

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

This could be avoided by aliasing rm to something else that stops you from deleting stupid things like your entire home directory / partition root.

Re: Running Claude Code dangerously (safely)

#98

> now you need Docker-in-Docker Or you can just mount the socket and call docker from within docker.

Correct, which I wanted to avoid because:

> Mounting the Docker socket grants the agent full access to your Docker daemon, which has root-level privileges on your system. The agent can start or stop any container, access volumes, and potentially escape the sandbox. Only use this option when you fully trust the code the agent is working with.

https://docs.docker.com/ai/sandboxes/advanced-config/#giving...

Re: Running Claude Code dangerously (safely)

#99

Or...use wsl2 in windows. does the same thing - much much faster. Windows is the best (sandboxed) linux

Real question - are you not worried about access to /mnt/c ?

sudo chmod 700 /mnt/

sudo chmod $UID /mnt/

...done?

Post reply on HN