DeepSeek Harness 插件

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.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Xpectuer/dsh-llm-approver
最近更新
2026年8月19日
分类
安全与权限
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/Xpectuer/dsh-llm-approver
插件名:dsh-llm-approver
作者:Xpectuer

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-llm-approver

LLM pre-review for sandbox-escalation approvals in the DeepSeek Harness web GUI.

When the session sits in the workspace-write-llm permission preset, a sandbox escalation retry (sandbox_permissions on bash/pwsh/fs tools) is first judged by an independent-context LLM call — the request contains only the pending command and its justification, never the conversation history:

  • ALLOW → the call runs immediately (allowed-once); the user is never prompted.
  • DENY, timeout, error, unparsable output, tool-call output, abort → the

request falls through to the existing web UI approval prompt unchanged.

The gate is fail-closed: it can only grant, never reject, and every failure mode degrades to the user. Sessions in any other preset pass through synchronously with zero behavior change.

Installation

Requires dsh with a profile (~/.dsh/profiles/web for the web GUI) and pnpm available.

Quick (scripts)

# from a clone of this repo:
./scripts/install.sh                 # install into the web profile (from GitHub)
./scripts/install.sh --profile tui   # install into another profile
./scripts/install.sh --source file:/path/to/dsh-llm-approver  # local source

./scripts/uninstall.sh               # remove from the web profile
./scripts/uninstall.sh --profile tui # remove from another profile

Each script edits the profile's package.json (bundle + dependency, keeping both lists intact), runs pnpm install, verifies the composed tree, and prints the restart reminder. Both are idempotent.

Manual

Edit ~/.dsh/profiles/web/package.json:

{
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "@dsh-external/dsh-llm-approver"
      ]
    }
  },
  "dependencies": {
    "@dsh-external/dsh-llm-approver": "github:Xpectuer/dsh-llm-approver"
  }
}

For local development instead of GitHub, use a file reference: "@dsh-external/dsh-llm-approver": "file:/path/to/dsh-llm-approver".

2. Install and verify

cd ~/.dsh/profiles/web
pnpm install
dsh web --dump-config | grep -A2 llm-approver   # row must appear
# the preset table must contain workspace-write-llm:
dsh web --dump-config | grep workspace-write-llm

3. Restart dsh web (the web profile has no HMR; a restart is the only way to load a new bundle). A second instance for testing can be started without touching the running one: dsh web --port 3081.

> Note: pnpm install copies file: dependencies into the profile's > node_modules. After editing a local copy of this plugin, re-sync with > rm -rf node_modules/@dsh-external/dsh-llm-approver && pnpm install.

Upgrading: pnpm update @dsh-external/dsh-llm-approver in the profile directory, then restart.

Uninstalling: remove the bundle entry and the dependency from package.json, run pnpm install, restart. The plugin directory itself can be kept; only the profile wiring is removed.

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.

Other profiles

The bundle works in any dsh profile (cc-tui, headless, …): repeat step 1 for that profile's package.json and restart. The plugin itself is host-side only and needs no client/browser code.

Decision criteria

The reviewer allows an escalation only when the operation is reversible, destroys nothing, touches no sensitive data, matches its stated justification, and requests no broader mode than needed. Anything else is denied or deferred.

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.

Tests

Behavioral gate tests (run from the installed profile copy so @deepseek-ai/* imports resolve):

mkdir -p ~/.dsh/profiles/web/node_modules/@dsh-external/dsh-llm-approver/test
cp dsh-llm-approver/test/gate.test.mjs ~/.dsh/profiles/web/node_modules/@dsh-external/dsh-llm-approver/test/
node ~/.dsh/profiles/web/node_modules/@dsh-external/dsh-llm-approver/test/gate.test.mjs

Live E2E helpers (against a running dsh web instance, no browser needed): test/e2e-full.mjs <port> and test/probe-run-3082.mjs.

Failure semantics

SituationBehavior
Session not in the preset / drifted to customPass-through, unchanged behavior
LLM timeout / error / no ALLOW / tool-call outputUser approval prompt
User interrupts during reviewDefer to user; service resolves cancelled
Missing callId or no matching tool/call eventUser approval prompt
approval/policy = neverRejected by the service before this gate runs
Plugin row fails to loadThe permission preset row is independent and still applies

Audit: approval/asked / approval/decided are recorded by the approval service exactly as before; LLM verdicts go to the host log (llm-approver), never to the session event vocabulary.