Metadata-Version: 2.4
Name: vital-agentbox
Version: 0.1.1
Summary: Secure sandboxed code execution and agent toolbox
Author-email: Marc Hadfield <marc@vital.ai>
License: Apache-2.0
Project-URL: Homepage, https://github.com/vital-ai/vital-agentbox
Project-URL: Repository, https://github.com/vital-ai/vital-agentbox
Project-URL: Issues, https://github.com/vital-ai/vital-agentbox/issues
Keywords: agent,sandbox,pyodide,code-execution,langgraph
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Security
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.22
Requires-Dist: tree-sitter-bash>=0.21
Requires-Dist: ast-grep-py>=0.41.0
Provides-Extra: client
Requires-Dist: httpx>=0.25; extra == "client"
Provides-Extra: worker
Requires-Dist: playwright; extra == "worker"
Requires-Dist: python-magic>=0.4.27; extra == "worker"
Requires-Dist: markdown-it-py>=3.0; extra == "worker"
Requires-Dist: mdit-py-plugins>=0.4; extra == "worker"
Requires-Dist: pypandoc>=1.5; extra == "worker"
Requires-Dist: panflute>=2.3.1; extra == "worker"
Requires-Dist: matplotlib; extra == "worker"
Requires-Dist: numpy; extra == "worker"
Requires-Dist: fastapi>=0.104; extra == "worker"
Requires-Dist: uvicorn[standard]>=0.24; extra == "worker"
Requires-Dist: boto3>=1.28; extra == "worker"
Requires-Dist: httpx>=0.25; extra == "worker"
Requires-Dist: PyJWT>=2.8; extra == "worker"
Provides-Extra: orchestrator
Requires-Dist: fastapi>=0.104; extra == "orchestrator"
Requires-Dist: uvicorn[standard]>=0.24; extra == "orchestrator"
Requires-Dist: redis>=5.0; extra == "orchestrator"
Requires-Dist: boto3>=1.28; extra == "orchestrator"
Requires-Dist: PyJWT>=2.8; extra == "orchestrator"
Requires-Dist: httpx>=0.25; extra == "orchestrator"
Provides-Extra: langchain
Requires-Dist: httpx>=0.25; extra == "langchain"
Requires-Dist: langchain-core>=0.2; extra == "langchain"
Requires-Dist: deepagents>=0.4; extra == "langchain"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: httpx>=0.25; extra == "dev"
Requires-Dist: asgi-lifespan>=2.0; extra == "dev"
Requires-Dist: deepagents>=0.4; extra == "dev"
Requires-Dist: langchain-core>=0.2; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# 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** — `edit` 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

```bash
# 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

```python
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

```python
from agentbox.langchain import AgentBoxToolkit

toolkit = AgentBoxToolkit(base_url="http://localhost:8090")
tools = toolkit.get_tools()
# → [CodeExecutionTool, ShellExecutionTool, FileWriteTool, FileReadTool]
```

## Docker

```bash
# 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/`](docs/index.md) directory:

- [Getting started](docs/getting-started/install.md)
- [Sandbox overview](docs/sandbox/overview.md)
- [Shell builtins reference](docs/sandbox/builtins.md)
- [Client SDK reference](docs/api/client-sdk.md)
- [REST API reference](docs/api/worker-api.md)
- [Deployment guide](docs/getting-started/deployment.md)

## System requirements

- Python ≥ 3.11
- Chromium (via `playwright install chromium`) — worker only
- Redis — orchestrator only
- For PDF generation: pandoc + LaTeX

## License

Apache 2.0
