This project provides a robust, secure wrapper for running AI agents like Claude Code in "YOLO mode" (--dangerously-skip-permissions) by solving the entire lethal trifecta:
π Filesystem Isolation: The agent only sees your project directory and explicitly mounted volumes (like read-only ~/.ssh). It cannot see your host filesystem.
π€ Privilege Isolation: The agent runs as a powerless, non-root agent user inside the container, with file permissions matched to your host user.
π₯ Network Isolation: A dynamic iptables firewall is built at startup, blocking all outbound network traffic except for DNS and a list of trusted domains you provide.
This tool is heavily inspired by deva.sh and Simon Willison's "Living dangerously with Claude".
This project has two parts:
-
A Rust CLI (
rustyolo): This is the wrapper you run on your host machine. It parses your arguments (volumes, network rules, auth paths) and programmatically constructs a securedocker runcommand. -
A Docker Image (
llm-rustyolo): This image contains the agents (Claude Code, etc.) and anentrypoint.shscript. The script uses the arguments from the Rust CLI to build the firewall, fix file permissions, and then run the agent as a non-root user.
This approach combines the flexible auth and volume mounting from deva.sh with the strict network firewall we developed.
- Homebrew (for macOS/Linux users) - Install from https://brew.sh
- Docker (Docker Desktop on macOS, or docker.io on Linux)
# Install via Homebrew tap
brew tap brooksomics/rustyolo
brew install rustyolo
# Pull the Docker image
docker pull ghcr.io/brooksomics/llm-rustyolo:latestOr build locally if you need to customize:
git clone https://github.com/brooksomics/llm-rustyolo.git
cd llm-rustyolo
docker build -t ghcr.io/brooksomics/llm-rustyolo:latest .# 1. Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 2. Build the Rust CLI
cargo build --release
sudo cp target/release/rustyolo /usr/local/bin/
# 3. Pull the Docker image
docker pull ghcr.io/brooksomics/llm-rustyolo:latest
# Or build locally if you need to customize
docker build -t ghcr.io/brooksomics/llm-rustyolo:latest .For detailed installation instructions, see docs/guides/installation.md.
Once set up, you can go to any project directory and run your agent.
This is the most common use case. It allows the agent to access github.com (for git pull) and pypi.org (for pip install) but nothing else.
cd ~/my-new-project
rustyolo \
--allow-domains "github.com api.github.com pypi.org files.pythonhosted.org" \
-v ~/.ssh:/home/agent/.ssh:ro \
-v ~/.gitconfig:/home/agent/.gitconfig:ro \
--auth-home ~/.config/rustyolo \
claudeThis runs Claude with zero internet access.
rustyolo \
-v ~/.ssh:/home/agent/.ssh:ro \
--auth-home ~/.config/rustyolo \
claudeYou can pass any command and arguments after the agent name. rustyolo is smart enough to see you provided args and won't add its default "danger" flag.
rustyolo claude --helpTired of typing long commands? Create a .rustyolo.toml file in your project directory:
[default]
allow_domains = "github.com pypi.org npmjs.org"
volumes = ["~/.ssh:/home/agent/.ssh:ro", "~/.gitconfig:/home/agent/.gitconfig:ro"]
auth_home = "~/.config/rustyolo"
[resources]
memory = "8g"
cpus = "6"
[security]
audit_log = "basic"Then just run:
rustyolo claudeFeatures:
- β Automatic loading from current directory
- β CLI arguments override config file settings
- β Gitignored by default (project-specific settings)
- β Full validation with helpful error messages
See docs/guides/configuration.md for detailed configuration guide and examples.
If you installed via Homebrew, you have multiple update options:
# Update Docker image only (shows reminder about CLI)
rustyolo update
# Update just the Docker image
rustyolo update --image
# Update the CLI binary (must use Homebrew)
brew upgrade rustyoloNote: The rustyolo update command only updates the Docker image for Homebrew installations, as Homebrew manages the CLI binary separately. You'll see a reminder to run brew upgrade rustyolo for the CLI.
If you built from source, use the built-in update commands:
# Update the binary
rustyolo update --binary
# Update the Docker image
rustyolo update --image
# Update both
rustyolo updateThe tool automatically checks for updates on startup and notifies you when a new version is available.
A secure, firewalled Docker wrapper for AI agents.
Usage: rustyolo [OPTIONS] [AGENT] [AGENT_ARGS]...
rustyolo update [OPTIONS]
Subcommands:
update Update rustyolo components (binary and/or Docker image)
Arguments:
[AGENT]
The agent to run (e.g., 'claude')
[default: claude]
[AGENT_ARGS]...
Arguments to pass directly to the agent (e.g., --help or -p "prompt")
Options:
-v, --volume <VOLUMES>
Additional volumes to mount (e.g., -v ~/.ssh:/home/agent/.ssh:ro)
-e, --env <ENVS>
Environment variables to pass (e.g., -e MY_VAR=value)
--allow-domains <ALLOW_DOMAINS>
Space-separated list of domains to allow outbound traffic to.
All other traffic (except DNS) will be blocked.
Example: --allow-domains "github.com pypi.org npmjs.com"
Note: Anthropic domains are automatically added when using Claude.
[env: TRUSTED_DOMAINS=]
--auth-home <AUTH_HOME>
Mount a persistent auth directory. Maps your local dir
to '/home/agent/.config/rustyolo' in the container.
Recommended: ~/.config/rustyolo
--image <IMAGE>
The Docker image to use
[default: llm-rustyolo:latest]
--skip-version-check
Skip automatic version check on startup
-h, --help
Print help
-V, --version
Print version
- docs/guides/installation.md - Detailed installation instructions
- docs/guides/configuration.md - Configuration file guide
- CLAUDE.md - Complete documentation on how it works, security considerations, and advanced usage
- docs/security/security-policy.md - Secret scanning and security protection setup
- docs/security/seccomp.md - Seccomp profiles and syscall filtering
- docs/ - Full documentation index
This repository implements multiple layers of secret detection to prevent accidentally committing sensitive information:
- Pre-commit Hooks - Gitleaks, detect-secrets, and more run before each commit
- GitHub Actions - Automated secret scanning on every push and PR
- git-secrets - Additional local protection with custom patterns
See docs/security/security-policy.md for complete setup instructions and best practices.
MIT License
Contributions welcome! Please see CONTRIBUTING.md for guidelines.
