﻿# Inspect sandbox boundaries: a configured container does not move Python tool wrappers

Understand which Inspect work executes in the evaluation host and which work enters a sandbox, including command timeouts, side effects and per-sample files.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-inspect-sandbox-tool-wrapper-host-execution/
Language: en

## Locate the code before trusting isolation

A task configured with a container can still execute its Python tool wrapper in the evaluation process. The [sandbox guide](https://inspect.aisi.org.uk/sandboxing.html) explicitly distinguishes tool code from work requested through the sandbox interface. This matters when a custom function opens files, imports libraries or launches a subprocess directly. Draw the execution boundary around actual operations, rather than treating the presence of a sandbox setting as proof that every action runs inside the container.

## Route workload operations deliberately

The [tool guide](https://inspect.aisi.org.uk/tools.html) explains tool declaration and invocation. For workload code that belongs in the isolated environment, use the supported sandbox operations from the wrapper. A wrapper that calls the host's process launcher instead may inspect a different filesystem or environment. Test an observable file read in both locations so the evaluation demonstrates which environment supplied the answer, especially when the host and sample container contain similarly named paths.

## Keep command and sample budgets separate

The [limits guide](https://inspect.aisi.org.uk/setting-limits.html) distinguishes total sample execution from individual command timeouts. A sample-wide budget does not by itself make an unexpectedly long command a useful test. Set an appropriate command timeout and retain its termination outcome. For operations with side effects, inspect the sandbox interface's timeout-retry behavior; repeating a partially completed action can change the environment and produce a result that a single execution would not have produced.

## Treat sample files as declared inputs

Provision the files a sample is allowed to observe rather than relying on incidental files left in an environment. Check path resolution and the identity under which operations execute. A correct answer obtained from an undeclared host file does not validate reasoning about the intended sample container. Likewise, a missing file may indicate provisioning failure rather than a model's inability to use a tool. Preserve these infrastructure outcomes separately from semantic correctness.

## Verify the boundary with a benign probe

Use a harmless diagnostic fixture with distinct host and container contents, then inspect the tool result and final score. Confirm that cleanup and retry behavior do not carry state between samples. The guides to [shell sandbox controls](/journal/jan-safe-mode-shell-sandbox/) and [tool-only message handling](/journal/learn-openrouter-tool-only-response/) provide related context. A reliable evaluation explains where code ran, what inputs it saw and how limits applied, instead of inferring those properties from a container label in the task definition.
