Architecture
Requirements
- Docker Desktop v4.40+ with sandbox capabilities enabled
- Anthropic API key
- Platform credentials for your messaging channels (e.g., Telegram bot token, WhatsApp phone number, Discord bot token, Slack app token)
Setup
Patch the Dockerfile for proxy support
Docker Sandboxes use a MITM proxy for network isolation. The Dockerfile must accept proxy build arguments so the container can install packages through the proxy:
Update the build script
Forward proxy environment variables during
docker build so that package managers (apt, npm) can reach the internet through the sandbox proxy:Patch the container runner
Three changes are required in
src/container-runner.ts:- Replace
/dev/nullmounts with empty files —/dev/nullbind-mounts don’t work inside sandboxes - Forward proxy environment variables to spawned agent containers (
http_proxy,https_proxy,NODE_EXTRA_CA_CERTS) - Mount the sandbox CA certificate so agent containers trust the MITM proxy
Configure upstream API calls
If your code makes HTTPS requests to the Anthropic API or other services, configure
HttpsProxyAgent to route through the sandbox proxy:Troubleshooting
SSL certificate errors
SSL certificate errors
The sandbox MITM proxy terminates TLS connections. If you see For production, mount the sandbox CA certificate and set
UNABLE_TO_VERIFY_LEAF_SIGNATURE or similar errors:NODE_EXTRA_CA_CERTS.Path mounting failures
Path mounting failures
Ensure NanoClaw lives inside the sandbox workspace directory. Paths outside the workspace are not accessible from within the sandbox.
Agent containers can't reach the network
Agent containers can't reach the network
Verify that proxy environment variables are forwarded to agent containers. Check the container runner patch in Step 3 above.
WhatsApp authentication issues
WhatsApp authentication issues
WhatsApp’s web client needs direct access to
web.whatsapp.com. Configure a proxy bypass for this domain in your WhatsApp channel adapter.When to use Docker Sandboxes
| Scenario | Recommended? |
|---|---|
| Personal use on trusted hardware | Standard Docker is sufficient |
| Shared server or multi-tenant environment | Yes — adds VM-level isolation |
| Running untrusted community skills | Yes — limits blast radius |
| CI/CD or automated testing | Yes — reproducible isolated environment |
Docker Sandboxes add latency to container operations due to the nested virtualization layer. For most workloads this is negligible, but latency-sensitive setups may prefer standard Docker.
Related pages
- Container runtime — Standard container execution details
- Security model — NanoClaw’s security boundaries
- Troubleshooting — General debugging guide