Andy8647/dsh-auto-approval--packages-dsh-auto-approval2

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、强制推送)误执行的用户,通过正则匹配和模型分类实现高危拦截、低危自动放行。

パッケージ
dsh-auto-approval
バージョン
0.1.0
最終更新
2026/08/13

インストール

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