mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 14:03:52 +00:00
Add example and documentation for deploying sandbox-agent inside Docker Sandbox microVMs for enhanced isolation on macOS/Windows. - Add examples/docker-sandbox/ with TypeScript example - Add docs/deploy/docker-sandbox.mdx with setup guide using custom templates - Update docs navigation to include Docker Sandbox |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Dockerfile | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Docker Sandbox Example
Runs sandbox-agent inside a Docker Sandbox microVM for enhanced isolation.
Requirements
- Docker Desktop 4.58+ (macOS or Windows)
ANTHROPIC_API_KEYenvironment variable
Usage
pnpm start
First run builds the image and creates the VM (slow). Subsequent runs reuse the VM (fast).
To clean up resources:
pnpm cleanup
What it does
- Checks if VM exists, creates one if not (via sandboxd daemon API)
- Builds and loads the template image into the VM (one-time)
- Starts a container with sandbox-agent server (with proxy config for network access)
- Creates a Claude session and sends a test message
- Streams and displays Claude's response
Notes
- Docker Sandbox VMs have network isolation - outbound HTTPS goes through a proxy at
host.docker.internal:3128 - The container is configured with
HTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables NODE_TLS_REJECT_UNAUTHORIZED=0is set to bypass proxy SSL verification (for testing)ANTHROPIC_API_KEYis baked into the container at creation time - runpnpm cleanupand restart if you change the key- Resources are kept hot between runs for faster iteration - use
pnpm cleanupto remove