Run agent tool work in an isolated sandbox, not in the main process
Answer: Give tool work a dedicated, isolated environment. Several of Inspect's standard tools require a sandbox. Gemini CLI isolates potentially dangerous operations from your host system.
Why it matters
In Inspect, model tool calls run in the main evaluation process. The work those tools perform, such as shell commands or Python code, often needs a dedicated, isolated environment. Several of Inspect's standard tools require a sandbox, including bash(), python(), and text_editor(). Docker support is built in. Provisioning a sandbox does not automatically run tools, agents or scorers in the container. Bind the sandbox at the Sample, Task, or eval() level, and then run the work there.
Gemini CLI sandboxing isolates potentially dangerous operations from your host system, including shell commands and file modifications. One benefit is to limit file system access to the project directory. You can also reduce risk when working with untrusted code. Enable it with a command flag, an environment variable, or a configuration file. Container-based Docker or Podman sandboxing gives cross-platform process isolation.
Isolated environmentStandard shell and Python tools in Inspect require a sandboxProvisioningDoes not automatically run tools, agents or scorers in the containerHost isolationLimit file system access to the project directory
See also
Claims
- id: C1 claim: Provisioning an Inspect sandbox does not automatically run tools in the container. source: S1 evidence: "Provisioning a sandbox does not automatically run tools, agents or scorers in the container."
- id: C2 claim: Support for Docker sandboxes is built into Inspect. source: S1 evidence: "Support for Docker sandboxes is built in"
- id: C3 claim: Gemini CLI sandboxing can limit file system access to the project directory. source: S2 evidence: "Limit file system access to project directory."
Sources
- [S1] Sandboxing. Inspect AI (UK AI Security Institute). https://github.com/UKGovernmentBEIS/inspect_ai/blob/main/docs/sandboxing.qmd . License: MIT. Accessed 2026-11-22.
- [S2] Sandboxing in Gemini CLI. Gemini CLI. https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/sandbox.md . License: Apache-2.0. Accessed 2026-11-22.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Inspect AI, Sandboxing, MIT; Gemini CLI, Sandboxing, Apache-2.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Inspect AI, Sandboxing, MIT; Gemini CLI, Sandboxing, Apache-2.0.
Cite this
iinventedlight. 2026. "Run agent tool work in an isolated sandbox, not in the main process." iinventedlight Library, iil:note:1k8m4a51, version of 2026-11-22. https://iinventedlight.com/library/notes/agent-sandbox-modes/. License: CC-BY-4.0.
@misc{iil_note_1k8m4a51,
author = {{iinventedlight}},
title = {{Run agent tool work in an isolated sandbox, not in the main process}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-22},
url = {https://iinventedlight.com/library/notes/agent-sandbox-modes/},
note = {Permanent ID iil:note:1k8m4a51. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/agent-sandbox-modes.md.