This is a fork of toybox that serves as the foundation for jailing LLM agents (starting with opencode, later others) in isolated chroot environments on a Lima VM. The primary purpose is to provide secure execution contexts for AI agents while maintaining security updates from upstream toybox.
- Jail LLM Agents: Run code-generation and tool-use agents (like opencode) safely in isolated chroot jails
- Filesystem Isolation: Agents cannot access the host filesystem or affect other agents' environments
- Concurrent Execution: Multiple agents can run simultaneously in separate jails
- Security: Track and apply upstream
toyboxsecurity updates while adding agent-specific tooling
The project is designed to be self-contained within the agt_agent_sandbox/ directory to avoid conflicts with upstream toybox development.
We use mise for tool management and just as a command runner.
If you have direnv and mise installed, simply:
direnv allowmise trustmise install
If you don't use direnv, you can still use the tools via mise:
- Install mise
- Run commands using
mise exec:Or addmise exec -- just lima-up~/.local/share/mise/installs/just/latest/binto your PATH after runningmise install.
All lifecycle commands are managed via just:
just lima-up: Create and start the Lima VM.just lima-shell: Open a shell in the VM.just lima-clone <new_name>: Clone the current sandbox VM to a new instance.just lima-stop: Stop the VM.just lima-delete: Delete the VM.
Since this project uses the vz driver on macOS, traditional limactl snapshot commands are currently unimplemented. To preserve a clean state:
- Use
just lima-clone clean-backupto create a "gold image". - Or use
limactl factory-reset agt_agent_sandboxto return to the initial provisioned state.
The system includes automated and manual testing procedures to verify agent jailing works correctly:
- Automated: Run
just lima-verify-runfor a complete verification (deploys jails + runs concurrency test) - Manual: See
tests/exploratory/manual_jail_test.mdfor step-by-step procedures to:- Verify binaries are installed in the Lima VM
- Test chroot jail isolation
- Confirm concurrent execution of multiple agents
- Check filesystem isolation between jails