Running AI agents in GitHub Actions with Docker Sandboxes
GitHub Agentic Workflows (gh-aw 0.82.9) supports Docker Sandboxes (sbx) as an agent runtime, so a CI coding agent gets root, sudo and unrestricted shell inside a disposable microVM with its own kernel and private Docker daemon. Outside that VM it is limited by a network allowlist, a read-only token and a safe-output job that may only touch src/**. In the worked example, a Copilot agent on an ubuntu-24.04 runner runs a Java 21 Testcontainers/PostgreSQL suite, adds a regression test exposing a case-sensitive email uniqueness bug, applies a one-line normalization fix, and opens a draft PR. The run took about 11 minutes, and setup needs Docker credentials as secrets plus a KVM-capable host for self-hosted runners.
Related posts
- The Untrusted Autonomous Workload: How AI Coding Agents Reshape What Isolation Has to Do
Docker mediumAdeptAI coding agents are untrusted, autonomous workloads that containers were never designed to isolate, so Docker Sandboxes runs each agent in a microVM (custom VMM on Hypervisor.framework, WHP or KVM) with its own kernel and private Docker Engine. Outbound traffic goes through a TLS-intercepting host proxy that enforces domain policies and injects credentials from the host keychain, so secrets never enter the VM. Two limits remain: domain-level allowlists still permit exfiltration via sites like github.com, and the shared workspace lets an agent plant Git hooks, package.json scripts or CI configs that later run on the host. A real Astro build showed no measurable microVM overhead, though a jemalloc dependency failed on 16K-page Apple Silicon VMs. Agent output should be reviewed like an untrusted pull request, for example by diffing .git/hooks and using --branch worktrees.
- 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.
- 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.
- Highlights from AWS re:Invent: Supercharging Kiro with Docker Sandboxes and MCP Catalog
Docker mediumAdeptDocker Sandboxes run coding agents like AWS's Kiro inside isolated containers that see only the project directory and none of the host's credentials, while the Docker MCP Toolkit supplies tools through a gateway that injects secrets only into the specific MCP server that needs them. The walkthrough uses `docker sandbox run --mount-docker-socket kiro` (the socket lets Testcontainers integration tests run), points Kiro at the MCP Gateway via a project-level `.kiro/settings/mcp.json`, and uses an AGENTS.md file to have the agent add the GitHub MCP server on demand and remove it afterward to shrink context and cost. The result is a least-privilege, per-container setup. Planned additions include hostname-based network egress limits against prompt-injection exfiltration and organizational governance of allowed MCP servers. Sandboxes are an experimental feature in Docker Desktop 4.50+.
- A Virtual Agent team at Docker: How the Coding Agent Sandboxes team uses a fleet of agents to ship faster
Docker mediumAdeptDocker's Coding Agent Sandboxes (sbx) team runs a "Fleet" of seven autonomous Claude Code skill-based agent roles: build engineer, project manager, product owner, CLI tester, performance tester, upgrade tester and software engineer. These roles test across macOS, Linux and Windows, triage and deduplicate issues, post daily release notes, and open bug-fix and tech-debt PRs from CI. Skills are written as personas rather than scripts, and they compose by loading foundational skills. Each one is developed and debugged locally before the same file is wired into GitHub workflows. Fixes run through a "Ralph-loop" that pairs separate worker and reviewer Claude invocations, iterating up to five times on SHIP/REVISE. Humans keep the merge decision.