
docker-compose to an agent’s docker run.
Set up
1
Install AgentEnv with the boxd extra
uv add 'agentenv-framework[boxd]'.2
Create an API key
secret:boxd_api_key instead.3
Add the provider to your config
In The provider reads the key from this config only, never from the process environment.
.agentenv/config.toml:4
Run the hello task
hello task starts a boxd machine, loads a file into it, and checks it. It needs no model.agent-env task run also takes --env-sandbox boxd and --agent-sandbox boxd to choose per run, and agent-env -v logs each machine as it starts.
Start every machine from a snapshot
A machine booted from boxd’s image builds or pulls every image its environment needs. Boot it from a snapshot of a machine that already has them, and those builds become cache hits. The provider’s README measured theecho-mcp bundle’s deploy_env going from about 117 seconds to 47.
Keep one run’s machines up, clear the environment’s machine down to its images, and save it:
boxd machine started log line names the machine. Stop the run with Ctrl-C, then set snapshot = "agentenv-warm" under [sandbox.providers.boxd.config]. A snapshot keeps memory and disk, so clearing the containers and volumes first stops every new machine from restoring them.
What each machine gets
- A size: the smallest of boxd’s four machine sizes that covers the request’s CPU and memory. AgentEnv’s default of 1 vCPU and 8 GiB runs on 2 vCPU / 8 GiB.
- A deadline: AgentEnv’s
timeoutbecomes the machine’s delete-after timer, so boxd deletes the machine even when a crashed run never tears it down. - Isolation: every machine is created isolated, with no peers on your organization’s network and no in-machine
boxdCLI, metadata endpoint, or account integrations. - Egress control: an allowlist set in AgentEnv is enforced outside the machine, so one list covers
dockerdand every container. See Egress control. - Public ports: each exposed port gets its own URL,
https://p<port>.<machine>.boxd.sh.