

エージェントをサンドボックス化する完璧な方法は(まだ)存在しませんが、コンテナは実用的な第一歩です。
Agentbox は Docker ベースのコーディングエージェントサンドボックスで、もともとは Batrachian Toad に触発され、現在ではより多くのツールに一般化されています。
webterm とうまく連携し、複数のエージェントセッションを実行するための分離された環境を提供します。
デフォルトのコンテナは以下を提供します:
lazygit、killalluv と Bun。コンテナビルドでは正確なバージョン固定なしに最新の利用可能なパッケージをインストールしますmake -C ~ ... で toad、opencode、gemini、vibe をインストールENABLE_DOCKER、ENABLE_SSH、ENABLE_RDP で Docker/SSH/RDP を切り替えENABLE_SSH=true)と mosh サポート/home/agent/workspace-skel に組み込みのワークスペーススケルトンとエージェントスキルAgentbox は環境変数を使用して、コンテナ起動時にどのサービスを開始するかを制御します:
ENABLE_DOCKER=true - Docker デーモンを起動(Docker-in-Docker サポート用)ENABLE_SSH=true - SSH サーバーを起動(ポート 22)ENABLE_RDP=true - RDP サーバーを起動(ポート 3389)AGENTBOX_ENVIRONMENT=cli|gui - イメージが提供する環境マーカー(cli はヘッドレス/CLI、gui はデスクトップイメージ)デフォルトの動作: 明示的に有効化されない限り、すべてのサービスは無効です。
# 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
コンテナ内では、agent ユーザーに ~/Makefile が付属しており、追加のツールをインストールできます。
make -C ~ … でインストールできるコーディングエージェント/CLI:
toad — Batrachian Toad をインストール(uv tool 経由)opencode — OpenCode をインストール(Bun 経由)gemini — Gemini CLI をインストール(Homebrew 経由)vibe — mistral-vibe をインストール(uv tool 経由)便利なターゲット:
tools — node、go、gemini、vibe をインストールnode、go — 言語ツールチェーンをインストール(一部のエージェントの前提条件)Agentbox には /home/agent/workspace-skel に組み込みのプロジェクトスケルトンが付属しています。
既存のファイルを上書きせずに現在の /workspace にコピーするには:
make init-workspace
詳細は docs/workspace-skeleton.md を参照してください。
GUI ビルドは :gui タグ(および <release>-gui)として公開され、XFCE、XRDP、VS Code が含まれています。
推奨ワークフロー:
make up
make enter-toad # or: make enter-copilot
make down
サービスのオーバーライドが必要な場合は、docker-compose.override.yml を作成します:
services:
toad:
environment:
ENABLE_DOCKER: "true"
ENABLE_SSH: "true"
copilot:
environment:
ENABLE_DOCKER: "true"
ENABLE_SSH: "true"
次に実行します:
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
コンテナに接続したら:
make -C ~ toad
toad
toad /workspace
toad -a open-hands
このプロジェクトは、私の古い rcarmo/docker-templates/desktop-chrome をベースに、ユーザーランドを更新したものです。
MIT