Sandbox Setup Guide
This guide helps you set up and configure sandboxing for Radium agents.
Prerequisitesβ
Dockerβ
Installation:
- macOS: Install Docker Desktop
- Linux: Install via package manager (e.g.,
apt install docker.io) - Windows: Install Docker Desktop
Verification:
docker --version
docker run hello-world
Common Issues:
- Permission denied: Add your user to the
dockergroup:sudo usermod -aG docker $USER
newgrp docker - Docker daemon not running: Start Docker Desktop or Docker service
- Image pull failed: Check network connection and Docker registry access
Podmanβ
Installation:
- macOS:
brew install podman - Linux: Install via package manager (e.g.,
apt install podman) - Windows: Install via WSL2 or use Podman Desktop
Verification:
podman --version
podman run hello-world
Common Issues:
- Rootless mode: Podman runs rootless by default, which is secure but may have limitations
- Image pull failed: Check network connection and registry access
- Storage issues: Podman uses different storage than Docker
Seatbelt (macOS only)β
Availability:
Seatbelt is built into macOS. Verify availability:
which sandbox-exec
Requirements:
- macOS 10.5 or later
- No additional installation needed
Common Issues:
- Not available: Ensure you're on macOS
- Permission denied: Check file permissions and profile syntax
Configurationβ
Basic Configurationβ
Add sandbox configuration to your agent TOML file:
[agent]
id = "my-agent"
name = "My Agent"
prompt_path = "prompts/my-agent.md"
[agent.sandbox]
sandbox_type = "docker"
network = "closed"
image = "alpine:latest"
Advanced Configurationβ
[agent.sandbox]
sandbox_type = "docker"
network = "closed"
profile = "restrictive"
image = "rust:latest"
working_dir = "/app"
volumes = [
"/host/path:/container/path",
"/another/host:/another/container"
]
env = {
"RUST_LOG" = "debug",
"API_KEY" = "secret"
}
custom_flags = [
"--cap-add=SYS_ADMIN",
"--memory=512m"
]
Testing Sandbox Configurationβ
Use the CLI to test your sandbox setup:
# Test Docker sandbox
rad sandbox test docker
# Test Podman sandbox
rad sandbox test podman
# Test Seatbelt sandbox (macOS)
rad sandbox test seatbelt
Verification Stepsβ
-
Check prerequisites:
rad sandbox doctor -
List available sandboxes:
rad sandbox list -
Test sandbox execution:
rad sandbox test docker -
Verify agent configuration:
rad agents info my-agent
Common Issues and Solutionsβ
Docker Issuesβ
Problem: "Docker not found"
Solution: Install Docker and ensure it's in your PATH
Problem: "Permission denied"
Solution: Add user to docker group (see Prerequisites)
Problem: "Image pull failed"
Solution:
- Check network connection
- Verify image name and tag
- Try pulling manually:
docker pull <image>
Podman Issuesβ
Problem: "Podman not found"
Solution: Install Podman and ensure it's in your PATH
Problem: "Rootless container limitations"
Solution:
- Use
podman machinefor full compatibility - Or configure rootless mode properly
Seatbelt Issuesβ
Problem: "sandbox-exec not found"
Solution: Ensure you're on macOS
Problem: "Profile syntax error"
Solution: Check your custom profile file syntax
Network Issuesβ
Problem: "Network access blocked in closed mode"
Solution: This is expected. Use network = "open" if network access is needed.
Problem: "Network access fails in open mode"
Solution:
- Check container network configuration
- Verify DNS resolution
- Check firewall settings
Volume Mount Issuesβ
Problem: "Volume mount failed"
Solution:
- Verify host path exists
- Check path permissions
- Ensure correct format:
/host:/container
Problem: "Permission denied in mounted volume"
Solution:
- Check file permissions on host
- Use appropriate user in container
- Consider SELinux/AppArmor policies
Best Practicesβ
- Start with NoSandbox for development
- Use Docker/Podman for production
- Test sandbox configuration before deploying
- Use minimal images (alpine, distroless)
- Limit volume mounts to necessary directories
- Close network unless required
- Monitor sandbox execution for errors
Security Considerationsβ
- Never mount sensitive directories (e.g.,
/etc,/home) - Use restrictive profiles when possible
- Limit custom flags to necessary capabilities
- Review environment variables for secrets
- Test in isolated environment first
- Keep container images updated
Next Stepsβ
- See Sandboxing Feature Documentation for detailed API reference
- Check Example Configurations for working examples
- Review Agent Configuration Guide for agent setup