This directory contains a runnable example implementation of the Security Sandbox pattern: running AI tools in an isolated container with no network access and no access to host credentials.
The Security Sandbox example provides:
- Complete network isolation (
network_mode: none) - Non-root execution (UID 1000)
- Read-only source mounts
- Separate writable output and log mounts
Dockerfile.ai-sandbox- Minimal container image for secure AI-assisted developmentdocker-compose.basic.yml- Smallest, single-container sandboxdocker-compose.ai-sandbox.yml- Script-friendly sandbox configurationdocker-compose.parallel-agents.yml- Example multi-agent sandbox with isolated outputsai-sandbox.sh- Convenience script to build/start/validate the sandboxinit-workspace.sh- Container init script (creates runtime dirs and prints safety status)healthcheck.py- Basic sandbox health checkrequirements-sandbox.txt- Base Python dependencies installed in the imageresource-locking.sh- Example resource locking helper for parallel agentsemergency-shutdown.sh- Emergency shutdown helper
From the repository root:
./examples/security-sandbox/ai-sandbox.sh start
./examples/security-sandbox/ai-sandbox.sh shellOr run the minimal Compose file directly:
cd examples/security-sandbox
docker compose -f docker-compose.basic.yml up -d
docker compose exec ai-development bashsrc/is a small placeholder directory you can replace with your own code mount.generated/andlogs/are created at runtime and are intentionally not committed.