DeepSeek Harness 插件

dsh-auto-approval-andy8647

Automated tool-call approval for DeepSeek Harness: an `auto` tier for approval policy that classifies each tool call as allow / deny before dispatch(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Andy8647/dsh-auto-approval
最近更新
2026年8月13日
分类
工具与能力
GitHub stars
4
载体类型
plugin
包路径
packages/dsh-auto-approval
目录证据
上游声明已找到 dsh.bundle
证据路径
packages/dsh-auto-approval/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/Andy8647/dsh-auto-approval/tree/HEAD/packages/dsh-auto-approval
插件名:dsh-auto-approval-andy8647
作者:Andy8647

检查来源文件

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

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

dsh-auto-approval

[English](../README.md) | [中文](../README.zh.md)

Automated tool-call approval for DeepSeek Harness: adds an auto tier to the approval policy — every tool call is classified as allow / deny (fully autonomous, no human in the loop, uncertain calls are denied) before dispatch. Think Claude Code automode / Codex "approve for me".

> This is the host half. For the real-time status chip in the composer (AA on / deny counts), install [dsh-client-ui-auto-approval](../dsh-client-ui-auto-approval) (the client half).

How it works

Hooked at the front of the tools/pre-execute waterfall (prepend: true), decision priority L0 deny > L1 classifier (two-state allow/deny):

LayerResponsibilityDefault
L0 rule enginedeny blacklist (incl. legacy askPatterns — now denying) + read-only tool whitelist, deterministic and free✅ on
L1 LLM classifiergray zone: feeds the user message + current tool call to a model for intent alignment (two stages: fast → deep)⚪ off

Fully-autonomous two-state decisions: decisions converge to allow/deny; no human in the loop. Uncertain calls (legacy askPatterns hits, L1 ASK verdicts, fail-closed, etc.) are all denied — the askPatterns field is kept for config compatibility, its semantics merged into deny.

Hard guarantees: L0 deny has double insurance (waterfall listener + ctx.tools.guard() monotonic guard), a self-kill guard (killall/pkill/taskkill/Stop-Process denied as a class, escape hatch kill <specific pid>), reasons never leak the matched rule, config fails loudly, and file tools (write/edit/str_replace_editor) are whitelisted — code review and the sandbox boundary own them, so AA focuses on bash / run_code.

Relationship with sandbox escalation: two approval layers coexist — the sandbox governs file-effect boundaries, this plugin governs call danger; calls carrying escalation arguments skip L1 (L0 deny is never exempted) to avoid double approval.

Install

Published to npm, ships built artifacts:

# Install into an existing working profile (⚠️ don't create a fresh one: the default
# base layer has no UI and will hang silently)
dsh plugin --profile web add dsh-auto-approval

# Restart dsh

Source install (development / self-hosting): clone the repo, then dsh plugin --profile web add link:/<path>/packages/dsh-auto-approval (dependencies come from npm; @deepseek-ai/* runtime deps are provided by dsh itself).

Configuration

Via $DSH_HOME/settings.yaml (default ~/.dsh/settings.yaml), hot-reloaded:

auto-approval:
  enabled: true
  denyPatterns:
    - 'rm\s+(-[a-z]*[fr][a-z]*\s+)*/\s*$'
    - 'curl\s+[^|]*\|\s*(ba)?sh'
  askPatterns:   # kept for config compatibility; hits now deny (fully autonomous)
    - 'sudo\s'
    - 'git\s+push\s+--force'
  autoApproveTools: [read, grep, find]
  # Enable L1 (omit to disable — L0 unmatched calls are then allowed)
  # classifierFastProvider: deepseek
  # classifierFastModel: deepseek-chat
  # classifierDeepProvider: deepseek   # defaults to fast
  # classifierDeepModel: deepseek-reasoner
KeyDefaultDescription
enabledtruemaster switch
denyPatternssee src/config.tsregexes, matched ⇒ deny (hard rule)
askPatternssee src/config.tsregexes, matched ⇒ deny (formerly ask; kept for config compatibility)
autoApproveToolsread-only tools + file-write tools (write/edit/str_replace_editor)tool-name whitelist, bypasses all checks. File writes have independent review (code review + sandbox boundary); the main audit target is bash / run_code
bashCommandPrefixesemptybash prefix whitelist (ls/cat both go through the bash tool, which the tool-name whitelist can't exempt — this is the only L1 bypass for read-only shell commands)
selfKillGuardtrueself-kill guard, see above
auditSessionEventsfalsewhether to write session events. Keep off: since 08-12 final, sessions fail-closed on undeclared event types — enabling this makes sessions unopenable after restart
classifierFastProvider / classifierFastModelunsetL1 fast model route (must be paired; setting enables L1)
classifierDeepProvider / classifierDeepModelunsetL1 deep model route (paired; defaults to fast)
classifierTimeoutMs20000per-call L1 timeout, fail-closed ⇒ deny
classifierGuidanceunsetcustom judgment guidance (advisory, not hard rules)

Audit

Every decision is appended to $DSH_HOME/logs/auto-approval.log (JSON lines; first line is the armed config summary):

tail -f ~/.dsh/logs/auto-approval.log

Verification

1. After restart, the first line of ~/.dsh/logs/auto-approval.log should be auto-approval/armed 2. Ask the model to run echo danger_test (with a matching deny rule configured) — it should be rejected, and the log shows L0-deny

Known limitations

  • No Web UI settings section: the host api-proxy exposedNamespaces() is a hard-coded allowlist; third-party settings namespaces aren't exposed by default. Configure via settings.yaml (hot-reloaded). Filed with the community issue tracker (#485, merged into #349).
  • settings.yaml sections replace wholesale (arrays don't merge) — override a key and you must list the full array.

Development

# repo root (monorepo: host + client packages)
pnpm install          # export NPM_TOKEN=$(cat ~/.dsh/npm-token) if needed
pnpm run typecheck    # tsc strict
pnpm run test         # vitest
pnpm run build        # tsc → tsdown

Dependencies install from npm (rc.5 series; @deepseek-ai/* runtime deps are provided by dsh).

License

BSD-3-Clause