FISTA Solutions does not load Google Analytics until you accept. Rejecting keeps optional analytics off. Read the Cookie Policy.

All field notes

Governance · 4 minute read

AI Agent Sandboxing: Bounding What Agents Can Reach

AI agent sandboxing isolates the environment an agent executes in so that, whatever the model decides, the agent can reach only allowlisted systems through the tool layer: an isolated compute environment per role, network egress limited to the gateway and approved destinations, no local secrets or sensitive filesystem access, resource and step limits, and tests that attempt escape.

By FISTA Solutions· AI-Native Engineering Team·
AI Agent Sandboxing: Bounding What Agents Can Reach article cover

Tool permissions decide what an agent may do through the doors you built for it. Sandboxing decides whether there are other doors. A runtime that can open arbitrary network connections, read the host's files, or execute code with the host's privileges gives a steered or malfunctioning agent paths around the permission model, and injected content will find them. This guide sets out isolation for agent runtimes, complementing how to design tool permissions for AI agents and the AI agent security architecture whitepaper.

What is the threat sandboxing addresses?

Path around permissionsExample
Direct network accessThe agent posts data to an external endpoint named in an injected instruction
Local secretsA credential file on the host is read and used
FilesystemShared mounts expose documents outside the role's scope
Code executionGenerated code runs with the host's identity and access
Cloud metadataInstance credentials obtained from a metadata endpoint
Resource exhaustionA loop consumes compute or budget until stopped

Each is closed at the environment level, where a prompt cannot reopen it.

What are the isolation layers?

LayerControl
ComputeAn isolated environment per agent role (container, micro-VM, or dedicated virtual desktop for computer-use agents), no persistent state between tasks unless required
NetworkEgress denied by default; allowlist limited to the gateway and approved destinations; no direct access to systems of record
SecretsNone in the environment; credentials brokered at call time by the tool layer, per secrets management for AI agents
FilesystemRead-only base; scratch space per task; no sensitive mounts
IdentityThe environment holds the agent's workload identity only; no host or cloud instance credentials reachable
ResourcesCPU, memory, execution time, step and token budgets per task
ObservabilityEnvironment-level logging of network attempts, file access, and resource use

How does sandboxing differ by agent type?

  • Tool-calling agents over APIs: the standard layers; the main risk is egress and secrets.
  • Code-executing agents: strongest compute isolation; ephemeral environments per execution; no network unless the task requires an allowlisted destination; outputs scanned before use.
  • Computer-use and browser agents: dedicated virtual desktops or browser profiles with application and URL allowlists, downloads controlled, session recording; see computer-use agent security.
  • Document-processing agents: isolation from the document source's wider store; scanning of inputs; output redaction.

Why is the gateway the only door?

With egress limited to the gateway, every action an agent takes passes through identity, permission, gate, and logging controls. A sandbox that allows direct calls to systems "for performance" reopens every path the permission model closed. Performance is solved with pooled connections at the gateway, not with holes in the sandbox. The gateway is described in how to build an MCP gateway.

What limits stop runaway behavior?

Per task: step budget, token budget, execution time, and cost ceiling, enforced by the runtime and the gateway with alerts before hard stops. Per environment: CPU and memory caps. A budget breach ends the task with an escalation, never a retry loop. Budget design is discussed in the AI agent unit economics whitepaper.

How is containment tested?

Automated escape tests run inside the agent's environment in CI and after infrastructure changes:

  1. Outbound connection to a non-allowlisted host is blocked.
  2. Secret and credential paths are unreadable.
  3. Sensitive filesystem paths and mounts are absent.
  4. Metadata endpoints are unreachable.
  5. Resource caps trigger.
  6. A generated script cannot escalate privileges.

Results are recorded with the environment version. A red-team exercise periodically attempts the same through injected content end to end; scope is described in AI penetration testing scope.

How does sandboxing fit with evaluation and operations?

Sandboxes are also where end-state evaluation runs: a copy of the systems the agent touches, isolated the same way, lets the harness verify what an agent would have changed without touching production. The same environment images serve shadow mode and production, so a containment property tested in evaluation holds at runtime. Operationally, environment versions are recorded on every trace, escape-test results are attached to each version, and the runbook names the environment as the first thing to check when an agent's behavior changes after an infrastructure update. The evaluation design is in how to build an agent evaluation harness.

What are the common mistakes?

  1. Agents on shared hosts with the host's network and files.
  2. Egress "temporarily" open to a system of record.
  3. Secrets mounted for convenience.
  4. Code execution on the same host as the orchestrator.
  5. No budgets, so loops run until someone notices.
  6. Sandbox never tested.

How does FISTA Solutions help?

FISTA Solutions runs every AI agent it delivers in isolated environments with gateway-only egress, brokered credentials, and budgets, builds the escape-test suite as part of its AI enablement platform work, and aligns isolation with your infrastructure and security teams through forward deployed engineers. FISTA has delivered 150+ projects for 50+ companies across 12+ countries with 99.9% uptime.

To assess how contained your agents are, message FISTA on WhatsApp, or read AI agent kill switch design for the control that stops an agent the sandbox could not.

Share-ready article cover

Download the generated social format.

Download cover

Clear answers

Questions raised by this field note.

Straightforward guidance for evaluating scope, fit, and the next step.

01Why sandbox an agent that already has scoped permissions?

Because permissions apply to the tools the agent is meant to use. If the runtime can open arbitrary network connections, read the host's filesystem, or execute code with the host's access, a steered or malfunctioning agent has paths around the permission model. Sandboxing removes those paths so the tool layer is the only door.

02Which agents need the strongest isolation?

Agents that execute generated code, computer-use and browser agents, agents that process untrusted documents at scale, and any agent with consequential tools. Code execution and screen control give the model general-purpose capability, which must be contained at the environment level rather than the prompt level.

03What should the sandbox block?

Outbound network access except to the gateway and explicitly approved destinations, access to secrets and credential stores, sensitive filesystem paths and shared mounts, host and cloud metadata endpoints, and privileged system calls. It should also cap CPU, memory, execution time, and steps per task.

04How do you prove a sandbox works?

By trying to break it: automated tests that attempt outbound connections, secret reads, filesystem traversal, metadata endpoint access, and resource exhaustion from inside the agent's environment, run in CI and after infrastructure changes, plus periodic manual review. A sandbox that has never been tested is a claim.

Start with the hard problem

Need the outcome owned, not merely analyzed?

Tell us where delivery is constrained. We’ll map the fastest credible path from intent to verified production.

Start a project