Skip to content

feat: migrate shell safety to plugin api v3 - #2

Merged
kachofugetsu09 merged 3 commits into
mainfrom
codex/plugin-v3-composition
Aug 21, 2026
Merged

feat: migrate shell safety to plugin api v3#2
kachofugetsu09 merged 3 commits into
mainfrom
codex/plugin-v3-composition

Conversation

@kachofugetsu09

@kachofugetsu09 kachofugetsu09 commented Aug 15, 2026

Copy link
Copy Markdown
Member

结果

  • 从 v2 on_tool_pre/HookOutcome deny 迁移到 v3 tool.execution.authorize/Bail[str]。
  • 保留 sudo、交互编辑器、包管理器和系统编辑器的判断与拒绝文案。
  • 完整扫描 sudo option stream,不再因先见 -n 就跳过后续 mode flag;sudo -n -s rm 与 -n -i rm 会在 invoker 前拒绝。
  • 正确区分 -unroot 与 -nuroot,并允许普通 command mode 的 -nE 与 --preserve-env=HOME。
  • 只负责最终参数授权,不拥有 Tool 执行;非 shell 工具通过。移除 PluginContext 与 legacy ToolHook 依赖。

依赖

验证

  • 16 passed;v3 contract passed;Basedpyright 0 errors / 0 warnings。
  • 真实 PluginManager stable snapshot lease → ToolExecutor 证明 deny reason 保持且 invoker 零调用。
  • 非 shell 调用继续进入 invoker;terminate_all 后正式 Root listener/effect 清空。
  • PR #432 证明 Safety 读取 Restore 改写后的最终 ToolInput,并封住 sudo mode raw-rm bypass。
  • Terra xhigh 独立只读复审最终无 P0/P1。

边界

不写正式 workspace/plugin-data,不执行真实 shell,不调用渠道或外部 API。回滚点:backup/plugin-v3-before-20260815。

@kachofugetsu09
kachofugetsu09 merged commit a3a1ed8 into main Aug 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant