Two Ways to Sandbox an Agent

Either sandbox the whole agent, or keep the thinking outside and sandbox the doing: code execution, tool calls, sessions, shells and browsers.

Contents
    Hand-drawn diagram of two ways to sandbox an agent. Mode 1 draws one sandbox around the agent, its tool calls and its code: thinking and doing in one boundary. In Mode 2 the agent thinks outside and sends work into a sandbox that holds code execution, tool calls, sessions, shells and browsers, reached via agentic APIs or framework abstractions. A highlighted bar under both reads same enforcement layer for both.

    Use it when Choosing an isolation boundary before letting an agent execute code or touch production systems.

    When an agent can only generate text, the worst outcome is a bad answer. When it can execute code, the worst outcome is a deleted production database. Every sandboxing approach comes down to one question: does the thinking sit inside the boundary or outside it?

    Mode 1: Sandbox the whole agent. The agent process, its tool calls and its code all run inside one boundary. The agent holds no credentials. Right for developer laptops and CI/CD, where the host holds credentials the agent should never see.

    Mode 2: Sandbox the doing. Thinking is separate from doing. The agent loop runs outside and delegates execution to disposable sandboxes you control, with credentials injected at the network boundary. It reaches them through agentic APIs or through a framework’s sandbox abstraction, and the same split covers everything the agent acts with:

    • code execution
    • tool calls
    • sessions
    • shells
    • browsers

    Right for multi-tenant platforms and production.

    Same enforcement layer for both. That flexibility is what makes sandboxing a platform capability, not a point solution.

    Topics

    Agents in Production 10Building with AI 9AI Product Strategy 24

    Start here

    How Agents Run in ProductionBeyond LLMs: The Whole Product Framework for AIThe Verification Bottleneck: Why AI's Real Cost Is Human Attention

    ↑ ↓ to move, Enter for all results