Harness Sandboxing with Containers
8 hours ago
- Containers provide effective isolation for bot harnesses like Pi or Claude Code, preventing them from accessing or modifying unintended files.
- A container-based approach balances security, ease of use, and resource efficiency compared to full VMs or soft permission controls.
- Setting up a bot jail involves defining a minimal container image, adding the harness and tools, mapping volumes and credentials, and making sandboxing the default.
- The example uses rootless Docker with a Node.js image, installing base tools and the Pi harness, plus optional tools like Allium CLI.
- A script initializes the sandbox with environment variables (e.g., CORTECS_KEY), mounts volumes (e.g., current directory, dotnet tools), and isolates the bot on a separate network for safe access to resources like a database.
- The sandboxed bot runs transparently from the editor, with limited permissions but still allowed to install tools cautiously.