Introduction¶
The ecosystem philosophy of DeepSeek Harness (DSH) is “Everything is a Plugin.” When developing with agents, sandbox boundary violations (escalation) are a common scenario. Completely automatic approval poses security risks, while completely manual approval is inefficient. The dsh-approval-gate plugin resolves this conflict.
What is it¶
dsh-approval-gate is an automated approval gating plugin maintained by ventisyn. It utilizes a judgment model to pre-evaluate every sandbox boundary violation: it automatically approves routine operations, while routing high-risk operations to manual confirmation.
Core Features¶
- Model-based Risk Prediction: Every sandbox violation is judged by the judgment model (
SAFEorRISKY:<category>). Recoverable operations are automatically approved. - Hard Risks Always Manual: Five categories of rigid rules—deletion, credentials, remote/production, system paths, and batch operations—are directly routed to manual review without counting or learning.
- Confirmation-based Learning: The same operation is automatically approved after being confirmed N-1 times. The stored rule carries an operation fingerprint, releasing only the specific operation that was confirmed.
- Semantic Similarity Verification: Operations with changed wording but identical intent are judged semantically by the judgment model against confirmed samples, moving away from keyword reliance.
- Hot Configuration Updates: Modifications to
allowlist.jsontake effect immediately without requiring a restart. - Pinned Judgment Model: The settings page offers a dropdown to select “Specific Model / Follow Session Default Model / Use Deployment Default”. Once pinned, switching models in the session will not alter the judgment model.
- Manual Review UI: A green prompt appears above the input box when automatic approval occurs; the approval view (right side of the trajectory) displays the complete approval timeline for the current session.
- File Change Diff & Undo: Clicking a file in the approval record reveals a unified diff (additions in green, deletions in red, context in gray). A one-click “Undo this change” option delivers a command to the AI to restore the file.
- Session-level Snapshot Management: Snapshots are attributed to sessions by event. The approval view aggregates statistics by the current session, supporting “Clear Current Session Only” and “Clear All”.
Installation & Activation¶
Run the following command to install the plugin:
dsh plugin --profile web add dsh-approval-gate
After installation, the permission preset is automatically written to the profile’s cordis.patch.yml (auto-approve preset). You must restart dsh web after installation to ensure the written preset appears in the permission dropdown. Finally, select “Auto Approval” from the session permission dropdown to activate it.
Typical Usage¶
- Hot Update Config: Directly modify
allowlist.json; changes take effect immediately without restarting the service. - Review & Undo: Click a file in the approval record to view the unified diff; if a rollback is needed, click “Undo this change” to deliver a command for the AI to restore the file according to the snapshot.
- View Approval Flow: Check the approval records and manual reviews for the current session in the “Approval” view on the right side of the trajectory.
Use Cases & Notes¶
This plugin is suitable for scenarios within DeepSeek Harness that require minimal human intervention while balancing security and efficiency. Please note before use: This project is a fork of moon09300731/dsh-approval-gate; the original author’s copyright statement must be preserved. The plugin runs with the permissions of the current dsh process; please review the source code and license before use.
Summary¶
dsh-approval-gate balances automation and security for sandbox violations through judgment model prediction and confirmation-based learning. It provides practical features such as hot updates, undo/rollback, and session-level snapshot management, serving as a security assistant tool in the DSH development workflow.