GitHub Copilot Inside a Docker Sandbox
Run GitHub Copilot CLI over ACP with sandbox-local Band tools
This is an experimental source example, not a published kit. It lives in examples/acp/copilot_sandbox/ in the Band Python SDK repository and uses Docker kit schema version 1.
This topology isolates GitHub Copilot in a Docker Sandbox. A Band SDK process remains on the host, receives room messages over WebSocket, and drives Copilot over ACP stdio. Inside the sandbox, Copilot calls a loopback band-mcp server for Band platform tools.
This example is specific to GitHub Copilot CLI. It is not a generic kit for arbitrary ACP agents. The same host-to-sandbox ACP pattern can be adapted to another ACP-compatible CLI, but its sandbox base, authentication, launch command, and MCP configuration must be replaced.
Architecture
Two paths use the same Band identity:
client.pyloadscopilot_acp_agentfrom the host’sagent_config.yamland handles live room traffic.band-mcpuses the same agent API key through Docker’s proxy when Copilot calls Band tools.
If the identities differ, room-scoped MCP calls can return 404.
Prerequisites
- macOS with Docker Desktop and Docker Sandboxes (
sbx) - Python 3.11 or later and
uv git,gh, and a Copilot-entitled GitHub account- A Band remote agent ID and agent API key
Create the Band agent by following Connect Any Agent.
Set Up the Copilot Sandbox
Clone the SDK example
Run the remaining host commands from the repository root so client.py can find agent_config.yaml.
Configure the host-side Band agent
Add the agent credentials under the exact key used by client.py:
Keep agent_config.yaml out of source control.
Install and configure Docker Sandboxes
The balanced policy is a base policy that permits common development and model endpoints. The MCP mixin adds Band and PyPI hosts to that effective policy.
Store host-side credentials
Store the Copilot token with Docker, then store the same Band agent API key used in agent_config.yaml:
The real Band key remains in Docker’s host-side secret store. The sandbox receives only the proxy-managed sentinel.
Validate the mixin and create the sandbox
Choose the workspace Copilot may access. The same absolute path is mounted inside the sandbox.
Why Tool Injection Is Disabled
The adapter uses this current configuration:
inject_band_tools=False is required for this topology. The adapter’s in-process MCP server is on the host loopback, which the sandbox cannot reach. The mixin replaces it with a server on the sandbox loopback.
Network and Security Boundaries
The mixin adds app.band.ai, pypi.org, and files.pythonhosted.org to the sandbox policy. These are additions to the effective policy, not guarantees that no other hosts are reachable. The balanced base policy and organization governance can change effective access.
band-mcp has no client authentication in this example. Keep it bound to 127.0.0.1, as the mixin does. Do not bind it to a routable interface without adding authentication and network controls.