Paul Redmond writes about BashBox, a pure PHP implementation of a bash interpreter created to safely execute shell scripts generated by AI agents without relying on native system calls. The package runs commands against a virtual filesystem with configurable execution limits and restricted network access, supporting standard bash features like pipes, redirections, and control flow alongside 58 built-in commands.
- Uses PHP classes to implement bash commands instead of invoking a shell binary.
- Supports multiple filesystem backends including in-memory, read-write, and overlay.
- Enforces 18 configurable execution limits such as command count and loop iterations.
- Disables network access by default, with optional domain-restricted curl support.
- Requires PHP 8.4 or later with no additional Composer dependencies.