Yes, and a container or VM is the only place it belongs. Yolo mode (Claude Code's --dangerously-skip-permissions, and similar modes in other agents) removes the human review of each command. The risk that matters is a prompt injection hidden in a dependency, an issue or a web page, or an honest mistake, executing with everything the session can reach.
A container or VM shrinks what it can reach, and Anthropic's own documentation is direct about the limit: run this way, a dev container does not prevent a malicious project from exfiltrating anything accessible inside the container, including the agent's own credentials. So build the container for the job:
- Use a centrally maintained image rather than one each repo defines, because anyone with write access can edit a repo's Dockerfile.
- Run as a non-root user with default-deny network egress, allowing only the model API, your git host and package registries (Anthropic publishes a reference dev container with a firewall script for exactly this).
- Mount no host secrets, which means no
~/.ssh, no cloud credential files and no Docker socket, and pass only repository-scoped, short-lived tokens.
- Keep production access out, make environments disposable, send telemetry to your SIEM, and stick to trusted repositories.
- Let work leave the box only as a pull request a human reviews.
On laptops, keep bypass mode disabled through managed settings and allow it only in the sanctioned image. If the goal is simply fewer prompts, Claude Code's auto mode, where a classifier reviews each action before it runs, is a middle ground.