dshbase

插件目录 / Developer / dsh-llm-approver

dsh-llm-approver

已验证 · 实测可装 Xpectuer

✓ 持续维护 基于 4 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-19最近推送
跨平台平台

功能简介

Developer 类别的 DeepSeek Harness 插件。

✅
我们的评价
可用 — 实测通过,早期项目

Developer 类别的 DeepSeek Harness 插件。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

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):

Key Default Meaning
preset workspace-write-llm Permission preset the gate activates under
provider / model — Review route override; default follows the session's current model route
timeoutMs 60000 Review deadline; on expiry the user is asked
maxTokens 256 Review completion budget
maxInstructionChars 16384 Truncation for the reviewed tool arguments
includeUserInstruction true Attach 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

Situation Behavior
Session not in the preset / drifted to custom Pass-through, unchanged behavior
LLM timeout / error / no ALLOW / tool-call output User approval prompt
User interrupts during review Defer to user; service resolves cancelled
Missing callId or no matching tool/call event User approval prompt
approval/policy = never Rejected by the service before this gate runs
Plugin row fails to load The 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.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-llm-approver」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Xpectuer/dsh-llm-approver

Headless(CLI)profile:

dsh plugin --profile headless add github:Xpectuer/dsh-llm-approver

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7819 个插件 →