Skip to content

Run AI Coding Agents in Containers

Running AI coding agents in containers provides isolation, reproducibility, and team consistency. SCC makes this straightforward for both Claude Code and Codex.

Some teams standardize on one provider. Others allow both and choose the agent that fits the task. SCC keeps the runtime, safety, and governance model consistent either way.

BenefitWhat It Means
IsolationAgent execution separated from host system
ReproducibilitySame environment across all team members
Clean stateEach session starts fresh (or can resume)
Controlled accessOnly mounted directories are visible
Provider choiceRun Claude Code or Codex through the same governed pipeline
  • Python 3.10+
  • Container runtime — Docker Engine 20.10+, OrbStack, Colima, or Docker Desktop
  • Git 2.30+

SCC auto-detects the available runtime. Docker Desktop is not required.

Terminal window
# Install SCC CLI
uv tool install scc-cli
# Configure and connect providers (one-time)
scc setup
# Start an agent in a container
scc start ~/your-project
# Or specify a provider explicitly
scc start --provider codex ~/your-project

When you run scc start, SCC:

  1. Resolves provider — CLI flag first, resumed session provider when applicable, then saved preference and workspace context before prompting if multiple providers are still viable
  2. Checks readiness — verifies container image and auth (auto-builds image on first run)
  3. Creates a container from the provider-specific image (e.g., scc-agent-claude or scc-agent-codex)
  4. Mounts your workspace at a controlled path
  5. Applies team configuration — plugins, MCP servers, network policy, safety policy
  6. Starts the agent inside the container
  7. Manages the session — resume, stop, cleanup
┌─────────────────────────────────────┐
│ Your Machine │
│ │
│ ~/your-project │
│ │ │
│ ▼ (mounted read-write) │
│ ┌─────────────────────────────┐ │
│ │ Container Sandbox │ │
│ │ /workspace/your-project │ │
│ │ │ │
│ │ Agent (Claude/Codex) │ │
│ │ + Team plugins │ │
│ │ + Built-in safety engine │ │
│ │ + Network policy │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────┘

SCC owns provider-specific images built from bundled Dockerfiles:

ImagePurpose
scc-baseShared base with safety wrappers and evaluator
scc-agent-claudeClaude Code agent (extends scc-base)
scc-agent-codexCodex agent (extends scc-base)
scc-egress-proxySquid proxy sidecar for web-egress-enforced

First-run build: SCC auto-builds the image on first start (~2–3 min). Manual build:

Terminal window
docker build -t scc-agent-claude:latest images/scc-agent-claude/
docker build -t scc-agent-codex:latest images/scc-agent-codex/
Terminal window
scc sessions # List recent sessions
scc list # List running containers
scc start --resume # Resume most recent session
scc start --select # Pick from recent sessions
scc stop # Stop a sandbox (interactive picker)
scc stop --all # Stop all sandboxes
scc prune # Remove stopped containers

Network policies are configured at the org/team level:

{
"defaults": {
"network_policy": "web-egress-enforced"
}
}
PolicyEffect
openNo restriction — unrestricted egress
web-egress-enforcedTopology-enforced proxy sidecar (HTTP/HTTPS, IPv4)
locked-down-web--network=none — no external access

web-egress-enforced is the important middle ground for many teams: the agent still gets controlled web access, but it cannot bypass the proxy because the container itself is on an internal-only network.

Terminal window
scc doctor # Full health check
scc doctor --provider codex # Check specific provider
ProblemSolution
”Cannot connect to container runtime”Start Docker Engine, OrbStack, Colima, or Docker Desktop
”Provider image missing”SCC auto-builds on first start. Manual: docker build -t scc-agent-<provider>:latest images/scc-agent-<provider>/
Permission denied on Linuxsudo usermod -aG docker $USER then log out/in