Apache-2.0 的 dsh 外掛:以有序的 allow/deny/ask 規則攔截 DeepSeek Harness 的每一次工具呼叫,將判定記入工作階段日誌,並強制執行程序級網路原則——全部用 YAML 設定,支援熱重載。
DSH 整合
原生執行環境
作者聲明
安全稽核
未稽核
最後核實
2026-08-30
授權條款
Apache-2.0
01它能幫你完成什麼?
Gate every DeepSeek Harness tool call with an ordered allow / deny / ask permission policy written in plain YAML
A deterministic, instant, auditable rule layer on the `tools/pre-execute` waterfall, with every hit and passthrough audit-logged as a `permissionRules/decision` session event
DeepSeek Harness (dsh) operators who want Claude Code-style declarative safety guardrails without re-implementing the approval flow
Control shell subprocess network egress with a process-level network policy
A built-in local HTTP/CONNECT proxy plus ordered network rules (deny-all / whitelist / allow-all / auto) that decide every outbound connection
Teams that need Codex-style egress control and network-policy auditing inside DeepSeek Harness
02如何將外掛接入 DeepSeek Harness?
先決條件
- DeepSeek Harness `0.1.1-rc.2` (or compatible) installed as the agent runtime
- Node `^22.19.0 || >=24.0.0`
安裝步驟
- 01
Install the bundle: `dsh plugin --profile web add "github:PerryLink/dsh-permission-rules#main"`
$ dsh plugin --profile web add "github:PerryLink/dsh-permission-rules#main"
- 02
Or from npm (published releases): `dsh plugin --profile web add dsh-permission-rules`
$ dsh plugin --profile web add dsh-permission-rules
- 03
Restart and verify the row: `dsh --profile web --dump-config | grep -A4 'id: permission-rules'`
$ dsh --profile web --dump-config | grep -A4 'id: permission-rules'
驗證整合成功
- After restart, `dsh --profile web --dump-config | grep -A4 'id: permission-rules'` prints the permission-rules row
- Run `/rules` to list the active rules, their source files, and any last-reload error
復原
- Uninstall with `dsh plugin --profile web remove dsh-permission-rules`
- Set `enforce: false` for a dry-run rollback: deny/ask hits are audit-logged with a `dryRun` marker and every call passes through
03DSH 整合程度與能力邊界
Native dsh plugin — installs via `dsh plugin --profile web add`, then hooks the `tools/pre-execute` waterfall as a first-match allow/deny/ask listener.
Ordered allow / deny / ask rules on tools/pre-execute
tool calls on the `tools/pre-execute` waterfall→first-match allow/deny/ask decision; `deny` makes the rule `reason` the model-visible error; `ask` rides the official approval seam
Every hit and passthrough is audit-logged as a `permissionRules/decision` session event (log-only — nothing extra is injected into the model context)Rich rule matching
tool-name globs, agent-identity selectors, argument key/value globs or regexes, workspace-relative path globs, `when` host conditions, shell command decomposition→token-precise match across multiple dimensions
Process-level network policy + local proxy
shell subprocess outbound connections→ordered network rules / deny-all / whitelist / allow-all / auto modes; denied connections audit to `permissionRules/network`
Proxy environment variables are injected for subprocesses (`network.injectEnv`)A built-in local HTTP/CONNECT proxy binds `127.0.0.1`Hot reload & fail-loud loading
rule file edits→Chokidar watch with debounce reload; a broken edit keeps the previous rules, never crashes
Invalid YAML, unknown actions/fields, bad globs/regexes, backtracking-prone patterns, or more than `maxRules` rules fail the load loudly
04適合誰?何時不該用?
適合
- DeepSeek Harness (dsh) operators who want Claude Code-style declarative safety guardrails without re-implementing the approval flow
- Teams that need Codex-style egress control and network-policy auditing inside DeepSeek Harness
不適合
- On pre-marker harness hosts (the `0.1.0-rc.1`–`rc.7` and `0.1.1-rc.1`–`rc.7` lines) the `ignorable` marker is silently dropped and the runtime disables session-log audit with a one-time warning; set `allowUnmarkedAudit: true` to opt back in.
05相容性、維護與安全提醒
- On pre-marker harness hosts (the `0.1.0-rc.1`–`rc.7` and `0.1.1-rc.1`–`rc.7` lines) the `ignorable` marker is silently dropped and the runtime disables session-log audit with a one-time warning; set `allowUnmarkedAudit: true` to opt back in.
- Path candidates are heuristic: only the documented argument keys feed path matching, and workspace-relative matching is ASCII-case-insensitive only when `caseInsensitivePaths` is on. Globs are a conservative subset with no brace expansion.
- `paths` candidates come only from a documented set of argument keys (depth-capped) and only workspace-relative paths match. OS-level sandbox policy belongs to the sandbox seam, not this plugin.
Apache-2.0 · actively maintained (latest release v0.6.1, 2026-08-27)
06常見問題
如何在 DeepSeek Harness 中安裝 dsh-permission-rules?
已發佈版本執行 `dsh plugin --profile web add dsh-permission-rules`;最新 main 分支執行 `dsh plugin --profile web add "github:PerryLink/dsh-permission-rules#main"`。隨後重新執行並用 `dsh --profile web --dump-config | grep -A4 'id: permission-rules'` 驗證。
安裝前提與相容性是什麼?
需要 DeepSeek Harness `0.1.1-rc.2` 與 Node `^22.19.0 || >=24.0.0`。支援所有平台(宿主程序 + Web 設定客戶端),且適用任意模型,因為 deny/ask 的原因會透過工具結果回傳。
它如何與 DeepSeek Harness 連接 / 整合?
它是原生 dsh 外掛:註冊一個 `tools/pre-execute` 監聽器,使每次工具呼叫先經過其有序的 allow/deny/ask 規則。`ask` 判定走官方核准通道——掛載 `dsh-auto-review` 可由第二模型作答,或由人工作答——因此核准流程沒有任何重新實作。
它與 Claude Code 的權限或沙箱有何不同?
它風格類似 Claude Code,但作為原則層執行在 DeepSeek Harness 內部,而非核心。`paths` 候選只來自一組文件化的參數鍵,且只匹配工作區相對路徑;作業系統級沙箱原則仍由沙箱通道負責。它還提供程序級網路原則與內建本地代理,並復用 harness 自身的核准流程而非另起一套。
排障:稽核日誌遺失或規則未載入?
在 pre-marker harness 宿主(`0.1.0-rc.1`–`rc.7` 與 `0.1.1-rc.1`–`rc.7` 系列)上 `ignorable` 標記會被靜默丟棄,執行時會一次性告警並關閉工作階段日誌稽核;設定 `allowUnmarkedAudit: true` 可重新開啟。損壞的 YAML、未知欄位、錯誤的 glob/regex,或超出 `maxRules` 會保留舊規則(熱重載)或直接報錯載入失敗——執行 `/rules` 可查看最近一次重載錯誤。
07相關的 DSH 工作流程
dsh-uumit-remote
作者 uumit-ai
為 DeepSeek Harness 提供遠端訪問能力,支援從其他裝置連線和使用會話。
dsh-auto-review
作者 perrylink
第二模型 AI 自動評審:只讀評審子智慧體對審批請求返回結構化允許或拒絕結論,預設關閉、全程可審計。
cc-safety-net
作者 kenryu42
面向 AI 程式設計智慧體的執行前安全防護外掛,在工具呼叫前攔截破壞性 Git、檔案操作和敏感檔案訪問,相容多種編碼 Agent 與命令列工具。
dsh-confirm-gate
作者 steelunion
統計每輪會話中的持久化操作次數,達到條件後提醒模型停止並請求使用者確認;支援許可權切換,無需重啟即可生效。
08資料與來源
Claude Code-style declarative permission rules for DeepSeek Harness.
`dsh-permission-rules` puts an ordered **`allow` / `deny` / `ask`** rule list in front of every tool call on the `tools/…
此頁面根據專案公開文件、儲存庫中繼資料與 DSH Plugins 的結構化解析所產生;最後核實於 2026-08-30。發現錯誤?提交更正。
最佳 DeepSeek Harness 外掛
從全目錄挑出的 12 個值得優先安裝的外掛,涵蓋各個分類。
