
Docker-based sandbox for coding agents with isolated environments, preinstalled agent tooling, service control, and workspace bootstrap for secure multi-session development.

There's no perfect way to sandbox agents (yet), but containers are a practical start.
Agentbox is a Docker-based coding agent sandbox, originally inspired by Batrachian Toad, and now generalized to more tools.
It provides an isolated environment that works well with webterm for running multiple agent sessions.
The default container provides:
lazygit, killalluv and Buntoad, opencode, gemini, and vibe via make -C ~ ...ENABLE_DOCKER, ENABLE_SSH, and ENABLE_RDPENABLE_SSH=true) and mosh support/home/agent/workspace-skelAgentbox uses environment variables to control which services start at container launch:
ENABLE_DOCKER=true - Start Docker daemon (for Docker-in-Docker support)ENABLE_SSH=true - Start SSH server (port 22)ENABLE_RDP=true - Start RDP server (port 3389)AGENTBOX_ENVIRONMENT=cli|gui - Image-provided environment marker (cli for headless/CLI, gui for desktop images)Default behavior: All services are disabled unless explicitly enabled.
# Default - all services disabled
docker run -d agentbox
# Enable only Docker daemon
docker run -d -e ENABLE_DOCKER=true agentbox
# Enable Docker and SSH for development
docker run -d -e ENABLE_DOCKER=true -e ENABLE_SSH=true -p 22:22 agentbox
# Full desktop experience with all services (GUI image)
docker run -d -e ENABLE_DOCKER=true -e ENABLE_SSH=true -e ENABLE_RDP=true -p 22:22 -p 3389:3389 agentbox:gui
Inside the container, the agent user ships with a ~/Makefile that can install additional tooling.
Coding agents/CLIs you can install via make -C ~ …:
toad — installs Batrachian Toad (via uv tool)opencode — installs OpenCode (via Bun)gemini — installs Gemini CLI (via Homebrew)vibe — installs mistral-vibe (via uv tool)Convenience targets:
tools — installs node, go, gemini, vibenode, go — install language toolchains (prereqs for some agents)Agentbox ships a built-in project skeleton at /home/agent/workspace-skel.
To copy it into your current /workspace without overwriting existing files:
make init-workspace
See docs/workspace-skeleton.md for details.
The GUI build is published as the :gui tag (also <release>-gui) and includes XFCE, XRDP, and VS Code.
Recommended workflow:
make up
make enter-toad # or: make enter-copilot
make down
If you need service overrides, create docker-compose.override.yml:
services:
toad:
environment:
ENABLE_DOCKER: "true"
ENABLE_SSH: "true"
copilot:
environment:
ENABLE_DOCKER: "true"
ENABLE_SSH: "true"
Then run:
docker compose up -d
# Build the headless image
docker build -t agentbox .
# Build the GUI image
docker build -t agentbox:gui --target gui .
# Run the container with selected services (GUI image)
docker run -d \
--name agentbox \
--privileged \
-e ENABLE_DOCKER=true \
-e ENABLE_SSH=true \
-e ENABLE_RDP=true \
-p 22:22 \
-p 3389:3389 \
-v $(pwd):/workspace \
agentbox:gui
Once connected to the container:
make -C ~ toad
toad
toad /workspace
toad -a open-hands
This project is loosely based on my ancient rcarmo/docker-templates/desktop-chrome with an updated userland.
MIT