SipengXie2024/dsh-auto-approval
SipengXie2024★ 0TypeScriptLast synced: 2026-08-15
LLM-gated auto approval for DeepSeek Harness: a model judges every approval ask first, low-risk operations pass without prompting (fail-closed)
README excerpt
dsh-auto-approval English : An LLM-gated auto-approval plugin for DeepSeek Harness (dsh). It adds an "auto" stance on top of dsh's four permission presets: every operation that would normally pop an approval prompt is first judged by your current default model — low-risk operations proceed without interrupting you, anything doubtful still asks. Fail-closed by design: judge errors, timeouts, and unparseable replies always fall back to the human. See 安装与使用 below (Chinese). 一个给 DeepSeek Harness(dsh)加「Auto 审批模式」的插件。 dsh 自带四种权限模式(Read-only / Workspace / Write / Full Access),但「要不要弹窗问用户」这件事只有 ask / never 两档。这个插件加了第五种姿态: 每次要弹窗的操作,先由你当前选用的模型判定风险——明确安全的直接放行,拿不准的照常问你 。思路与 Codex 的「替我审批」、Claude Code 的 auto 模式一致,但实现完全走 dsh 自己的审批管线。 工作原理 两个关键实现细节(都是踩坑换来的): - 必须 prepend : approval/request 瀑布里,dsh 内置的 web answerer(dsh-host-apiproxy)在启动时注册,认领请求时 不调 next() ——正常 append 的监听器永远轮不到执行。本插件以 ctx.on('approval/request', fn, true) 插到链首。 - 参数是旁路缓存的 : ApprovalRequest 只带 toolName / callId / reason ,不带工具参数。插件另挂 tools/pre-execute 观察者,按 callId 缓存每个调用的参数快照,判定时拼进 prompt。 审计不受影响: approval/asked + approval/decided 由 ApprovalService 自己记录,无论谁认领。 安全边界 - 不改变沙箱 :Read-only 模式下该被沙箱拦的操作照样被拦;Auto 只接管「本来要问你」的那一步。 - fail-closed :判…
View full README on GitHub →