xiaochaz/dsh-approval-gate: DeepSeek Harness Automated Approval Gate

Introduction

The plugin architecture of DeepSeek Harness (DSH) allows developers to flexibly extend capabilities. However, in scenarios involving frequent file writes and command execution, striking the right balance between “auto-approval” and “manual confirmation” is a problem that requires careful deliberation. After the original auto-approval plugin was discontinued on 2026-08-20, the community took over maintenance and released a new version: xiaochaz/dsh-approval-gate. It uses the Flash model to pre-assess sandbox violations, minimizing manual intervention while ensuring safety.

Below is an overview of the plugin’s core capabilities, installation and activation steps, and typical usage.

Plugin Overview & Maintenance

  • Name: @xiaochaz/dsh-approval-gate
  • Maintainer: xiaochaZ (community-maintained)
  • Category: admin-security
  • Version: 0.5.5
  • Description: DeepSeek Harness auto-approval gate (community-maintained): Flash model pre-assesses whether writes/commands are irreversible — safely auto-approves, escalates risky operations to manual review (fail-safe), minimizes manual intervention, includes a manual review UI

Core Features

The plugin uses the Flash model to perform a risk assessment for every sandbox violation and makes a decision to either auto-approve or escalate to manual review based on the result.

  1. Flash Risk Assessment
    Each sandbox violation is classified by the Flash model as SAFE or RISKY:\<category>. Operations that are reversible are auto-approved once deemed safe.

  2. Hard Risks Always Require Manual Approval
    Five categories of operations — deletion, credentials, remote/production, system paths, and bulk operations — are always escalated to manual confirmation. They are neither counted nor learned from.

  3. Confirmation-Based Learning
    After the same operation is confirmed N−1 times, it is auto-approved. Accumulated rules carry an operation fingerprint, so only operations you have explicitly confirmed are auto-released.

  4. Semantic Similarity Validation
    Operations with different wording but identical intent are evaluated by the Flash model against your confirmed samples using semantic matching, rather than relying on keywords.

  5. Hot Configuration Reload
    Changes to allowlist.json take effect immediately without requiring a restart.

  6. Manual Review UI
    A green indicator appears above the input field when auto-approval is granted. The approval view (on the right side of the trace) displays the complete approval timeline for the current session.

  7. File Change Diff & Undo
    Files involved in an approval can be clicked to view a classic diff (changed lines only, green for additions, red for deletions). A one-click “Undo this change” button restores the file via the AI. You can also view snapshot usage and clear diff records with one click.

  8. Diagnosable Failures
    Anomalies in the decision pipeline no longer fail silently — they write to the audit log and fall back to manual review (fixes the silent catch issue in upstream v0.5.0).

Installation & Activation

Dynamic plugins cannot extend the host’s frozen presets table, so the permission preset must be configured manually.

Installation

It is recommended to use the official install command:

dsh plugin --profile <your profile name> add github:xiaochaZ/dsh-approval-gate#v0.5.5

After installation, you must complete the “Configure Permission Preset” step, or the plugin will not take effect.

Configure Permission Preset

Edit the profile’s cordis.patch.yml (path: ~/.dsh/profiles/<your profile name>/cordis.patch.yml). If there is no - id: permission entry, add the entire block:

# ── 自动审批模式 ─────────────────────────
- id: permission
  name: '@deepseek-ai/dsh-permission-presets'
  config:
    presets:
      read-only:
        sandbox: read-only
        approval: ask
      workspace-write:
        sandbox: workspace-write
        approval: ask
      danger-full-access:
        sandbox: danger-full-access
        approval: never
      auto-approve:
        sandbox: workspace-write
        approval: ask
        name: 自动审批(Flash)
        description: Flash 预判写入/命令是否不可回补:安全自动批准,有风险转人工审批。
    defaultPreset: auto-approve

If a - id: permission entry already exists, simply insert the auto-approve: block under presets: (make sure the indentation aligns with sibling presets), and update defaultPreset as needed.

After making changes, restart DSH (the host only loads plugins and presets at startup). The “Auto-Approve (Flash)” option should then appear in the session permission dropdown.

Typical Usage

In a session, trigger an operation that requires a sandbox violation — for example, asking the AI to write a file outside the workspace (sandbox denies → retry with sandbox_permissions):

  1. Ask the AI to attempt writing a file outside the workspace. The DSH sandbox intercepts the request and returns a retry with sandbox_permissions.
  2. The plugin performs a Flash assessment. If classified as SAFE, the operation is auto-approved and a green indicator appears above the input field.
  3. Check the end of audit.log. You should see a log entry like:
[<ISO timestamp>] ALLOW   <tool> mode=<sandbox mode> (flash-safe)

If you see ERROR permissionPresets.current failed: ... → falling back to manual, it indicates a host API drift. Please open an issue with your host version included.

Applicable Scenarios & Notes

  • Suitable for DSH sessions that require frequent writes and command execution but aim to minimize manual confirmations.
  • The plugin runs with the permissions of the current dsh process. Review the source code and license before installing.
  • Dynamic plugins cannot extend the host’s frozen presets table, so the “Configure Permission Preset” step must always be done manually once.
  • Risk assessment is delegated to a model, which is inherently probabilistic: hard risk categories are strictly blocked, but manual confirmation is still recommended for production and credential-related operations.

Summary

xiaochaz/dsh-approval-gate uses Flash model pre-assessment and confirmation-based learning to minimize manual intervention while maintaining safety. It fixes critical issues such as silent failures in the upstream version and provides a complete manual review UI along with file diff and undo capabilities. If you need auto-approval in DSH, you can follow the installation and configuration steps outlined in this article and explore further details on the catalog page and the GitHub repository.

  • Catalog page: https://www.skillhub.cn/plugins/xiaochaZ/dsh-approval-gate
  • GitHub: https://github.com/xiaochaZ/dsh-approval-gate
羽毛球分组比赛记分
小程序二维码

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

Xiaoye