DeepSHPlugins
dsh-auto-approval 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-auto-approval

Agent 與自動化TypeScriptBSD-3-Clause

dsh-auto-approval:為審批策略增加 auto 檔——用預執行分類器(L0 規則 + L1 LLM)把每個工具呼叫判定為 allow/deny,全自動執行、無人工介入,不確定的呼叫一律拒絕(host + client 雙包 monorepo)。

3 StarsAndy8647 更新時間 2026-09-09
訪問 GitHub 倉庫
dsh-auto-approval 專案預覽

專案介紹

中文

dsh-auto-approval:為審批策略增加 auto 檔——用預執行分類器(L0 規則 + L1 LLM)把每個工具呼叫判定為 allow/deny,全自動執行、無人工介入,不確定的呼叫一律拒絕(host + client 雙包 monorepo)。

English

Adds an 'auto' tier to the approval policy: a pre-execution classifier (L0 rules + L1 LLM) judges every tool call allow/deny — fully automatic, and uncertain calls are always denied.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
Andy8647
倉庫
Andy8647/dsh-auto-approval
GitHub Stars
3
Forks
0
開發語言
TypeScript
許可證
BSD-3-Clause
最近推送
2026-09-09
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

59/ 100
維護活躍
99
文件與實用資訊
85
生態關注度
17
安裝便捷訊號
80
專案宣告訊號
100

近 2 天仍在更新;README 含完整安裝與使用說明;關注度尚低(3)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

git clone https://github.com/Andy8647/dsh-auto-approval.git

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-auto-approval

English | 中文

A fourth permission preset for DeepSeek Harness: pick Automode in the composer's permission dropdown and the session runs on full access with an LLM classifier as the only gate before every tool call. No approval prompts — the classifier answers for you.

The permission model stays 3 + 1: the three official sandbox levels, plus one auto tier. Selecting any other preset turns the plugin off; there is no second switch.

0.2.0 is a rewrite of the 0.1.x line. The on/off switch became a permission preset: install, pick Automode, done. Upgrading? See Upgrading from 0.1.x.

Demo

Automode: a multi-step task runs unattended, then a denied call shows up in the decision table

The recording: pick Automode, send one prompt (create a directory, write a file, read it back, then run echo danger_test). The agent runs the file steps unattended — the classifier allows them (L1-deep / whitelist) — and the final command is blocked by a hard rule (L0-deny). The chip's dialog shows both verdicts and the cumulative counts.

How it works

model wants a tool call
        │
        ├─ preset ≠ automode ──────────────► untouched (official behavior)
        │
        └─ preset = automode
                 │
                 ├─ L0 rules (hard deny) ───► deny   (rm -rf /, curl | sh, self-kill …)
                 ├─ trusted tools / bash prefixes ──► allow
                 └─ L1 classifier ──────────► allow | deny   (fail-closed: timeout/parse/no-model → deny)
  • L0 — regex deny rules, self-kill guard, trusted-tool and bash-prefix allowlists. Deterministic, no model call.
  • L1 — the latest real user message plus the bare tool call go to a two-stage classifier (fast single-token filter → deep CoT check when flagged). Tool output is never shown to the classifier, so injected content cannot talk it into an allow.
  • Fail-closed — a timeout, a parse failure, or a missing model denies the call.

The preset writes the same knobs as danger-full-access (full access + approval never), so nothing else asks the user either. What distinguishes the two entries is the plugin's gate — and the official preset service keeps the last selected name, so the dropdown shows which one you picked.

Install

dsh plugin --profile web add dsh-auto-approval
Just published a new version? pnpm 11 refuses versions younger than 24 hours (minimumReleaseAge, a supply-chain default), so add dsh-auto-approval resolves the *previous* release for the first day. Install the exact version (dsh plugin --profile web add [email protected]) or add the package to the profile's pnpm-workspace.yaml:
minimumReleaseAgeExclude:
  - dsh-auto-approval

Then pick Automode in the permission dropdown next to the composer (or /permission automode). The first time you do so in a browser, a one-time notice explains the trade-off (the official "Enable Full access?" gate is keyed to danger-full-access and never fires for a custom preset). The Auto chip then appears beside the preset selector with cumulative allow/deny counts and a click-through decision table.

Source install: clone the repo, pnpm install && pnpm run build, then dsh plugin --profile web add link:/<path>.

Upgrading from 0.1.x

0.2.0 keeps the package name, the auto-approval: settings section and every config key, so an upgrade needs no config changes. What changed:

0.1.x0.2.0
Switchplugin setting enabled + a UI switchthe Automode permission preset (no second switch)
Packagesdsh-auto-approval + dsh-client-ui-auto-approvaldsh-auto-approval (host + browser halves in one package)
Sandboxwhatever preset was active; DSH's own escalation prompt still reached the userfull access + approval never; nothing prompts
L1 unconfiguredallowed everything (a rubber stamp)denies everything outside the allowlists
# 1. drop the old companion package (its browser half now ships in the main package)
dsh plugin --profile web remove dsh-client-ui-auto-approval

# 2. upgrade
pnpm --dir "$DSH_HOME/profiles/web" up dsh-auto-approval

# 3. restart dsh, then pick Automode in the permission dropdown

If your settings.yaml has no classifier configured (classifierFastProvider / classifierFastModel), automode now fails closed — configure one, or only trusted tools and allowlisted commands will run.

Configuration

$DSH_HOME/settings.yaml, hot-reloaded:

automode:
  denyPatterns:
    - 'rm\s+(-[a-z]*[fr][a-z]*\s+)*/\s*$'
    - 'curl\s+[^|]*\x7c\s*(ba)?sh'
  autoApproveTools: [read, write, edit, glob, grep, ls]
  bashCommandPrefixes: [ls, pwd, git status, git diff, pnpm test]
  classifierFastProvider: deepseek-official
  classifierFastModel: deepseek-v4-flash
  classifierDeepProvider: deepseek-official
  classifierDeepModel: deepseek-v4-pro
  classifierGuidance: 'Prefer allowing read-only and test commands.'

Every key is optional. denyPatterns / autoApproveTools / bashCommandPrefixes replace the defaults wholesale (YAML arrays do not merge), so restate the values you want to keep.

Without classifierFastProvider/classifierFastModel there is no L1, and automode fails closed: only trusted tools and allowlisted commands run, everything else is denied. That is deliberate — a session with no classifier is not a safety net, and silently allowing everything would make the gate a rubber stamp.

Permissions and data

SurfaceWhat this plugin does
ReadsTool-call arguments under review; the session log (only to find the latest real user message as classifier intent)
Writes$DSH_HOME/logs/automode.log — a local JSON-lines audit file, best-effort; a write failure only logs a warning
NetworkOnly when L1 is configured: the user message + tool call go to that LLM provider
ExecutesNothing. No subprocess, no shell, no file mutation outside the audit log
Interceptstools/pre-execute (prepended) plus a monotonic ctx.tools.guard() deny guard — both gated on the session's preset
Failure boundsL1 timeout / parse failure / missing model → deny; invalid config throws at load (fail-loud); a missing settings service falls back to the composition entry config

Compatibility

Tracks the latest official DeepSeek Harness release. Currently verified against @deepseek-ai/dsh 0.1.2-rc.1 (install → boot → real tool-call decision in a disposable DSH_HOME). Older releases are not supported.

The bundle patch restates the official preset table, so a base release that adds a preset needs this file updated too.

Development

pnpm install
pnpm run typecheck
pnpm run test
pnpm run build     # lib/index.js (host) + lib/client.js (browser)

License

BSD-3-Clause

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案