Quick Start
Addsandbox: true and configure filesystem paths:
How Sandbox and Filesystem Work Together
The sandbox only provides command execution. All file access is controlled by the filesystem tool:- Filesystem tool reads/writes files on the host — changes appear inside the container instantly via bind mount
sandbox__execruns commands inside the container — if the mount is read-write, file changes flow back to the host- Paths are identical in host and container (no
/workspace/alias)
What Gets Mounted
Each filesystem path from your config is mounted at its real host path with the mode derived from its permissions:Glob patterns (e.g.
${root}/**/*.ts) are skipped — only concrete directories can be mounted. If no filesystem tool is configured, the project root is mounted read-only.Configuration
Usesandbox: true for defaults (Docker, node:22-slim), or provide a config object:
| Field | Type | Default | Description |
|---|---|---|---|
provider | string | — | Must be docker |
image | string | node:22-slim | Docker image (auto-pulled if missing) |
timeout | number | 300 | Max container lifetime in seconds |
setup | string | string[] | — | Commands to run before agent starts |
env | string[] | — | Host env var names to forward into the container |
Environment Variables
The container starts with a clean environment — no host env vars are passed in, even if they are defined in your project’s.env file. AgentUse loads .env into the host process, but the sandbox container does not inherit them.
To forward specific env vars into the container, use the env allowlist:
Examples
TypeScript Code Fix
Python Data Processing
Security Scanning (Read-Only)
Lifecycle
- Cleanup — Remove any orphaned containers from previous runs (crash/force-quit safe)
- Pull — Auto-pull the Docker image if not available locally
- Create — Start container with filesystem paths bind-mounted at real host paths
- Setup — Run
setupcommands sequentially inside the container - Execute — Agent uses
sandbox__execfor commands, filesystem tool for file I/O - Teardown — Container is stopped and removed when the session ends, times out, or is aborted
Self-Hosting
Need to run AgentUse itself inside Docker? See the self-hosting guide.
