Feature/seatbelt provider - #327
Conversation
- 新增 SeatbeltExecutionResourceProvider (kind='seatbelt') - SBPL profile 生成器,支持网络/路径读写隔离 - is_macos() + inspect_seatbelt_availability() 平台检测 - ActionResourceRegistrar._normalize_code_sandbox 支持 'seatbelt' - 新增 register_seatbelt_sandbox_action() 注册入口 - __init__.py 注册 Seatbelt provider
SBPL Profile 设计改进: - 基础能力: process-exec*, process-fork, signal, mach(*), ipc-posix* - 文件读取: 全局允许 (allow file-read*) — AI agent 需要读系统库 - 文件写入: 白名单模式 (writable_paths + temp dirs) - 受保护路径: protected_paths 禁止写入 (last-match-wins, 覆盖 allow) - 禁止读取: deny_read_paths 同时禁止读写 (保护 secrets) - 设备文件: /dev/null, /dev/ptmx, pseudo-tty - 网络: network-outbound 开关 - realpath 防符号链接绕过 接口变更: - 移除 read_paths (全局可读) - 新增 writable_paths (白名单可写) - 新增 protected_paths (禁止写入, 覆盖 writable_paths) - 新增 deny_read_paths (禁止读写)
- 移除不存在的 ExecutionResourceProvider 基类继承,改为 duck-typing - 将 create_handle 重写为 async_ensure/async_health_check/async_release - 清理文件拼接残留(659→394行) - TYPE_CHECKING 导入替代运行时导入
- BUG-1: sandbox-exec -f - 不支持 stdin,改用临时文件 + -f - BUG-2: SBPL 语法 (allow mach(*)) 无效,改为 (allow mach*) - BUG-3: SBPL 语法 (deny network) 无效,改为 (deny network-outbound) 修复后沙箱可正常执行,6 项可配置限制全部验证通过。 添加 .gitignore 规则忽略本地 TDD 验证资产。
- 恢复 .gitignore 到 main 分支状态 - 添加 tests/test_seatbelt_bugs.py (11 项 TDD 测试)
Status updateAgently 4.1.4.2 has been released, and the current package is 4.1.4.3. The 4.1.4.3 change is an unrelated Pydantic structured-output patch; the code-execution provider contract introduced on the 4.1.4.2 line is ready for this contribution. Please rebase or retarget this PR onto the current
Migration reference: Code Execution Provider Migration. 状态更新Agently 4.1.4.2 已经发布,当前 package 是 4.1.4.3。4.1.4.3 只是无关的 Pydantic 结构化输出补丁;4.1.4.2 发布线提供的 code-execution provider 契约已经可以承接本 PR。 请把本 PR rebase 或 retarget 到当前
|
|
Superseded by the newer Seatbelt contribution #333 and the accepted maintainer integration #351. #351 is now merged to |
--
PR 2:
feature/seatbelt-provider验证结果
_normalize_code_sandbox('seatbelt')register_seatbelt_sandbox_action方法存在name/kind属性create_handle在 Linux 返回 unavailablePR 说明(含待修复问题)