shine-sandbox
Execute code safely in an isolated Docker container. Prevents untrusted code from running directly on the host.
<objective>
Safely execute code in isolation:
-
Risk assessment:
- 🟢 Safe (direct OK): read-only ops, linting, type-checking.
- 🟡 Moderate (sandbox recommended): package installs, API calls, file I/O.
- 🔴 High (sandbox REQUIRED): untrusted code, global installs, network access, unknown scripts.
-
Sandbox selection (Rule #21):
- Tier 1:
dockerMCP →microsandbox→ Docker CLI via Bash. - Tier 2:
e2b(ASK first — "This uses E2B cloud sandbox (freemium). Proceed?"). - No sandbox: REFUSE for 🔴 code. Explain why + give Docker install command.
- Tier 1:
-
Execution:
- Select container image for language (python:3.12, node:22, golang:1.22, etc.).
- Mount code read-only unless writes required.
- Resource limits: 2 CPU, 1 GB RAM, 5-min timeout.
- Capture stdout, stderr, exit code, duration.
-
Cleanup: Remove container + temporary files.
Delegate to shine-sandbox-runner agent for complex multi-step executions.
</objective>