/workspace. It can reach the internet but can’t see your agent’s environment variables, so API keys stay with your tools. What it sends counts toward your organization’s monthly network egress. A tool runs a program there through ctx.getSandbox():
agent/tools/run_report.ts
run() doesn’t throw when the command fails, so check exitCode.
Set it up
agent/sandbox/sandbox.ts sets up the sandbox. The same definition runs in Docker under pnpm dev and on Jaccard when deployed. The generated file, shortened:
agent/sandbox/sandbox.ts
- System packages go in the image. Change
IMAGEto an image that has them. prepareruns once per session, the first time it opens its sandbox. Install into$HOMEthere, as the uv line does.- Files under
agent/sandbox/workspace/are copied into/workspacebeforeprepareruns.
What lasts
A sandbox stops after 10 minutes without a command, or when its session ends. A command that runs longer keeps it running. Files in/workspace and $HOME stay, and the next command starts the sandbox again over them, which takes a few seconds. Anything else is gone: background processes, and packages installed with apt-get.
A stopped sandbox keeps its disk, so you can still copy its files. Kept disks count against your organization’s sandbox quota. The agent’s Sandboxes tab in the console shows when each one was last used and when it expires.
Make room at your sandbox limits
Your organization has two sandbox quotas: how many sandboxes it keeps, running or stopped, and how many run at once. A session that needs a sandbox past either one makes room instead of failing:- Past the running limit, your least recently used running sandbox is stopped. Its disk stays.
- Past the total limit, your least recently used sandbox is deleted with its disk, a stopped one before a running one.