Back to glossary

Agent Sandboxing

Isolating agent execution in restricted environments that limit access to system resources, networks, and data. Sandboxing prevents agents from performing unintended or harmful actions beyond their authorized scope.

Agent sandboxing is a security-first approach to agent deployment. Since agents can execute code, call APIs, and interact with systems, they need strict boundaries to prevent accidental or malicious misuse. A sandbox restricts what resources the agent can access (file system, network, databases), what actions it can perform (read-only vs. read-write), and how much of each resource it can consume (CPU, memory, API calls).

For teams deploying agents that execute code or interact with production systems, sandboxing is essential. Container-based sandboxes (like Docker or Firecracker) provide strong isolation for code execution. API-level sandboxes use token scoping and permission policies to limit what external services the agent can access. Network sandboxes restrict which endpoints the agent can reach. Implement defense in depth: even if the model generates malicious code, the sandbox prevents it from causing harm. Common sandbox implementations include E2B for cloud code execution, Docker containers for custom environments, and policy-as-code frameworks for API access control.

Related Terms