Home / Agents

Safety

Is --dangerously-skip-permissions safe?

It's safe on a machine you can afford to lose, and risky anywhere else. Here's what the flag does, what Anthropic's docs say, and how to set up a VM for it.

Updated 2026-11-29 · 7 min read

Short answer: only in an isolated container or VM. Anthropic's permission-modes page says this mode is for "Isolated containers and VMs only". Run it as a non-root user, keep your real secrets off the machine, and treat everything on it as something the agent can read or delete.

What does --dangerously-skip-permissions do?

Normally Claude Code asks before it edits files or runs commands. The flag turns that off. It's an alias for the bypassPermissions permission mode, and the agent can run any command without asking.

One thing still applies. The docs say: "Deny rules block in every mode, including bypassPermissions." So you can still forbid specific commands in your settings.

What does Anthropic recommend?

The docs are consistent about this:

What can go wrong?

Isolation limits how far the damage reaches. It doesn't stop the damage from happening on the machine itself. That's why the machine should hold nothing you can't lose.

Container or VM?

Both count as isolated in Anthropic's docs. A container shares the host's kernel, while a VM has its own, which is a stronger boundary if the agent runs something nasty. We compare them in Containers vs microVMs for AI agents.

A checklist for a safe YOLO machine

  1. A separate machine. A cloud VM or a local VM. Not your laptop, not a server running production.
  2. A non-root user. The CLI rejects the flag when run as root.
    useradd -m -s /bin/bash agent
    su - agent
    claude --dangerously-skip-permissions
  3. No host secrets. Don't copy in ~/.ssh or cloud credential files. Use a GitHub token limited to the one repo.
  4. Deny rules for the commands you never want, like pushing to main.
  5. Limit the network if the task doesn't need the internet.
  6. Make it cheap to throw away. If you can recreate the machine in a minute, a bad run costs you a minute.

How does this look on Yurt?

Each Yurt VM is a Firecracker microVM with its own kernel, made to be thrown away. Create one per task, add the non-root user, and run the agent. When it's idle the VM sleeps with its memory saved, so a long unattended run can pause and resume without losing its place.

yurt new yolo-1 && yurt ssh yolo-1
root@yolo-1:~# useradd -m -s /bin/bash agent && su - agent
agent@yolo-1:~$ claude --dangerously-skip-permissions

Questions

Is it safe to use --dangerously-skip-permissions?

Only in an isolated environment. Anthropic's docs list the bypassPermissions mode as for isolated containers and VMs only.

Why does Claude Code refuse --dangerously-skip-permissions as root?

The CLI rejects the flag when run as root, and the docs say to run unattended sessions as a non-root user. Create a normal user and run it from there.

Do deny rules still work with --dangerously-skip-permissions?

Yes. The docs say deny rules block in every mode, including bypassPermissions.

Does a dev container protect my credentials?

Not fully. Anthropic's docs say a dev container does not prevent a malicious project from exfiltrating anything inside it, including the Claude Code credentials in ~/.claude.

Is a VM safer than a container for an AI agent?

A VM has its own kernel, so escaping it means breaking the hypervisor, not just the host kernel. Both count as isolated in Anthropic's docs.

Sources

  1. Claude Code permission modes, read 2026-11-29
  2. Claude Code dev containers, read 2026-11-29
  3. Claude Code security, read 2026-11-29

Give your agent its own computer. Full root, its own IPv6, and it sleeps with its memory when idle. Plans from $20/month, paid back as VM time.

curl -fsSL https://getyurt.dev/install | sh

Keep reading