A sandbox provides an isolated workspace with files and command execution. An agent uses one when its tools need to inspect a repository, transform a document, or run a program.
For example, an agent preparing a report can place input files in a sandbox, execute a transformation, and retrieve the result. The sandbox supplies the workspace. The agent or workflow run records the overall task.
A session and its commands
A session can serve several commands and file operations. Its lifetime is independent of any one command.
A ready session doesn't imply a command succeeded. Command output and exit status describe that operation's result. Session state describes workspace availability.
Session lifecycle
Wait for the session to be running before using it. Retrieve or store required outputs before closing it. Workspace files are not automatically published as project artifacts.
Where it fits
A server runtime can host an agent that uses a sandbox tool. A job runtime can use a sandbox for one processing step. The sandbox doesn't replace either execution model.
Next
- Sandbox guide in Code: Create sessions and use files and commands from code.
- Run project work: Start a sandbox through the Cloud API.
Related
- Create sandbox session: MCP session creation inputs.
- Sandboxes panel: Inspect sessions in Studio.