Agent Sandbox

Simple Definition

An agent sandbox is a restricted environment that limits what a single AI agent can access, change, or reach over a network while it works. It’s the fence around what one agent is allowed to do, not just a warning label.

Why It Matters

An agent optimizing to finish a task can take broader action than intended without any malicious intent, the goal was underspecified, the tools available were more powerful than the job needed, or it kept retrying until something technically worked. A sandbox limits the damage regardless of why it happened, because the boundary holds even if nobody reviews the action in the moment.

Agent Sandbox vs. Agent Runtime Isolation

These are related but different. An agent sandbox restricts what one agent can do, its file access, network reach, and tool permissions. Agent runtime isolation keeps multiple agents’ execution environments separate from each other, so one agent cannot reach into another agent’s code, data, or session. A single agent can be sandboxed and still share infrastructure unsafely with other agents; isolation and sandboxing solve different halves of the same problem.

Example

A coding agent given access to an entire production filesystem and unrestricted network access can, in principle, read secrets it doesn’t need or call an unexpected API. The same agent inside a sandbox scoped to one project directory, no network access, and a defined list of allowed tools simply cannot do either, regardless of what it decides to try.

What Good Sandboxing Looks Like

  • Scoped read access, narrower write access
  • No unrestricted network access by default
  • A defined allowlist of tools, not open tool access
  • Retry and budget limits so a stuck agent fails safely
  • Logging of every action taken

For a full walkthrough, see AI Agent Sandboxes Explained.

Continue learning

Explore related guides, tools, workflows, and prompts that help you go deeper into this topic.

See AI terms in action

Browse practical AI workflows that use the concepts in this glossary.

Last updated: