Why does agent sandbox matter?
Model-generated code and third-party scripts can fail unpredictably or be manipulated by untrusted inputs. Running them inside a disposable sandbox contains faults and prevents accidental or malicious access to production infrastructure.
A sandbox gives an agent a separate place to run code, edit files or install packages, with limits on time, memory and network access.
The environment a sandbox starts from, meaning its files and package versions, should be pinned, so every run starts from the same place and results can be compared.
Key characteristics of agent sandbox
- Process and filesystem isolation separates agent-executed code from the host machine and other tenants.
- Resource caps bound execution time, memory, disk usage, and outbound network egress.
- Pinned base images and dependency versions keep evaluations and production runs reproducible.
- Ephemeral lifecycles tear down temporary state once a task finishes.
How agent sandbox works step by step
- 1. Pinned imageStart from fixed runtime and packages
- 2. Enforce limitsApply time, memory, and network caps
- 3. Run scriptExecute code on scoped input files
- 4. Return & wipeCapture result and discard container
Agent sandbox vs. host execution
| Dimension | Agent sandbox | Direct host execution |
|---|---|---|
| Blast radius | Contained to one disposable workspace | Shared server and environment variables |
| Network access | Explicitly restricted or disabled by default | Inherits host network permissions |
| Reproducibility | Pinned files and package versions per run | Drifts as host packages change |
| Secret exposure | Credentials injected only when authorized | Risk of reading local env or disk |
Example in practice
How Norilu handles agent sandbox
Frequently asked questions
- Does every AI agent need a sandbox?
- Only when the agent executes code, runs skill scripts, or manipulates untrusted files. Pure API-calling agents still need least-privilege tool permissions and secrets isolation.
- Why should sandbox environments be pinned?
- If package versions or system tools drift between runs, an evaluation failure becomes impossible to reproduce and debug reliably.