Which Agent Boundary Failed Your Acceptance Test?
Run paired allow and deny checks with synthetic fixtures, then reconcile each observed result with the intended policy. Test Claude Code tools separately from its Bash sandbox and requalify Docker Sandboxes egress after a local-to-cloud move.
Trace each harmless read to the component that made it
Put one synthetic file inside the permitted directory and another in a sibling directory that your policy excludes. Give each a distinct marker. Run the same pair of reads through every enabled path that could perform the action, including the shell and the built-in file reader. If an MCP filesystem server participates, exercise it as a third caller. Claude Code documents that its Bash sandbox applies to shell commands and their child processes, while file tools, MCP servers, and hooks sit outside that boundary. Capture caller, fixture, and reported outcome. Require the permitted read to return its marker and the excluded read to produce an explicit denial. If the shell denies the request while the file reader returns the excluded marker, you have located a gap in caller coverage and can retest the control governing that caller.
Configure the sandboxed Bash tool - Claude Code DocsDistinguish policy blocks from broken network probes
Use two controlled HTTPS endpoints that both return a distinct marker under a known-good policy. Allow one and block the other in the environment under test. For each connection, record the endpoint label, response or error, and the matching policy event if available. An unexplained timeout belongs in an inconclusive bucket. It could reflect DNS, a service outage, or enforcement. Docker Sandboxes keeps separate account and sandbox rules for cloud traffic, with matching denies taking precedence over allows. If a sandbox-specific allow appears ineffective, inspect the cloud account rules and look for a matching deny. Run the two probes again after a local-to-cloud move because Docker documents separate cloud policy configuration. Keep a successful control request in each run so a disabled or broken probe cannot produce a passing egress check.
Manage cloud network policy | Docker DocsCheck the filesystem with harmless fixtures
Stage the job's repository at a known revision in a disposable working copy. Put a harmless marker in a directory excluded from the job, and give the agent a designated output directory. Anthropic Sandbox Runtime lets an operator restrict which paths a process can read or write. Run the filesystem checks through the same sandbox configuration and process entry point that will execute the job.
In an illustrative trial, give the worker sample.csv with 100 synthetic rows, permit it to write result.json, and place a second marker outside the permitted input paths. The trial passes if the input is readable, the output validates, and the excluded marker cannot be read through that process. If the read succeeds, inspect the effective path rules and mounts before staging any real data.
GitHub - anthropics/sandbox-runtime: A lightweight sandboxing tool for enforcing filesystem and network restrictions on arbitrary processes at the OS level, without requiring a container. · GitHubPut approval at the tool boundary
List every path that can cause an outside effect, including shell commands, file tools, MCP servers, and hooks. Claude Code's Bash sandbox applies to shell commands and their child processes. Its file tools, MCP servers, and hooks run outside that boundary. For a job allowed to produce a patch but requiring approval to publish it, give the worker local write access and put publishing credentials behind a separate service that requires approval.
Test the publish path against a mock destination. Submit a request for a harmless change without approval and confirm the service records a denial with no write. Approve that exact change and verify a single write to the intended destination. If a hook can publish the same change independently, restrict its authority or remove it from the worker configuration before deployment.
Configure the sandboxed Bash tool - Claude Code Docs