Earlier quoted context omitted.
What if the LLM detects this, and chooses to run /bin/rm directly? Or worse, writes a program that calls unlink.
I mean, you can always purge /bin/rm, but at this point since you're not satisfied, sounds like you want SELinux ;) If Claude is writing a program to go that low level I'd pay money to watch that.
Running Claude Code dangerously (safely)
151–160 of 265 posts
Re: Running Claude Code dangerously (safely)
#152Earlier quoted context omitted.
I happen to use a Mac, even when targeting Linux so I'd have to use a container or VM anyways. It's nice how lightweight bubblewrap would be however. Consider one wanted to replicate the human-approval workflow that most agent harnesses offer. It's not obvious to me how that could be accomplished by dropping privileges without an escape hatch.
It being deprecated and all, didn't feel like wrapping it, but macOS supposedly has a similar `sandbox-exec` command ...
And I think that what CC's /sandbox uses on a Mac
Re: Running Claude Code dangerously (safely)
#153> What you’re NOT protecting against: > a malicious AI trying to escape the VM (VM escape vulnerabilities exist, but they’re rare and require deliberate exploitation) No VM escape vulns necessary. A malicious AI could just add arbitrary code to your Vagrantfile and get host access the first time you run a vagrant command. If you're only worried about mistakes, Claude could decide to fix/improve something by adding a…
ec2 node?
Re: Running Claude Code dangerously (safely)
#154Re: Running Claude Code dangerously (safely)
#155If your system were under version control, so that Claude could do whatever it wanted on its own branch, so to speak, would it still be such a big problem? Because you could just roll back if it really did cause problems, couldn't you?
Re: Running Claude Code dangerously (safely)
#156(Maybe I should be asking Claude this)
Edit: someone already built this: https://github.com/neko-kai/claude-code-sandbox
Re: Running Claude Code dangerously (safely)
#157I just gave it its own user and dir. So I can read and write /agent, but agents can't read or write my homedir. So I just run agents as the agent user. I don't need it to have root though. It just installs everything locally. If I did need root I'd probably just buy a used NUC for $100, and let Claude have the whole box. I did something similar by just renting a $3 VPS, and getting Claude root there. It sounds bad bu…
Claude gets all the packages it needs through Guix.
Re: Running Claude Code dangerously (safely)
#158I've been exploring this space. There are some use cases where I'd love to run an isolated Claude agent asynchronously. I think running Docker in rootless mode might solve some of the OP's concerns—I believe Podman does this implicitly. Also, there are tools like Kaniko that does not need Docker to create container images. You can also try changing the underlying container runtime to something like gVisor if you want…
The idea is to simply use the runtime flag (after kata install):
docker run -d --runtime=kata -p 8080:8080 codercom/code-server:latest
Hope this works, with this I could keep my existing docker setup.
Re: Running Claude Code dangerously (safely)
#159Earlier quoted context omitted.
I mean, you can always purge /bin/rm, but at this point since you're not satisfied, sounds like you want SELinux ;) If Claude is writing a program to go that low level I'd pay money to watch that.
It doesn't even need to go that low level, writing a program is just the worst case. There are ways to mass delete without `rm`. Example: `find` with the `-delete` flag.
Re: Running Claude Code dangerously (safely)
#160Earlier quoted context omitted.
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: