AI

Agent Sandbox: All-in-One Sandbox for AI Agents with Browser, Shell, and VSCode

Agent Sandbox is an all-in-one Docker sandbox combining browser, shell, file system, MCP, and VSCode Server for secure AI agent execution.

Keeping this site alive takes effort — your support means everything.
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分! 無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!
Agent Sandbox: All-in-One Sandbox for AI Agents with Browser, Shell, and VSCode

AI agents need environments to execute in – places to run code, browse the web, edit files, and interact with tools. Building these environments from scratch for each agent platform is tedious and error-prone. Agent Sandbox solves this by providing a complete, pre-configured Docker sandbox that combines a browser, shell, file system, MCP server, and VSCode Server in a single containerized workspace.

Developed by agent-infra, Agent Sandbox is designed as the execution environment for AI agents that need to perform real-world tasks. Instead of cobbling together separate tools for browser automation, code execution, and file management, developers get a unified sandbox with all of these capabilities pre-integrated and ready to use.

The sandbox runs as a Docker container with strong isolation guarantees. Agents interact with it through a clean REST API or through official SDKs for Python and TypeScript, making it easy to integrate into existing agent platforms like Claude Code, OpenAI Operators, or custom agent frameworks.


What Components Does Agent Sandbox Include?

The sandbox combines multiple tools in a single container, each serving a different aspect of an agent’s task execution needs.

graph TD
    A[Agent Sandbox Container] --> B[Chromium Browser]
    A --> C[Shell Environment]
    A --> D[File System]
    A --> E[MCP Server]
    A --> F[VSCode Server]
    B --> G[Web browsing / Automation]
    B --> H[Screenshots / DOM access]
    C --> I[Command execution]
    C --> J[Script running]
    D --> K[Read / Write files]
    D --> K[Project workspace]
    E --> L[Tool access via MCP]
    F --> M[Web-based code editing]
ComponentPurposeHow Agents Use It
Chromium BrowserWeb browsing and automationNavigate, click, screenshot, extract DOM
Shell EnvironmentCommand executionRun scripts, install packages, execute tools
File SystemPersistent storageRead/write project files, store outputs
MCP ServerTool protocolExpose sandbox tools via Model Context Protocol
VSCode ServerWeb IDEHuman-in-the-loop code review and editing

What SDKs Does Agent Sandbox Provide?

The sandbox offers multiple integration paths depending on your agent platform and programming language preferences.

SDK / InterfaceLanguageKey MethodsUse Case
Python SDKPythonSandbox(), .run(), .browse(), .write()Python-based agent frameworks
TypeScript SDKTypeScriptSandbox.create(), .execute(), .screenshot()Node.js agent platforms
MCP InterfaceAny MCP clientTool discovery via MCPAnthropic Claude, OpenAI, custom agents
REST APIAny HTTP clientPOST /sandbox, GET /statusDirect HTTP integration

The Python SDK is the most mature, offering methods for all sandbox operations including browser interaction, shell commands, file operations, and VSCode Server management.


How Do You Start Using Agent Sandbox?

Getting started requires Docker and a single SDK installation.

graph LR
    A[Install Docker] --> B[pip install agent-sandbox]
    B --> C[from agent_sandbox import Sandbox]
    C --> D[sandbox = Sandbox.create()]
    D --> E[sandbox.run('python script.py')]
    D --> F[screenshot = sandbox.browser.screenshot()]
    D --> G[sandbox.mcp.connect()]
StepActionCommand
1Install DockerFollow Docker installation guide
2Install SDKpip install agent-sandbox or npm install agent-sandbox
3Create sandboxsandbox = Sandbox.create()
4Execute tasksresult = sandbox.run("curl https://api.example.com")
5Browse webscreenshot = sandbox.browser.screenshot("https://example.com")
6Clean upsandbox.close()

FAQ

What is Agent Sandbox? Agent Sandbox is an all-in-one Docker sandbox developed by agent-infra that provides a complete execution environment for AI agents, combining a browser, shell, file system, MCP server, and VSCode Server in a single containerized workspace.

What features does Agent Sandbox include? Agent Sandbox includes a Chromium browser with remote debugging, a shell environment, persistent file system, MCP server integration for tool access, VSCode Server for web-based code editing, and network controls. All components are pre-configured to work together in a secure, isolated Docker environment.

What SDKs are available for Agent Sandbox? Agent Sandbox provides official SDKs for Python and TypeScript, plus an MCP interface for agent platforms that support the Model Context Protocol. The SDKs handle container lifecycle management, tool calls through the sandbox API, and result collection.

How do I get started with Agent Sandbox? Quick start: clone the repository, run pip install agent-sandbox or npm install agent-sandbox, then create a sandbox instance with a single API call. The Docker image is automatically pulled on first use, and the sandbox starts in seconds.

How secure is Agent Sandbox? Agent Sandbox provides strong security isolation through Docker containerization. Each sandbox runs in an isolated container with no network access by default, no access to the host file system, limited resource allocation, and an ephemeral file system that is destroyed when the sandbox is closed.


Further Reading

TAG
CATEGORIES