dsh-approval-core: DSH Automated Approval Decision Pipeline (fail-safe hardened version)

Preface

When running agents in DeepSeek Harness (DSH), tool calls often have to pass through a layer of manual approval: modifying files within the workspace can be silently allowed, but if out-of-bounds commands, database deletions, credentials access, or remote execution operations all trigger pop-ups, daily development will be interrupted; conversely, if they are all automatically allowed, it is easy to step on landmines. There are already plugin concepts based on approval gates in the community; dsh-approval-core is a forked and hardened version of dsh-approval-gate, published by maintainer lyaoliu and categorized under admin-security. Its goal is to separate “routine in-sandbox / learnable repetitive patterns” from “hard risks, regex matches, or uncertain classifier outputs”: the former can be auto-approved or constrained learning, while the latter is always escalated to manual review (fail-safe).

The following introduces what it is, core behaviors, installation and configuration, as well as the review view and revert capabilities. Facts are subject to the GitHub README and design documents; the DSH ecosystem is “everything is a plugin,” and the SkillHub directory page is a community site with no official affiliation with DeepSeek / High-Flyer.

What is this

dsh-approval-core (current package version 0.2.0, MIT) is an automatic approval decision pipeline hooked into the DSH Web side: workspace file writes are directly allowed by the sandbox (bypassing the approval waterfall); neutral requests like out-of-bounds are defaulted to manual review first, and can optionally be auto-approved after fingerprint hits and learning thresholds are met; hard risk categories, regex danger lists, and classifier outputs that are timed out/failed/unparseable are always escalated to manual review. Learning data is stored independently and can be cleared with one click; it comes with a hierarchical configuration UI and a block-level revert review view.

Maintainer: lyaoliu. Upstream is dsh-approval-gate; for copyright and change descriptions, see the repo’s NOTICE and the “Differences from upstream” section in the README.

Core Features and Behaviors

The README has been verified on real machines with DSH Desktop 2.0.5 / plugin 0.1.2-rc.1. The behavior can be summarized in the table below (thresholds and lists are subject to allowlist.json):

Scenario Behavior
Write files within workspace Directly allowed by sandbox, zero disturbance
Out-of-bounds requests (neutral class) Forward to manual review for the first riskyThreshold (default 5) times, and recorded in learning samples based on operation fingerprint
Same fingerprint and same operation type reaches threshold Auto-approve (fp-hit), audit marked as auto-learned
Hard risk categories (deletion/credential/remote/system/bulk) Always manual, no counting, no learning
Regex danger list hits (e.g., rm -rf, force-push, curl|sh, etc., 13 entries + denyKeywords) Always manual, executed before classifier
Classifier timeout/failure/unparseable output Fail-safe to manual review
Manual denial Escalated to permanent manual rule (denyRules), clears learning count for that category
Command /approval-core-clear-learning One-click clear all learning sedimentation (stats and history)

Main differences from upstream (excerpt): Fixed the way permissionPresets is passed to Session to avoid the plugin never taking over; Keyword DENY layer changed to 13 deterministic regexes + denyKeywords second layer; Learning independent learning.json and clearable; v0.2.0 restored restricted POST /api/auto-approve/rules (server-side classifyOp + validateValue); Ported callId backtracking, snapshots, and Windows path fixes. The repo contains 49 node:test cases.

Installation and Enablement

The installation method given in the official README is adding a local directory to the web profile (not a one-click remote command after git clone, please replace ./dsh-approval-core with the actual path where you obtained the plugin package):

dsh plugin --profile web add ./dsh-approval-core

The plugin runs with the current DSH process privileges; before installation, you should read the source code and LICENSE (MIT) yourself to ensure it meets your security policy.

Data and Configuration Directories (default $DSH_HOME/auto-approve/, can be migrated to an absolute path via dataDir):

  • allowlist.json — Rules and configuration (hot-read, read from disk before each approval; denyKeywords regex compiled at load time, requires restarting dsh web after changes)
  • learning.json — Learning status (one-click clearable)
  • audit.log — Decision audit
  • events.jsonl — Review UI event stream
  • reverts.jsonl — Executed revert records (server-side deduplication)

When optional "dataDir" is an absolute path, learning/audit/events/snapshots etc. migrate to that directory; allowlist.json remains in the default directory. Changing dataDir requires restarting DSH Desktop.

Configuration and HTTP Interface

Rules, thresholds, and learning switches can be edited in allowlist.json or modified via restricted HTTP interfaces (v0.2.0 restored restricted rules API). Main fields include: denyKeywords, allowRules, denyRules, hardCategories, riskyThreshold, judgeTimeoutMs, learning, dataDir, classifierModel, etc.

Read-only and write interfaces (write operations pass through a four-level permission matrix + structural validation):

  • GET /api/auto-approve/rules — Configuration, learning status, preset lists, permission levels for each kind (for UI)
  • POST /api/auto-approve/rules — Restricted write; hardCategories is always forbidden; deleting preset items is forbidden; danger-full-access cannot be whitelisted
  • Also GET events / GET diff / GET snapshots-stats, and POST revert, POST snapshots-clear

Configuration UI Permission Levels (Server side is the final boundary):

Level Example Interaction
Read-only Pipeline overview, learning progress, data directory, classification model Display only
Free change riskyThreshold (1–20), judgeTimeoutMs (5s–120s) Direct change, out of bounds returns 400
Confirm change Add blacklist words, add whitelist rules, delete custom items Submit after confirmation
Forbidden + 403 Hard risk categories, delete preset items, danger-full-access whitelisting No control in UI, direct requests are also rejected

Classification Model: Set "classifierModel": {"provider": "...", "model": "..."} in allowlist.json, taking precedence over session default model; takes effect immediately upon file change, POST /rules does not allow changing this item.

Permission presets can also be added to the profile’s cordis.patch.yml as auto-approve presets (preset table is frozen during configuration construction).

Review View and Revert

The “Approval” tab on the right side of the session provides approval history: file chips allow viewing change diffs (pre-change snapshot vs. current file); the bottom “Revert this change” restores the pre-approval state; each hunk has “Revert this block”. Reverts go through AI execution and the normal approval waterfall, not direct program writes to disk, and use anchors to verify line numbers. Reverted records are in reverts.jsonl, repeated reverts return 409; reverted blocks are grayed out and unclickable.

Applicable Scenarios and Notes

Suitable for: Teams or individuals who want to unify “silent in sandbox + learnable out-of-bounds + hard risks and fail-safe never cross the line” on the DSH Web side; users who need the fixed Session preset determination, regex DENY layer, and restricted rules API from the forked version.

Notes:

  1. When learning.enabled=false, the learning path is closed, and related requests are escalated to manual review according to rules.
  2. Classifier output must conform to the dual protocol described in the README (JSON verdict or SAFE/RISKY:<category>), otherwise fail-safe.
  3. Metadata such as directory page stars are subject to SkillHub / GitHub pages (GitHub stars were 0 at the time of writing).

For design details, see the repo docs/specs/2026-09-06-dsh-approval-core-design.md.

Conclusion

dsh-approval-core turns automatic approval into an auditable, rollback-able, and learning-clearable pipeline: routine out-of-bounds operations can be sedimented into approvals under constraints, while dangerous and uncertain ones are always manual. To install or view classification instructions, you can open the SkillHub directory page and GitHub repo.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye