Container sandbox
Skill scoobydont-666/shared-claude-skills/skills/container-sandbox
Run risky or destructive operations inside ephemeral Docker containers for isolation. Use when executing untrusted scripts, destructive Ansible playbooks, or operations that could damage the host.From its SKILL.md
npx -y skills add scoobydont-666/shared-claude-skills --skill container-sandboxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
3 things to look at
- reads credentialsReads from 1 credential source: `~/.ssh`.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 7 commands, including `docker run --rm -it -v "$(pwd):/project:ro" -v /tmp/sandbox-work:/work -w /work ubuntu:24.04 bash -c "cp -r /project/* /work/ && bash"` and 6 more.
SKILL.md
2.8 KB, 689 tokens by cl100k_base, as published. Nobody here has run it
Container Sandbox — Isolated Execution Environment
Run potentially dangerous operations inside ephemeral Docker containers. The host filesystem is protected — containers get read-only project mounts with a writable overlay.
When to Use
- Destructive Ansible playbooks (
--force,--limittesting) - Untrusted scripts from external sources
- Operations that modify system state (
rm -rf, package installs) - Testing migrations or schema changes before applying to production
- Running code from unknown repos
Quick Start
Basic sandbox (Ubuntu + project files):
docker run --rm -it \
-v "$(pwd):/project:ro" \
-v /tmp/sandbox-work:/work \
-w /work \
ubuntu:24.04 \
bash -c "cp -r /project/* /work/ && bash"
Python sandbox (with project deps):
docker run --rm -it \
-v "$(pwd):/project:ro" \
-v /tmp/sandbox-work:/work \
-w /work \
python:3.12-slim \
bash -c "cp -r /project/* /work/ && pip install -r requirements.txt 2>/dev/null; bash"
GPU sandbox (for CUDA operations):
docker run --rm -it --gpus all \
-v "$(pwd):/project:ro" \
-v /tmp/sandbox-work:/work \
-w /work \
nvidia/cuda:13.1-devel-ubuntu24.04 \
bash
Ansible dry-run sandbox:
docker run --rm -it \
-v /opt/ai-project:/project:ro \
-v ~/.ssh:/root/.ssh:ro \
-w /work \
--network host \
willhallonline/ansible:latest \
bash -c "cp -r /project/* /work/ && ansible-playbook -i inventory playbook.yml --check --diff"
Extracting Results
After running operations in the sandbox:
# Copy results out of the sandbox work directory
docker cp <container_id>:/work/results/ ./sandbox-results/
# Or use the /tmp/sandbox-work mount (persists after --rm if pre-created)
ls /tmp/sandbox-work/
Safety Rules
- Always mount project directories as
:ro(read-only) - Use
/tmp/sandbox-workor/workfor writable operations - Use
--rmto auto-cleanup containers after exit - Use
--network nonefor maximum isolation (no internet access) - Never mount
/or/homeas writable into a sandbox - GPU sandboxes (
--gpus all) still share the host GPU — use for testing, not isolation
Integration with Claude Code
When Claude needs to run something risky, instruct it to:
- Build the Docker command with appropriate mounts
- Execute the command via Bash tool
- Capture stdout/stderr from the container
- Extract any produced files from the work directory
- Clean up:
rm -rf /tmp/sandbox-work
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.