We get more from a sandbox review when we ask what the agent can still reach. The word “isolated” leaves a lot unanswered. An execution environment might protect the host filesystem while giving generated code a powerful cloud credential and unrestricted network access.

An AI agent sandbox is a restricted environment for running agent-controlled code or tools. Its usefulness depends on the boundaries it enforces: host access, other workloads, mounted data, network destinations, resource consumption, and the lifetime of credentials and files. Review those boundaries against the work you actually intend to run.

If you are already reviewing cloud misconfigurations, include the agent runtime in that review. Check its IAM permissions, mounted storage, and network rules before giving it production data. Those settings determine what generated code can reach even when the runtime itself behaves as designed.

Start with the workload and the things it must not touch

Take a hypothetical agent that transforms an uploaded CSV into a report. It needs the input file, a working directory, approved libraries, and somewhere to return the report. It probably does not need the operator’s home directory or access to a production database.

We would document the permitted inputs and outputs before selecting the runtime. Add a short list of assets that must remain inaccessible, including other users’ uploads and the service that creates sandboxes. Otherwise it’s easy to compare products on startup time while leaving the important security assumptions unwritten.

Separate jobs by the trust you place in their inputs and the consequences of compromise. A report generator processing public sample data and a coding agent operating beside deployment credentials should not inherit the same configuration just because they use the same model.

Understand the runtime’s boundary

Docker’s security documentation describes namespaces, resource controls, capabilities, daemon exposure, and configuration as separate considerations. A container is a useful component, but access to a privileged daemon or an unnecessarily broad host mount can undermine the intended separation.

Other runtimes make different tradeoffs. gVisor’s security model describes intercepting application interactions with the system API to reduce direct exposure to the host kernel. It also explains that allowed filesystem and network access remain available to the application. A microVM introduces a guest operating system and virtualization boundary, with its own configuration and operational responsibilities.

We would compare isolation properties, compatibility, and maintenance requirements before benchmarking startup time. The choice also depends on who patches the host and runtime, how tenants share infrastructure, and what happens when the control service is compromised.

Keep credentials outside generated code where possible

For the CSV task, the runtime could receive only the selected input and a narrowly scoped way to return the finished artifact. It need not possess the credential that can read every customer’s uploads.

When code must call an external service, consider a broker that exposes the specific allowed operation and enforces the caller’s access. That broker becomes a security boundary worth testing. If it accepts arbitrary destinations or unrestricted commands, it may simply relocate the original problem.

Short-lived credentials can reduce how long a stolen credential remains useful. Their actual permissions still matter. A credential with five minutes to delete a database has enough time to cause damage.

Network access needs its own decision

An agent that needs a package from a registry does not necessarily need permanent access to the entire internet. We would separate dependency preparation from the execution phase when the workload permits it, and make any exceptions explicit.

Review outbound access, internal service reachability, and control-plane endpoints. Check how the deployed platform handles cloud metadata addresses, local interfaces, redirects, and name resolution. These are implementation questions; a statement that “egress is filtered” needs evidence from the environment that will run the job.

The report generator also needs an output policy. A file returned to a user can contain data the agent was allowed to read but was not meant to disclose. Isolation limits access; your application still has to define what may leave through an approved output channel.

Safe tests for a candidate sandbox

Use synthetic files, test identities, and endpoints you control. These checks are a starting point for acceptance testing, not a claim that the sandbox has resisted every escape technique.

  1. Place a harmless marker outside the permitted filesystem mount. Confirm that a job cannot read or modify it, while it can still read its assigned input.
  2. Give two test users separate inputs. Confirm that neither job can list, retrieve, or reuse the other’s files, including after a worker is recycled.
  3. Attempt an allowed outbound request and a request to a controlled, disallowed endpoint. Confirm both outcomes in the enforcement layer’s records.
  4. Run a bounded resource test with deliberately small CPU, memory, and time limits. Confirm that termination stops the workload and that the worker can serve a later clean job.
  5. Cancel a job with a child process. Check that the child stops, temporary access expires as designed, and abandoned outputs do not become available to another user.

We would rerun the relevant cases after a change to mounts, network policy, runtime version, or credential delivery. A test result from a different configuration is not evidence about the new one.

Include the end of the job in the review

For an autonomous workflow, cancellation is part of the product. Define who can stop a run, which remote actions can still finish afterward, and how the operator learns about partial results. Local process termination cannot undo an external API call that already succeeded.

Our MCP code-execution article covers why generated programs can reduce model context overhead. Before using that pattern with private data, we’d want the sandbox review to show the allowed workflow succeeding and the unwanted access failing, with enough records to explain both outcomes.

Cloud services from Libre Labs View all posts