dsh-moongate: A Self-Learning Automatic Approval Gate for DeepSeek Harness

Introduction

Before DeepSeek Harness (DSH) executes a shell command or modifies a file, it prompts for permission confirmation by default. In actual development, a large number of requests are read-only checks, running tests, or modifying files within the workspace, yet every round requires clicking “Allow”. Over time, pop-ups are easily habitually passed through, making the approval process meaningless. On the other hand, completely skipping permissions offers no protection.

There are already approval gatekeeper plugins in the community. dsh-moongate extends this concept: it uses Flash for risk judgment, progressively learns rules from your approvals and rejections, and maintains “never auto-allow, never learn” policies for hard categories like deletion, credentials, and remote/production. Below, the positioning, capabilities, installation, and daily usage of this plugin are explained.

Overview

dsh-moongate is a third-party DSH plugin maintained by suiyideali, categorized under admin-security, with the current repository version being 0.6.3 and a license of MIT. The project is based on moon09300731/dsh-approval-gate v0.5.0; the name is derived from the original author’s ID.

On the approval/request path in Harness, it performs three tasks: first, it uses Flash combined with real tool call parameters to judge risk; second, it solidifies your local approvals and rejections as session memory, cross-session rules, or trust directories; finally, it provides statistics, a rule library, and export functionality on the approval page for auditing and adjustment. The official description summarizes it as: Learning auto-approval gate for DeepSeek Harness: Flash judging, confirmation learning, trust roots and a rule library.

Core Features

Judgment and Learning Pipeline

Approvals roughly follow the sequence: Hard Reject (DENY) -> Trust Directory / Session Memory / Whitelist -> Flash Judgment (SAFE / Hard Categories / Neutral) -> Learning Path. The plugin reads actual parameters (sanitized, truncated to 4KB) from session events via callId, rather than relying solely on the reasoning text provided by the model.

Neutral operations can be auto-approved after you manually confirm them multiple times to reach a threshold. Dangerous categories (deletion, credentials, remote/production, system, batch) are never auto-approved or entered into learning, as per documentation.

Out-of-the-Box Read-Only Fast Path

After first installing and enabling the corresponding permission preset, no need to configure learning rules first; the following strict read-only commands can be directly allowed: git status, gh pr view, ls, cat, grep, sed -n, etc. The conditions are: whitelisted programs, no pipes/redirects, the path falls within the current cwd, and that path does not write rules, does not learn, and does not take snapshots.

Project Trust and Command Intent

You can enable “Project Trust” for a single project root: only allow identified edit/write and common test/build commands (e.g., npm test, go test) within that directory; git push, network, deletion, etc., still go to manual approval. Command intent is distilled from real bash parameters and bound to cwd, for example, npm test and npm publish do not share the same learning key.

Rules and Sessions

Mechanism Function
Session Memory Directly allow operations with the same fingerprint that have been approved in the current session
Cross-Session Accumulation Solidifies into global rules after confirmation across multiple sessions
Signature Graduation Graduates to rules after cumulative manual confirmation of similar operations
Self-Learning (Default On) Automatically graduates signatures after Flash accumulates SAFE up to a threshold; default is 3 times / 1 session, adjustable
Trust Directory After configuration, operations within the directory are zero-click allowed; supports prefixes like ~/src
Negative Feedback Refusing or reverting changes deletes the corresponding rule/memory and upgrades it to permanent manual intervention

The approval page supports “Remember this operation” and “Cancel remembering”; the rule library supports search, inline editing, toggle on/off, delete, export JSON, and evidence events. There are also optional capabilities like Shadow observation, Stop-loss observation (P0 only records, does not intercept), two-stage quick screening + re-evaluation, etc. Default strategies are based on the README.

Approval Dashboard

The “Approval” tab on the right side of the timeline provides records and settings: the Records tab contains summary of items to watch, distribution of 5 approval categories, 7-day trends, aggregation by project/directory, and timeline; the Settings tab is the only configuration entry for auto-approval (initialization, DENY, whitelist, Flash, learning and solidification, rule library, etc.), changes take effect hot.

Installation and Enablement

The plugin adapts to DeepSeek Harness 0.2.x (README records testing on 0.2.2-rc.1). After installing or updating host code, you need to reload the plugin; only refreshing the page suffices if only changing the client. The desktop profile in DSH Desktop is hosted by the application and cannot be managed via dsh plugin --profile desktop in the CLI; please operate in the plugin interface within the application.

  1. Open the sidebar Plugins page.
  2. Select Install Third-Party Plugin via Add Plugin.
  3. Enter the package name in the input box:
github:suiyideali/dsh-moongate
  1. Click Install, then Enable Immediately and reload or refresh as prompted.

CLI Installation (Self-managed profile)

Replace <profile> with your actual profile (usually web), do not copy desktop blindly:

dsh plugin --profile <profile> add github:suiyideali/dsh-moongate

Can also be used after publishing to npm:

dsh plugin --profile <profile> add dsh-moongate

Permission Presets

When combining permissions, you need to manually add the auto-approve preset to the profile’s cordis.patch.yml (excerpt):

- id: permission
  name: '@deepseek-ai/dsh-permission-presets'
  config:
    presets:
      auto-approve:
        sandbox: workspace-write
        approval: ask
        name: Auto-Approval (Flash)
        description: Learning-style auto-approval: automatically allow workspace writes, automatically agree to similar operations after confirmation, and route dangerous operations to manual review.

After reloading, “Auto-Approval (Flash)” will appear in the session permission dropdown. Do not enable together with the upstream dsh-approval-gate, otherwise the two plugins will fight for the same approval hook; when migrating from upstream, the data directory is still ~/.dsh/auto-approve/, and rules can be reused.

Typical Usage

  1. Select “Auto-Approval (Flash)” in the session permission dropdown, only effective for the current session.
  2. No need to configure learning first: self-learning, session memory, and cross-session accumulation are enabled by default. For a more conservative approach, go to Approval → Settings → ⑤ Learning and Solidification to turn off self-learning or increase the threshold; for a faster approach, click “Trust” on a project or add trust directories in ⑥ Rule Library.
  3. Normal development: safe operations are auto-approved; uncertain operations pop up; operations of the same type that you approved are first reused in the current session, then solidified across sessions.
  4. For fine-grained control: click “Remember this operation” in the approval row; export or edit rules in the rule library; rejection triggers negative feedback and may escalate to “Manual Intervention” (e.g., consecutive 3 times or cumulative 20 rejections, see documentation).

Use Cases and Notes

Suitable for developers who write code, run tests, and check repository status in DSH for a long time, while wishing to reduce ineffective clicks while retaining manual control over high-risk operations. If you prefer a pure sandbox or completely manual approval, you need to adjust self-learning and trust directories according to your risk preference.

Third-party plugins run with the current DSH process permissions. Please check the GitHub repository source code and MIT license before installing, and verify metadata at the SkillHub directory page. The community plugin directory is an independent site with no official affiliation to DeepSeek / HF (Huanfang).

Conclusion

dsh-moongate places “Model Judgment + Human Confirmation + Progressive Learning” in the middle of the default approval flow: common read-only and confirmed workspace operations gradually require fewer clicks, while dangerous categories remain with you. For further understanding of features and the security model, see the repository README; use the installation package name github:suiyideali/dsh-moongate or npm name dsh-moongate.

  • Directory Page: https://www.skillhub.cn/plugins/suiyideali/dsh-moongate
  • GitHub: https://github.com/suiyideali/dsh-moongate
羽毛球分组比赛记分
小程序二维码

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

Xiaoye