{"id":32134530,"url":"https://github.com/agent-infra/sandbox","last_synced_at":"2026-03-01T10:32:57.293Z","repository":{"id":316412047,"uuid":"1033268244","full_name":"agent-infra/sandbox","owner":"agent-infra","description":"All-in-One Sandbox for AI Agents that combines Browser, Shell, File, MCP and VSCode Server in a single Docker container.","archived":false,"fork":false,"pushed_at":"2026-02-25T05:11:22.000Z","size":40455,"stargazers_count":2619,"open_issues_count":47,"forks_count":233,"subscribers_count":24,"default_branch":"main","last_synced_at":"2026-02-25T10:40:19.920Z","etag":null,"topics":["agent","all-in-one","browser","filesystem","mcp","sandbox","shell"],"latest_commit_sha":null,"homepage":"https://sandbox.agent-infra.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agent-infra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-06T14:51:05.000Z","updated_at":"2026-02-25T09:29:59.000Z","dependencies_parsed_at":"2025-10-27T02:30:48.684Z","dependency_job_id":"86dd75ec-629a-4dce-9245-118f4efad69c","html_url":"https://github.com/agent-infra/sandbox","commit_stats":null,"previous_names":["agent-infra/sandbox"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/agent-infra/sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-infra%2Fsandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-infra%2Fsandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-infra%2Fsandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-infra%2Fsandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agent-infra","download_url":"https://codeload.github.com/agent-infra/sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-infra%2Fsandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29966826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T09:33:09.965Z","status":"ssl_error","status_checked_at":"2026-03-01T09:25:48.915Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","all-in-one","browser","filesystem","mcp","sandbox","shell"],"created_at":"2025-10-21T03:01:55.161Z","updated_at":"2026-03-01T10:32:57.288Z","avatar_url":"https://github.com/agent-infra.png","language":"Python","funding_links":[],"categories":["Agent Orchestration","Python","📚 Projects (1974 total)","Reference Implementations","MCP Servers","📦 Sandboxing and Isolation","智能体 Agents","A01_文本生成_文本对话","\u003ca name=\"Python\"\u003e\u003c/a\u003ePython","Containers, LXC, and packaged runtimes","Agent Integration \u0026 Deployment Tools","📦 Sandboxing \u0026 Isolation Environments","MCP Servers \u0026 Protocol"],"sub_categories":["MCP Servers","Demo Harnesses","Browser Automation","Anthropic Engineering \u0026 Blog","大语言对话模型及数据","Multiplatform","AI Agent Development"],"readme":"# AIO Sandbox - All-in-One Agent Sandbox Environment\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./website/docs/public/aio-icon.png\" alt=\"logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e🌐 Browser | 💻 Terminal | 📁 File | 🔧 VSCode | 📊 Jupyter | 🤖 MCP\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\n        🌐 \u003ca href=\"https://sandbox.agent-infra.com/\"\u003eWebsite\u003c/a\u003e\u0026nbsp\u0026nbsp\n        | \u0026nbsp\u0026nbsp🔌 \u003ca href=\"https://sandbox.agent-infra.com/api\"\u003eAPI\u003c/a\u003e\u0026nbsp\u0026nbsp\n        | \u0026nbsp\u0026nbsp📑 \u003ca href=\"https://arxiv.org/pdf/2509.02544#S2.SS2\"\u003ePaper\u003c/a\u003e\u0026nbsp\u0026nbsp\n        | \u0026nbsp\u0026nbsp🌟 \u003ca href=\"https://github.com/agent-infra/sandbox/tree/main/examples\"\u003eExamples\u003c/a\u003e\u0026nbsp\u0026nbsp\n        | \u0026nbsp\u0026nbsp📊 \u003ca href=\"https://github.com/agent-infra/sandbox/tree/main/evaluation\"\u003eEvaluation\u003c/a\u003e \u0026nbsp\u0026nbsp\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/agent-infra/sandbox/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/agent-infra/sandbox\" alt=\"Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/agent-infra/sandbox/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/agent-infra/sandbox\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/agent-sandbox/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/agent-sandbox\" alt=\"PyPI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@agent-infra/sandbox\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@agent-infra/sandbox\" alt=\"npm\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n![](./website/docs/public/images/aio-index.png)\n\n## 🚀 Quick Start\n\nGet up and running in 30 seconds:\n\n```bash\ndocker run --security-opt seccomp=unconfined --rm -it -p 8080:8080 ghcr.io/agent-infra/sandbox:latest\n```\n\nFor users in mainland China:\n\n```bash\ndocker run --security-opt seccomp=unconfined --rm -it -p 8080:8080 enterprise-public-cn-beijing.cr.volces.com/vefaas-public/all-in-one-sandbox:latest\n```\n\nUse a specific version in the format `agent-infra/sandbox:${version}`, for example, to use version 1.0.0.150:\n\n```bash\ndocker run --security-opt seccomp=unconfined --rm -it -p 8080:8080 ghcr.io/agent-infra/sandbox:1.0.0.150\n# or users in mainland China\ndocker run --security-opt seccomp=unconfined --rm -it -p 8080:8080 enterprise-public-cn-beijing.cr.volces.com/vefaas-public/all-in-one-sandbox:1.0.0.150\n```\n\nOnce running, access the environment at:\n- 📖 **Documentation**: http://localhost:8080/v1/docs\n- 🌐 **VNC Browser**: http://localhost:8080/vnc/index.html?autoconnect=true\n- 💻 **VSCode Server**: http://localhost:8080/code-server/\n- 🤖 **MCP Services**: http://localhost:8080/mcp\n\n## 🎯 What is AIO Sandbox?\n\nAIO Sandbox is an **all-in-one** agent sandbox environment that combines Browser, Shell, File, MCP operations, and VSCode Server in a single Docker container. Built on cloud-native lightweight sandbox technology, it provides a unified, secure execution environment for AI agents and developers.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/aio-sandbox.png\" alt=\"AIO Sandbox Architecture\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### Why Choose AIO Sandbox?\n\nTraditional sandboxes are **single-purpose** (browser, code, or shell), making file sharing and functional coordination extremely challenging. AIO Sandbox solves this by providing:\n\n- ✅ **Unified File System** - Files downloaded in browser are instantly available in Shell/File operations\n- ✅ **Multiple Interfaces** - VNC, VSCode, Jupyter, and Terminal in one unified environment\n- ✅ **Secure Execution** - Sandboxed Python and Node.js execution with safety guarantees\n- ✅ **Zero Configuration** - Pre-configured MCP servers and development tools ready to use\n- ✅ **Agent-Ready** - MCP-compatible APIs for seamless AI agent integration\n\n## 📦 Installation\n\n### SDK Installation\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n**Python**\n```bash\npip install agent-sandbox\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**TypeScript/JavaScript**\n```bash\nnpm install @agent-infra/sandbox\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**Golang**\n```bash\ngo get github.com/agent-infra/sandbox-sdk-go\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Basic Usage\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n**Python Example**\n```python\nfrom agent_sandbox import Sandbox\n\n# Initialize client\nclient = Sandbox(base_url=\"http://localhost:8080\")\nhome_dir = client.sandbox.get_context().home_dir\n\n# Execute shell commands\nresult = client.shell.exec_command(command=\"ls -la\")\nprint(result.data.output)\n\n# File operations\ncontent = client.file.read_file(file=f\"{home_dir}/.bashrc\")\nprint(content.data.content)\n\n# Browser automation\nscreenshot = client.browser.screenshot()\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**TypeScript Example**\n```typescript\nimport { Sandbox } from '@agent-infra/sandbox';\n\n// Initialize client\nconst sandbox = new Sandbox({ baseURL: 'http://localhost:8080' });\n\n// Execute shell commands\nconst result = await sandbox.shell.exec({ command: 'ls -la' });\nconsole.log(result.output);\n\n// File operations\nconst content = await sandbox.file.read({ path: '/home/gem/.bashrc' });\nconsole.log(content);\n\n// Browser automation\nconst screenshot = await sandbox.browser.screenshot();\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🌟 Key Features\n\n### 🔗 Unified Environment\nAll components run in the same container with a shared filesystem, enabling seamless workflows:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/aio-index.png\" alt=\"Unified Environment\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### 🌐 Browser Automation\nFull browser control through multiple interfaces:\n- **VNC** - Visual browser interaction through remote desktop\n- **CDP** - Chrome DevTools Protocol for programmatic control\n- **MCP** - High-level browser automation tools\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/browser.png\" alt=\"Browser Automation\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### 💻 Development Tools\nIntegrated development environment with:\n- **VSCode Server** - Full IDE experience in browser\n- **Jupyter Notebook** - Interactive Python environment\n- **Terminal** - WebSocket-based terminal access\n- **Port Forwarding** - Smart preview for web applications\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/code-server.png\" alt=\"VSCode Server\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### 🤖 MCP Integration\nPre-configured Model Context Protocol servers:\n- **Browser** - Web automation and scraping\n- **File** - File system operations\n- **Shell** - Command execution\n- **Markitdown** - Document processing\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/mcp.png\" alt=\"MCP Integration\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n## 📚 Complete Example\n\nConvert a webpage to Markdown with embedded screenshot:\n\n```python\nimport asyncio\nimport base64\nfrom playwright.async_api import async_playwright\nfrom agent_sandbox import Sandbox\n\nasync def site_to_markdown():\n    # Initialize sandbox client\n    c = Sandbox(base_url=\"http://localhost:8080\")\n    home_dir = c.sandbox.get_context().home_dir\n\n    # Browser: Automation to download HTML\n    async with async_playwright() as p:\n        browser_info = c.browser.get_info().data\n        page = await (await p.chromium.connect_over_cdp(browser_info.cdp_url)).new_page()\n        await page.goto(\"https://example.com\", wait_until=\"networkidle\")\n        html = await page.content()\n        screenshot_b64 = base64.b64encode(await page.screenshot()).decode('utf-8')\n\n    # Jupyter: Convert HTML to markdown in sandbox\n    c.jupyter.execute_code(code=f\"\"\"\nfrom markdownify import markdownify\nhtml = '''{html}'''\nscreenshot_b64 = \"{screenshot_b64}\"\n\nmd = f\"{{markdownify(html)}}\\\\n\\\\n![Screenshot](data:image/png;base64,{{screenshot_b64}})\"\nwith open('{home_dir}/site.md', 'w') as f:\n    f.write(md)\nprint(\"Done!\")\n\"\"\")\n\n    # Shell: List files in sandbox\n    list_result = c.shell.exec_command(command=f\"ls -lh {home_dir}\")\n    print(f\"Files in sandbox: {list_result.data.output}\")\n\n    # File: Read the generated markdown\n    return c.file.read_file(file=f\"{home_dir}/site.md\").data.content\n\nif __name__ == \"__main__\":\n    result = asyncio.run(site_to_markdown())\n    print(f\"Markdown saved successfully!\")\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/docs/public/images/example.png\" alt=\"Example Output\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    🌐 Browser + VNC                        │\n├─────────────────────────────────────────────────────────────┤\n│  💻 VSCode Server  │  🐚 Shell Terminal  │  📁 File Ops   │\n├─────────────────────────────────────────────────────────────┤\n│              🔗 MCP Hub + 🔒 Sandbox Fusion               │\n├─────────────────────────────────────────────────────────────┤\n│         🚀 Preview Proxy + 📊 Service Monitoring          │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## 🛠️ API Reference\n\n### Core APIs\n\n| Endpoint | Description |\n|----------|-------------|\n| `/v1/sandbox` | Get sandbox environment information |\n| `/v1/shell/exec` | Execute shell commands |\n| `/v1/file/read` | Read file contents |\n| `/v1/file/write` | Write file contents |\n| `/v1/browser/screenshot` | Take browser screenshot |\n| `/v1/jupyter/execute` | Execute Jupyter code |\n\n### MCP Servers\n\n| Server | Tools Available |\n|--------|----------------|\n| `browser` | `navigate`, `screenshot`, `click`, `type`, `scroll` |\n| `file` | `read`, `write`, `list`, `search`, `replace` |\n| `shell` | `exec`, `create_session`, `kill` |\n| `markitdown` | `convert`, `extract_text`, `extract_images` |\n\n## 🚢 Deployment\n\n### Docker Compose\n\n```yaml\nversion: '3.8'\nservices:\n  sandbox:\n    container_name: aio-sandbox\n    image: ghcr.io/agent-infra/sandbox:latest\n    volumes:\n      - /tmp/gem/vite-project:/home/gem/vite-project\n    security_opt:\n      - seccomp:unconfined\n    extra_hosts:\n      - \"host.docker.internal:host-gateway\"\n    restart: \"unless-stopped\"\n    shm_size: \"2gb\"\n    ports:\n      - \"${HOST_PORT:-8080}:8080\"\n    environment:\n      PROXY_SERVER: ${PROXY_SERVER:-host.docker.internal:7890}\n      JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY:-}\n      DNS_OVER_HTTPS_TEMPLATES: ${DNS_OVER_HTTPS_TEMPLATES:-}\n      WORKSPACE: ${WORKSPACE:-\"/home/gem\"}\n      HOMEPAGE: ${HOMEPAGE:-}\n      BROWSER_EXTRA_ARGS: ${BROWSER_EXTRA_ARGS:-}\n      TZ: ${TZ:-Asia/Singapore}\n      WAIT_PORTS: ${WAIT_PORTS:-}\n```\n\n### Kubernetes\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: aio-sandbox\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: aio-sandbox\n  template:\n    metadata:\n      labels:\n        app: aio-sandbox\n    spec:\n      containers:\n      - name: aio-sandbox\n        image: ghcr.io/agent-infra/sandbox:latest\n        ports:\n        - containerPort: 8080\n        resources:\n          limits:\n            memory: \"2Gi\"\n            cpu: \"1000m\"\n```\n\n## 🤝 Integration Examples\n\n### Browser Use Integration\n\n```python\nimport asyncio\n\nfrom agent_sandbox import Sandbox\nfrom browser_use import Agent, Tools\nfrom browser_use.browser import BrowserProfile, BrowserSession\nfrom browser_use.llm import ChatOpenAI\n\nsandbox = Sandbox(base_url=\"http://localhost:8080\")\nprint(\"sandbox\", sandbox.browser)\ncdp_url = sandbox.browser.get_info().data.cdp_url\n\nbrowser_session = BrowserSession(\n    browser_profile=BrowserProfile(cdp_url=cdp_url, is_local=True)\n)\ntools = Tools()\n\n\nasync def main():\n    agent = Agent(\n        task='Visit https://duckduckgo.com and search for \"browser-use founders\"',\n        llm=ChatOpenAI(model=\"gcp-claude4.1-opus\"),\n        tools=tools,\n        browser_session=browser_session,\n    )\n\n    await agent.run()\n    await browser_session.kill()\n\n    input(\"Press Enter to close...\")\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### LangChain Integration\n\n```python\nfrom langchain.tools import BaseTool\nfrom agent_sandbox import Sandbox\n\nclass SandboxTool(BaseTool):\n    name = \"sandbox_execute\"\n    description = \"Execute commands in AIO Sandbox\"\n\n    def _run(self, command: str) -\u003e str:\n        client = Sandbox(base_url=\"http://localhost:8080\")\n        result = client.shell.exec_command(command=command)\n        return result.data.output\n```\n\n### OpenAI Assistant Integration\n\n```python\nfrom openai import OpenAI\nfrom agent_sandbox import Sandbox\nimport json\n\nclient = OpenAI(\n    api_key=\"your_api_key\",\n)\nsandbox = Sandbox(base_url=\"http://localhost:8080\")\n\n\n# define a tool to run code in the sandbox\ndef run_code(code, lang=\"python\"):\n    if lang == \"python\":\n        return sandbox.jupyter.execute_code(code=code).data\n    return sandbox.nodejs.execute_nodejs_code(code=code).data\n\n\n# Use OpenAI\nresponse = client.chat.completions.create(\n    model=\"gpt-4\",\n    messages=[{\"role\": \"user\", \"content\": \"calculate 1+1\"}],\n    tools=[\n        {\n            \"type\": \"function\",\n            \"function\": {\n                \"name\": \"run_code\",\n                \"parameters\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"code\": {\"type\": \"string\"},\n                        \"lang\": {\"type\": \"string\"},\n                    },\n                },\n            },\n        }\n    ],\n)\n\n\nif response.choices[0].message.tool_calls:\n    args = json.loads(response.choices[0].message.tool_calls[0].function.arguments)\n    print(\"args\", args)\n    result = run_code(**args)\n    print(result['outputs'][0]['text'])\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nAIO Sandbox is released under the [Apache License 2.0](LICENSE).\n\n## 🙏 Acknowledgments\n\nBuilt with ❤️ by the Agent Infra team. Special thanks to all contributors and the open-source community.\n\n## 📞 Support\n\n- 📖 [Documentation](https://sandbox.agent-infra.com)\n- 💬 [GitHub Discussions](https://github.com/agent-infra/sandbox/discussions)\n- 🐛 [Issue Tracker](https://github.com/agent-infra/sandbox/issues)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eReady to revolutionize your AI development workflow?\u003c/strong\u003e\u003cbr/\u003e\n  \u003ca href=\"https://github.com/agent-infra/sandbox\"\u003e⭐ Star us on GitHub\u003c/a\u003e •\n  \u003ca href=\"https://sandbox.agent-infra.com\"\u003e📚 Read the Docs\u003c/a\u003e •\n  \u003ca href=\"https://github.com/agent-infra/sandbox/issues\"\u003e🐛 Report Issues\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-infra%2Fsandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagent-infra%2Fsandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-infra%2Fsandbox/lists"}