Secure sandboxed code execution and agent toolbox
Project description
vital-agentbox
Secure sandboxed code execution for AI agents. Runs Python and shell commands inside a Chromium + Pyodide (WASM) sandbox with two independent security boundaries — no host filesystem or network access from agent code.
Features
- Dual-layer isolation — Chromium renderer sandbox + WASM linear memory
- Virtual shell — tree-sitter-bash parser with 30+ builtins on in-memory FS
- Python execution — Pyodide (CPython 3.11 compiled to WASM)
- Git operations — isomorphic-git on Emscripten MemFS with S3/MinIO storage
- AI-friendly editing —
editbuiltin with fuzzy + AST-aware matching - LangChain & Deep Agents — toolkit, tools, and sandbox backend integrations
- Scalable — orchestrator + worker architecture with Redis routing
Box types
| Type | Description |
|---|---|
| MemBox | Ephemeral in-memory sandbox (default) |
| GitBox | MemBox + isomorphic-git + pluggable storage (S3/MinIO/local) |
| FileSystemBox | Local dev only, backed by host directory |
Install
# Lightweight client (for LangGraph / Deep Agent apps)
pip install vital-agentbox[client]
# Sandbox worker (runs Chromium + Pyodide)
pip install vital-agentbox[worker]
playwright install chromium
# Orchestrator (routes requests to workers, no Chromium)
pip install vital-agentbox[orchestrator]
# LangChain integration
pip install vital-agentbox[langchain]
Quick start
from agentbox.client import AgentBoxClient
client = AgentBoxClient("http://localhost:8090")
# Create a sandbox
sandbox = client.create_sandbox_sync(box_type="mem")
# Run Python
result = sandbox.execute_sync("print(2 + 2)")
print(result.stdout) # "4\n"
# Run shell commands
result = sandbox.execute_sync('echo "hello" > /file.txt && cat /file.txt', language="shell")
print(result.stdout) # "hello\n"
# AI-friendly file editing
result = sandbox.execute_sync(
"edit /file.txt --old 'hello' --new 'world'",
language="shell",
)
# Cleanup
sandbox.destroy_sync()
LangChain integration
from agentbox.langchain import AgentBoxToolkit
toolkit = AgentBoxToolkit(base_url="http://localhost:8090")
tools = toolkit.get_tools()
# → [CodeExecutionTool, ShellExecutionTool, FileWriteTool, FileReadTool]
Docker
# Full stack (orchestrator + 2 workers + MinIO)
docker compose up
# Single worker
docker run -p 8090:8000 --shm-size=2g agentbox-worker
Documentation
Full documentation is in the docs/ directory:
- Getting started
- Sandbox overview
- Shell builtins reference
- Client SDK reference
- REST API reference
- Deployment guide
System requirements
- Python ≥ 3.11
- Chromium (via
playwright install chromium) — worker only - Redis — orchestrator only
- For PDF generation: pandoc + LaTeX
License
Apache 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vital_agentbox-0.1.2.tar.gz.
File metadata
- Download URL: vital_agentbox-0.1.2.tar.gz
- Upload date:
- Size: 122.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b620a85f2f2540a134ab0da7cd30949560fa9d7a6ceaa1dfd7da32445a0c3db6
|
|
| MD5 |
5720b910b6a6735dc3848528372f6f25
|
|
| BLAKE2b-256 |
b7d08b4f7d2a20f87186dccd2240516d8f0eb0801f8ba46178db8f23015e5641
|
File details
Details for the file vital_agentbox-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vital_agentbox-0.1.2-py3-none-any.whl
- Upload date:
- Size: 156.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24cbe282fc979987c86fe0ff520f2ac4321a059628d4336615258ebfb8e9ca48
|
|
| MD5 |
272ca82953a96f038242ba8fed71f818
|
|
| BLAKE2b-256 |
ce660fdf3f7c80241a418dd536de995bb8dbf61ecb5bbb9ee302f884451d05a4
|