EN 中文

Supported platforms: macOS Seatbelt and Linux Landlock. Unsupported platforms (Windows, BSD) silently degrade to worktree-level logical isolation.

当前支持 macOS Seatbelt 和 Linux Landlock。不支持的平台静默降级为 worktree 逻辑隔离。

What It Confines

它能做什么

OperationmacOS (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)

macOS Seatbelt

macOS

Linux Landlock

Linux

How to Enable

如何启用

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 隔离中,没有内核约束。

Design Docs

设计文档

PRD feature-sandbox.md

PRD feature-sandbox.md