Boost AI Agent Productivity with an All‑In‑One Sandbox Container

This article introduces AIO Sandbox, an all‑in‑one Docker container that unifies browser, shell, VSCode, and Jupyter environments, provides agent‑oriented APIs and multi‑language SDKs, and demonstrates a quick‑start workflow and a Python example converting web pages to Markdown.

Go Programming World
Go Programming World
Go Programming World
Boost AI Agent Productivity with an All‑In‑One Sandbox Container

Background: Why the project was created

When developing AI agents, we often need to open a browser to crawl or screenshot pages, run scripts or shell commands, read/write files, and debug results in VSCode or Jupyter. These tools are scattered, making seamless collaboration difficult.

Features of AIO Sandbox

Unified file system – browser, terminal, and VSCode share the same directory, eliminating cross‑process file transfers.

Multi‑interface integration – the container includes a VNC browser, code‑server VSCode, shell, Jupyter, file manager, and MCP operations, all accessible via a web UI.

Agent‑oriented API – every capability can be invoked through API or SDK, allowing agents to control the browser, execute shell commands, manipulate files, and run Jupyter code.

Multi‑language SDK – official support for Python, TypeScript/JavaScript, and Go.

Typical use cases include web interaction, secure code execution, file operations, and seamless access to multiple development tools.

Quick start: One‑command launch

Run the container with Docker:

# Pull and run the latest version
docker run --security-opt seccomp=unconfined --rm -it -p 8080:8080 ghcr.io/agent-infra/sandbox:latest

After starting, the dashboard is available at http://localhost:8080 and documentation at http://localhost:8080/v1/docs .

Example: Convert a web page to Markdown

The following Python script uses the sandbox to download a page, capture a screenshot, run Jupyter code to convert HTML to Markdown, and list files in the sandbox.

import asyncio
import base64
from playwright.async_api import async_playwright
from agent_sandbox import Sandbox

async def site_to_markdown():
    c = Sandbox(base_url="http://127.0.0.1:8080")
    home_dir = c.sandbox.get_context().home_dir
    async with async_playwright() as p:
        browser_info = c.browser.get_info().data
        page = await (await p.chromium.connect_over_cdp(browser_info.cdp_url)).new_page(
            viewport={"width": browser_info.viewport.width, "height": browser_info.viewport.height}
        )
        await page.goto("https://sandbox.agent-infra.com/", wait_until="networkidle")
        html = await page.content()
        screenshot_b64 = base64.b64encode(
            await page.screenshot(full_page=False, type='png')
        ).decode('utf-8')
    c.jupyter.execute_code(
        code=f"""from markdownify import markdownify
html = '''{html}'''
screenshot_b64 = "{screenshot_b64}"
md = f"{markdownify(html)}

![Screenshot](data:image/png;base64,{screenshot_b64})"
with open('{home_dir}/site.md', 'w') as f:
    f.write(md)
print(\"Done!\")"""
    )
    list_result = c.shell.exec_command(command=f"ls -lh {home_dir}")
    print(f"
Files in sandbox home:
{list_result.data.output}")
    return "./output.md"

if __name__ == "__main__":
    result = asyncio.run(site_to_markdown())
    print(f"
Markdown saved to: {result}")

Note: Use agent-sandbox==0.0.14 to avoid a bug in the latest SDK version.

The generated Markdown file and screenshot are shown below.

Conclusion

AIO Sandbox acts as a clean runtime and playground for multi‑capability AI agents, enabling rapid verification of ideas without risking the host system. It is especially valuable for researchers building agents that need to orchestrate multiple tools in a single, programmable environment.

DockerPythonAI agentssandboxPlaywrightJupyter
Go Programming World
Written by

Go Programming World

Mobile version of tech blog https://jianghushinian.cn/, covering Golang, Docker, Kubernetes and beyond.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.