Andy8647/dsh-auto-approval--packages-dsh-auto-approval ↗★ 2
dsh-auto-approval
Automated tool-call approval for DeepSeek Harness: an `auto` tier for approval policy that classifies each tool call as allow / deny before dispatch
AI 分析
核心用途是平衡 DSH 运行效率与系统安全。适合希望减少频繁手动点击审批、但又担心高危命令(如 rm、强制推送)误执行的用户,通过正则匹配和模型分类实现高危拦截、低危自动放行。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Andy8647/dsh-auto-approval#484ad86be5c2585610a828bc42aa8a52df016e09&path:packages/dsh-auto-approvalドキュメント
README 全文を読む ↗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
| Key | Default | Description |
|---|---|---|
enabled | true | master switch |
denyPatterns | see src/config.ts | regexes, matched ⇒ deny (hard rule) |
askPatterns | see src/config.ts | regexes, matched ⇒ deny (formerly ask; kept for config compatibility) |
autoApproveTools | read-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 |
bashCommandPrefixes | empty | bash 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) |
selfKillGuard | true | self-kill guard, see above |
auditSessionEvents | false | whether 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 / classifierFastModel | unset | L1 fast model route (must be paired; setting enables L1) |
classifierDeepProvider / classifierDeepModel | unset | L1 deep model route (paired; defaults to fast) |
classifierTimeoutMs | 20000 | per-call L1 timeout, fail-closed ⇒ deny |
classifierGuidance | unset | custom judgment guidance (advisory, not hard rules) |