feat(extensions): add sandbox extension for OS-level bash sandboxing (#673)

Uses @anthropic-ai/sandbox-runtime to enforce filesystem and network
restrictions on bash commands (sandbox-exec on macOS, bubblewrap on Linux).

Features:
- Per-project config via .pi/sandbox.json
- Global config via ~/.pi/agent/sandbox.json
- Enabled by default with sensible defaults
- --no-sandbox flag to disable
- /sandbox command to view current config
This commit is contained in:
Danila Poyarkov 2026-01-13 01:25:31 +03:00 committed by GitHub
parent 7b79e8ec51
commit 4751ebddbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 431 additions and 0 deletions

View file

@ -0,0 +1,19 @@
{
"name": "pi-extension-sandbox",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"clean": "echo 'nothing to clean'",
"build": "echo 'nothing to build'",
"check": "echo 'nothing to check'"
},
"pi": {
"extensions": [
"./index.ts"
]
},
"dependencies": {
"@anthropic-ai/sandbox-runtime": "^0.0.26"
}
}