logoalt Hacker News

Running Claude Code dangerously (safely)

285 pointsby emilburzoyesterday at 11:58 AM233 commentsview on HN

Comments

jannesblobelyesterday at 4:45 PM

If 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?

show 1 reply
svilen_dobrevyesterday at 7:49 PM

can't it generate a program that (generates a program that)+ does whatever? in different languages, and in increasing level of dereferencing..

industrially-making-exploits.. : https://news.ycombinator.com/item?id=46676081

denysvitaliyesterday at 1:09 PM

Here's what I do (shameless plug): https://blog.denv.it/posts/im-happy-engineer-now/

This allows you to use Claude Code from your mobile device, in a safe environment (restricted Kubernetes pod)

show 1 reply
letmetweakityesterday at 12:49 PM

I run Claude in a Proxmox VM, generally the experience has been great. In my experience it also behaves better than gemini cli, that likes to create files all over the place if set loose (lesson learned to add that requirement to the relevant .md files)

show 4 replies
frankcyesterday at 1:23 PM

I think this makes sense but I wonder if firecracker would work better than vagrant for this? I haven't used it before, though. I guess it might if you are trying to run gas town level orchestration.

show 1 reply
skybrianyesterday at 12:48 PM

I'm doing this with a remote VM on exe.dev and it's quite nice. Well, actually with their own coding agent but they have Claude Code preinstalled too.

Syncthing works well for getting a local copy of a directory from the VM.

messhyesterday at 7:14 PM

the shellbox VMs work great as sandbox for Claude-Code. It uses ssh to create and connect to the boxes -- very simple and quick to setup

check it out: https://shellbox.dev

tobyhinloopenyesterday at 12:46 PM

How about running Claude as a different user with very limited permissions?

show 3 replies
RobinLyesterday at 1:21 PM

Does anyone have direct experience with Claude making damaging mistakes in dangerously skip permissions mode? It'd be great to have a sense of what the real world risk is.

show 7 replies
csantiniyesterday at 2:20 PM

Just create a new user and setup pip/npm to install locally.

And setup an .env for the project with user/password to access only a dev database.

marcelcoryesterday at 3:44 PM

I'm a fan of https://e2b.dev/

woofyesterday at 3:06 PM

sandbox-exec on MacOS (ie. https://github.com/neko-kai/claude-code-sandbox) seems like the perfect solution to me.

Missing FreeBSD jails in 2026 is kind of weird (hello 1999)...

alphax314yesterday at 9:39 PM

Am I the only one who has setup notifications in the terminal so when claude is done and asks for a permission or whatever else it might need the terminal has a red dot and is bouncing? I go back to it respond in two seconds and then switch back to whatever I was doing. It doesnt feel that disruptive that I would want to run it with the —dangerous flag.

mhbyesterday at 2:17 PM

Forgive a naive question, but why not run it on an AWS (or equivalent) instance?

Retr0idyesterday at 1:44 PM

> 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™

show 1 reply
jackcarteryesterday at 3:14 PM

"At some point I realized that rather than do something else until it finishes, I would constantly check on it to see if it was asking for yet another permission, which felt like it was missing the point of having an agent do stuff"

Why don't Claude Code & other AI agents offer an option to make a sound or trigger a system notification whenever they prompt for approval? I've looked into setting this up, and it seems like I'd have to wire up a script that scrapes terminal output for an approval request. Codex has had a feature request open for a while: https://github.com/openai/codex/issues/3052

show 1 reply
cyberpunkyesterday at 2:27 PM

docker sandbox run claude? seems to work for me…

szmarczakyesterday at 2:23 PM

What about Docker rootless?

firasdyesterday at 1:04 PM

I noticed something in Claude across all product surfaces

There's a bug in that it can't output smart quotes “like this”

Sonnet, Opus et al think they output it but something in the pipeline is rewriting it

https://github.com/firasd/vibesbench/blob/main/docs/2026/A/t...

Try it in Claude Code and you'll see what I mean! Very weird

ompogUe01/13/2026

Keeping in mind with Vagrant: if you are using a synced_folder in your host as a source folder in the VM, those files in the synced_folder will be modified on the host.

show 3 replies
athrowaway3zyesterday at 1:15 PM

`useradd claude`

show 1 reply
naileryesterday at 4:48 PM

Don't all modern OS's have sandboxing? We don't need a full VM (eg, kernel running on virtualized hardware) and the complexity that entails, we just need Claude Code running in the sandbox.

(Maybe I should be asking Claude this)

Edit: someone already built this: https://github.com/neko-kai/claude-code-sandbox

supermattyesterday at 2:12 PM

> now you need Docker-in-Docker

Or you can just mount the socket and call docker from within docker.

show 1 reply
guluarteyesterday at 5:23 PM

docker has sandboxes for this https://docs.docker.com/ai/sandboxes/

docker sandbox run claude

oofbeyyesterday at 3:39 PM

There are two spheres of influence you need to consider. The local machine/vm/container that the agent is running in. But also the effect the agent can have on the outside world - using auth tokens or ssh keys or apis that is has access to. This article largely deals with the first problem and ignores the second.

You can have the local environment completely isolated with vagrant. But if you’re not careful with auth tokens it can (and eventually will when it gets confused)go wipe the shared dev database or the GitHub repo. The author kinda acknowledges this, but it’s glossing over a big chunk of the problem. If it can pus to GitHub, unless you’ve set up your tokens carefully it can delete things too. Having a local isolated test database separate from the shared infrastructure is a matter of a mature dev environment, which is a completely separate thing from how you run Claude. Two of the three examples cited as “no, no, no” are not protected by vagrant or docker or even EC2. It’s what tokens the agent has and needs.

show 1 reply
MORPHOICESyesterday at 10:16 PM

[dead]

Lucasjohnteeyesterday at 1:09 PM

[dead]

nirdiamantyesterday at 1:12 PM

[flagged]