Run OpenClaw Securely in Docker Sandboxes
OpenClaw, an open-source AI coding agent, can run inside Docker Sandboxes (isolated microVMs) against local models served by Docker Model Runner, with no API keys or cloud costs. The sandbox restricts file access to the workspace, and its network proxy can deny arbitrary hosts and inject cloud API keys so the agent never sees them. Because Node.js ignores HTTP_PROXY, a ~20-line Node bridge on localhost:54321 forwards requests through the sandbox proxy (host.docker.internal:3128) to Model Runner on the host's localhost:12434. Full steps cover installing OpenClaw, writing the bridge, merging a Model Runner provider into OpenClaw's config, and saving the sandbox as a shareable image.
Related posts
- Running NanoClaw in a Docker Shell Sandbox
Docker mediumAdeptDocker Sandboxes' new `shell` sandbox type provides a minimal Ubuntu microVM with Node.js, Python and git, letting you run agents that aren't built in, such as NanoClaw, a Claude-powered WhatsApp assistant. The workspace mount is the only host directory visible, and API keys stay outside the sandbox: Claude Code's `apiKeyHelper` returns a sentinel value that Docker's network proxy swaps for the real Anthropic key on outgoing requests. The walkthrough covers creating and connecting to the sandbox, installing Claude Code, cloning NanoClaw, running its `/setup` flow and managing sandbox lifecycle. The same create, install, configure-proxy-credentials, run pattern applies to any Linux-based AI agent or bot.
- Give sandboxed agents live web access with the Firecrawl kit for Docker Sandboxes
Docker mediumAdeptThe Firecrawl kit is a mixin for Docker Sandboxes that gives isolated coding agents web search, scraping and crawling through a single allowlisted host, api.firecrawl.dev, returning pages as markdown. It declares four typed capabilities: a pinned firecrawl-py install step, a proxy-managed credential so the API key never enters the sandbox, phase-split network permissions, and agent context instructions. The walkthrough covers storing the secret with sbx, running a shell workload with the Claude Code and Firecrawl mixins, and verifying the SDK, placeholder key and network rule. Limitations include media links on an unallowed storage host, organization policies overriding the allow rule, and 402 errors when credits run out.
- Your Agent Runs in a Docker Sandbox. Now It Can Join a Team.
Docker mediumAdeptThe BAND AI kit for Docker Sandboxes (docker.io/bandhq/band-python-kit) lets an agent running in an isolated Docker Sandbox microVM join BAND rooms, where it collaborates with humans and with other agents via @mentions, persistent identities and shared message history. All connectivity is outbound: the agent opens a WebSocket to BAND and posts replies through its API. Secrets stay on the host and are injected into outbound requests, so the agent only sees placeholders. A Repo Doctor example walks through the setup: scoped secrets with `sbx secret set-custom`, creating the sandbox from the kit, allowing api.anthropic.com via network policy, then running a Claude-based agent that fixes failing tests in a mounted repo.
- Why AI Agents Need Isolation
Docker easyNoviceAI coding agents that run commands, install packages and handle credentials should execute behind an isolation boundary rather than directly on the developer's host. Docker Sandboxes (sbx) runs agents in microVMs instead of plain containers, because containers share the host kernel. Docker built its own VMM rather than using Firecracker so the same model works on macOS and Windows as well as Linux. Credentials stay on the host: the agent sees a sentinel placeholder, and a proxy swaps in the real auth header on outbound requests. Sandbox Kits package tools, network rules, credentials, files, startup commands and agent memory (e.g. AGENTS.md) into reusable specs, either as stackable Mixin Kits that extend an existing agent or as Agent Kits that define a full agent environment from scratch.
- Building AI Teams: How Docker Sandboxes and Docker Agent Transform Development
Docker mediumAdeptDocker Agent defines teams of specialized AI agents in YAML, where a root "product manager" agent delegates to designer, engineer, QA and fixer sub-agents, each with its own model, instructions and toolsets (filesystem, shell, think, todo, memory, MCP). Docker Sandboxes runs these agents inside dedicated microVMs (Docker Desktop 4.60+), mounting the project at the same absolute path, withholding host environment variables, and enforcing network allow/deny lists so agents can install packages and run commands without touching the host. A step-by-step walkthrough builds a Gradio bank app with a four-agent team. Limitations: everything is experimental, microVM sandboxes require macOS or Windows, and only one sandbox is allowed per workspace.