← All notes

Running eval tool calls in a sandbox: Inspect sandbox() with Docker or gVisor

Answer: In Inspect, model tool calls are executed within the main process, but the work tools perform, such as running shell commands, very often needs a dedicated, isolated environment. Add sandbox="docker" to a task and tools call sandbox() to reach the SandboxEnvironment for the current sample.

Details

Stronger isolation

gVisor provides a Docker runtime: after sudo runsc install and a daemon restart, containers run with docker run --runtime=runsc.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: UKGovernmentBEIS/inspect_ai (GitHub), Sandboxing (Inspect docs), MIT (https://raw.githubusercontent.com/UKGovernmentBEIS/inspect_ai/main/LICENSE). Copyright (c) 2024 UK AI Security Institute; google/gvisor (GitHub), gVisor Docker quick start, Apache-2.0 (https://raw.githubusercontent.com/google/gvisor/master/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: UKGovernmentBEIS/inspect_ai (GitHub), Sandboxing (Inspect docs), MIT (https://raw.githubusercontent.com/UKGovernmentBEIS/inspect_ai/main/LICENSE). Copyright (c) 2024 UK AI Security Institute; google/gvisor (GitHub), gVisor Docker quick start, Apache-2.0 (https://raw.githubusercontent.com/google/gvisor/master/LICENSE).

Cite this

Permanent ID: iil:note:c2wa2res

iinventedlight. 2026. "Running eval tool calls in a sandbox: Inspect sandbox() with Docker or gVisor." iinventedlight Library, iil:note:c2wa2res, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-sandbox-inspect-docker-tools/. License: CC-BY-4.0.

@misc{iil_note_c2wa2res,
  author = {{iinventedlight}},
  title = {{Running eval tool calls in a sandbox: Inspect sandbox() with Docker or gVisor}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/ao-sandbox-inspect-docker-tools/},
  note = {Permanent ID iil:note:c2wa2res. License: CC-BY-4.0.},
}

Markdown

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/ao-sandbox-inspect-docker-tools.md.