---
name: "agent-sandbox-docker-isolation"
description: "Isolate code generation and execution agents inside secure, ephemeral Docker containers."
metadata:
  author: "Docker"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "run agent code in docker sandbox"
  - "isolate untrusted code execution"
  - "configure secure container sandbox"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Docker Ephemeral Sandboxes for Untrusted Code Execution

Deploys hardened Docker sandbox environments: read-only root filesystems, dropped capabilities, no-network flags (--network none), memory/CPU resource caps, and auto-cleanup (--rm).

## When to Invoke
Invoke this skill whenever you need to:
- run agent code in docker sandbox
- isolate untrusted code execution
- configure secure container sandbox

## Execution SOP & Rules
1. Run containers with --rm --network none --cap-drop ALL --read-only flags.
2. Mount temporary writable directories using --tmpfs /tmp:rw,noexec,nosuid,size=64m.
3. Enforce hard execution timeouts with timeout 30s to terminate runaway scripts.
4. Never pass host environment variables containing secrets into untrusted execution containers.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
