Kernel-level jail for unattended subprocesses — no Docker, no container runtime, zero extra deps.
为无人值守子进程提供内核级 jail——不依赖 Docker,零额外依赖。
Supported platforms: macOS Seatbelt and Linux Landlock. Unsupported platforms (Windows, BSD) silently degrade to worktree-level logical isolation.
当前支持 macOS Seatbelt 和 Linux Landlock。不支持的平台静默降级为 worktree 逻辑隔离。
| Operation | 操作 | macOS (Seatbelt) | Linux (Landlock) |
|---|---|---|---|
| File read | 文件读 | ✅ Allow all | ✅ Allow all |
| File write | 文件写 | ✅ Whitelist dirs only | ✅ Whitelist dirs only |
| Network | 网络 | ✅ Default blocked, can allow | ❌ Landlock doesn't manage net |
| exec | 执行 | ✅ Allowed (sandbox-exec restricted) | ✅ Allowed |
| Kernel requirement | 内核要求 | Built-in (needs sandbox-exec) | Linux ≥ 5.13 (Landlock ABI ≥ 1) |
sandbox-exec (marked deprecated but fully functional, zero cgo)AllowNetworkno_new_privs (trampoline sets it automatically)The sandbox is auto-detected and integrated into autopilot sub-agents:
沙箱默认集成在 autopilot 子代理中,自动检测可用性:
// Auto-detected in autopilot mode if sandbox.Available() { bt = bt.WithSandbox(sandbox.Options{ WritableDirs: []string{worktreePath}, }) }
When unavailable, subprocesses run without kernel confinement but still within worktree isolation.
不可用时,子进程运行在 worktree 隔离中,没有内核约束。