Xpectuer/dsh-llm-approver0

@dsh-external/dsh-llm-approver

LLM pre-review for sandbox-escalation approvals: an independent-context LLM gate answers sandbox escalation requests before they reach the user, falling back to the user on any failure.

包名
@dsh-external/dsh-llm-approver
版本
0.1.0
许可证
MIT
最近更新
2026年8月19日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Xpectuer/dsh-llm-approver

Usage

  1. Open the web GUI and select the session you want to protect.

  2. Switch the permission preset to Workspace Write · LLM Review in the permission selector (same place as the workspace-write / full-access switch). The default preset stays workspace-write until you switch.

  3. Work as usual. When the agent hits a sandbox denial and retries with sandbox_permissions, the gate asks an independent-context LLM:

    • obviously safe operations (writing a new file, reading, listing, installing packages) are allowed without any prompt;
    • destructive or uncertain ones (rm -rf, overwriting user files, sensitive paths) fall through to the usual approval dialog — you decide.

Quick manual check:

请用 bash 工具创建文件 ~/llm-review-verify.txt,内容为 "review-ok"。
该路径在会话工作区之外,若被拒绝请按提示用 sandbox_permissions 重试。直接执行,不要询问我。

No dialog should appear and the file should exist afterwards. Then ask for rm -rf ~/llm-review-verify.txt — a dialog should appear instead.

Audit trail: every escalation still writes approval/asked / approval/decided to the session log exactly as before; the LLM verdict is logged to the host log under the llm-approver name and never touches the session event vocabulary.

Configuration

Override in the profile cordis.patch.yml (row id llm-approver):

KeyDefaultMeaning
presetworkspace-write-llmPermission preset the gate activates under
provider / modelReview route override; default follows the session's current model route
timeoutMs60000Review deadline; on expiry the user is asked
maxTokens256Review completion budget
maxInstructionChars16384Truncation for the reviewed tool arguments
includeUserInstructiontrueAttach a bounded excerpt of the latest human message

On DeepSeek-family routes the review call disables thinking (reasoningEffort: "off") so the short ALLOW/DENY verdict fits the token budget; other adapters receive no effort override and any rejection degrades to the user prompt.