Glossary · 5 minute read
What Is Agent Sandboxing? Isolating AI Execution Explained
Agent sandboxing isolates the environment in which an agent executes code or calls tools, so that mistakes and compromises are contained. It covers process isolation, filesystem scope, network egress, resource limits, and credential exposure. It contains damage; it does not decide what the agent is permitted to do.
Agent systems execute code and call tools on behalf of instructions that may have been influenced by untrusted content. That combination makes isolation a baseline requirement rather than a hardening step. Sandboxing is how the damage is bounded when something goes wrong, which it eventually will. This explainer covers what to isolate. It complements what is least privilege for ai agents and ai security checklist, and reflects FISTA Solutions' approach in AI agents delivery.
What is being isolated?
Execution and reach. Process isolation so that generated code cannot affect the host. Filesystem scope so it can read and write only what the task needs. Network egress so it cannot reach arbitrary destinations. Resource limits so it cannot consume the machine. Credential absence so it cannot authenticate as anything.
Each boundary addresses a distinct failure, and omitting one usually undoes the others.
| Boundary | Prevents | Common omission |
|---|---|---|
| Process isolation | Host compromise | Running in the app process |
| Filesystem scope | Reading unrelated data | Full volume mounts |
| Network egress | Data exfiltration | Unrestricted outbound |
| Resource limits | Runaway consumption | No CPU or memory caps |
| Credential absence | Authenticated misuse | Secrets in environment |
| Ephemerality | State carrying between tasks | Long-lived containers |
Why is egress the priority?
Because it is the exfiltration path. An agent with unrestricted outbound network access, executing code influenced by content it retrieved, can send anything it can read to anywhere. That converts a prompt injection from an embarrassment into a breach.
Default-deny egress with an explicit allowlist of required destinations is the control, and it is the one most often missing because it is inconvenient during development and invisible when absent.
Should agents execute generated code?
Frequently yes. For data analysis, transformation, and computation, having a model write code that runs is substantially more reliable than asking it to compute directly, because the arithmetic is performed by a machine rather than predicted.
The condition is that the code runs where it can do no harm: isolated process, scoped filesystem, no credentials, restricted network, bounded resources. With those in place, code execution is a strong capability. Without them it is an arbitrary code execution vulnerability with a friendly interface.
Why must credentials be absent?
Because anything present in the environment is readable by code that runs there. Database passwords in environment variables, cloud credentials in mounted files, and API keys in configuration are all retrievable by a single line of generated code.
The correct pattern brokers authenticated calls outside the sandbox: the agent requests an action, the application performs it with its own credentials after checking authorisation, and the result returns. The credential never enters the execution environment. See ai access control.
What do resource limits protect?
The host and the budget. An agent can generate an infinite loop, an unbounded allocation, or a query that scans everything as easily as it generates correct code. Limits on CPU, memory, execution time, and disk contain that.
They also bound cost, which matters because runaway resource consumption in cloud environments is billed rather than merely disruptive.
Why should environments be ephemeral?
So that nothing carries between tasks. A long-lived environment accumulates files, installed packages, and state from previous work, which means one task can influence the next and a compromise persists.
Fresh environments per task, discarded afterwards, remove that entirely and cost little with modern container tooling.
What does sandboxing not do?
Decide what is permitted. An agent that should not delete customer records needs an authorisation check on that action; a sandbox that limits what else it could break does not address it, because the deletion happens through a legitimately provided tool.
Sandboxing bounds blast radius. Authorisation governs intent. Systems need both, and treating one as the other is a common and consequential error.
What should you do first?
Check egress. Run a test in your agent's execution environment that attempts an outbound connection to an arbitrary address and see whether it succeeds. In most implementations it does, and closing that is the single largest risk reduction available for the effort involved.
How does this apply to browser-using agents?
Browsing agents raise the same questions with a wider surface. A browser can reach anything on the network, render untrusted content, hold session cookies, and execute scripts, which makes it simultaneously the most useful and most dangerous tool an agent can hold.
The controls that work are the same in kind: a browser isolated from the host, with no access to the user's own sessions or credentials, restricted to an allowlist of destinations where the task permits, and fresh per task. An agent driving the user's own logged-in browser is a design that will eventually take an action the user did not intend under someone else's instructions.
What about multi-tenant systems?
Isolation must extend to tenants, not only to the host. An agent executing work for one customer must not be able to reach another customer's data, cached results, or temporary files, which means the sandbox boundary follows the tenant rather than the process. Shared execution environments across tenants are the failure most likely to become a reportable incident.
How FISTA Solutions helps
FISTA Solutions runs agent code in isolated ephemeral environments with default-deny egress, scoped filesystems, enforced resource limits, and no credentials present, brokering authenticated calls outside the sandbox with authorisation checked per action, through AI agents, AI enablement, and forward deployed engineers. The record behind the approach is 150+ projects for 50+ companies with 99.9% uptime.
To let agents execute code safely, message FISTA on WhatsApp, or read ai security checklist.
Share-ready article cover
Download the generated social format.
Clear answers
Questions raised by this field note.
Straightforward guidance for evaluating scope, fit, and the next step.
01Why is network egress the priority?
Because it is how data leaves. An agent executing code with unrestricted outbound access can send anything it can read anywhere, which turns a prompt injection into a data breach. Default-deny egress with an explicit allowlist closes that path.
02Should agents run generated code at all?
Often yes, for data analysis and transformation where it is far more reliable than asking a model to compute. The requirement is that the code runs somewhere it can do no harm — isolated process, scoped filesystem, no credentials, restricted network.
03What about credentials?
They should not be present in the execution environment. Credentials in environment variables or mounted files are readable by any code that runs there. Tool calls that need authentication should be brokered outside the sandbox by the application.
04Why do resource limits matter?
Because an agent can generate an infinite loop or an enormous allocation as easily as correct code, and without limits that consumes the host. Limits also bound cost, which is a practical concern as much as a security one.
05Does sandboxing replace authorisation?
No. Sandboxing limits blast radius; authorisation decides whether an action is permitted at all. An agent that should not be deleting records needs an authorisation check, not merely a container that limits what else it could break.
Continue exploring
Related capabilities
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.