Skip to main content

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 editingedit builtin 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:

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

vital_agentbox-0.1.5.tar.gz (174.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vital_agentbox-0.1.5-py3-none-any.whl (224.8 kB view details)

Uploaded Python 3

File details

Details for the file vital_agentbox-0.1.5.tar.gz.

File metadata

  • Download URL: vital_agentbox-0.1.5.tar.gz
  • Upload date:
  • Size: 174.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for vital_agentbox-0.1.5.tar.gz
Algorithm Hash digest
SHA256 da3a60d37dff9666bb36a89b0ef4a463ecf59fb15b3557261db8bfccb86ea7b7
MD5 d2a627c9279e6c4f4f877725612e3600
BLAKE2b-256 93a3776c0989175028dbcc139830715df5da95439237d8a9337dfbc9cd9c56b8

See more details on using hashes here.

File details

Details for the file vital_agentbox-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: vital_agentbox-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 224.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for vital_agentbox-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a14c1be739912ec42022e76050e1c83d2d1f75da51f53a679cd11fb8b609bc3a
MD5 a9305ddce7b53cffa13e836e3a62c3e5
BLAKE2b-256 e125ef1333ef7a314c45c95097e94a326b99e285559bc5fd131221e0ede30afd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page