Introduction¶
The DSH plugin ecosystem emphasizes “everything is a plugin.” When an agent autonomously performs file operations within the host, a single erroneous write or edit can affect the DSH’s own running state. Maintained by Asuna486-desuwa, dsh-safety-net is positioned as “Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting.” Below is an introduction to its position in DSH, core capabilities, installation methods, and typical usage.
What is it¶
dsh-safety-net is a DSH plugin designed to add a layer of protection to changes in DSH’s critical paths: it snapshots the original files before rejecting changes to protected paths and retains a set of DSH CLI recovery commands. It is enabled in strict mode by default, declares a read-only default sandbox policy, and warns when the host’s sandbox is looser by default; actual sandbox execution is still handled by the host’s sandbox backend. The license is MIT.
Core Capabilities¶
Hard Interception of Protected Paths¶
The plugin hard-intercepts write / edit changes targeting DSH’s critical paths. Built-in protected paths cannot be removed via configuration, and strict mode does not lift path interception.
Backup Before Changes¶
Before rejecting changes to protected paths, the plugin first snapshots the original files to a backup storage. The backup storage is located at:
<DSH_HOME>/safety-net/backups/
CLI Self-Recovery Channel¶
The plugin provides DSH CLI recovery commands covering status, backup, restore, repair, and one-time approval.
Strict Default and Extra Protected Paths¶
strict mode is enabled by default, declaring a read-only default sandbox policy and warning when the host’s sandbox is looser by default. If more paths need protection, additional protected paths can be added via safetyNet.extraProtectedPaths. safetyNet.extraProtectedPaths can only be added at runtime; removal requires modifying the configuration and restarting DSH.
Installation and Enablement¶
Requires Node.js ≥ 20 and a running DeepSeek Harness (DSH) host.
@deepseek-ai/cordis and @deepseek-ai/dsh-fs are provided as peer dependencies by the DSH host runtime and should not be installed standalone via npm install.
Install from npm:
dsh plugin add dsh-safety-net
Install from git:
dsh plugin add git+https://github.com/Asuna486-desuwa/dsh-safety-net.git
After installation, relevant configuration resides under the safetyNet key. Referential keys include:
safetyNet.strict
safetyNet.extraProtectedPaths
safetyNet.backupRetention
safetyNet.dshHome
safetyNet.pluginDataRoot
Here, safetyNet.backupRetention defaults to 30, but retention-based pruning is planned to be implemented in future versions.
If you indeed need to modify built-in protected files, first uninstall the plugin:
dsh plugin remove dsh-safety-net
Then re-add after modifications are complete.
Typical Usage¶
First, check the guardrail health status:
/safety-net-status
Manually snapshot protected assets:
/safety-net-backup
List or restore backups:
/safety-net-restore
/safety-net-restore <id>
Detect missing critical files and print recovery instructions:
/safety-net-repair
Grant one-time write approval for a protected path:
/safety-net-approve <path>
Through the steps above, you can check status, create backups, restore specific backups, or handle one-time incorrect blocks without permanently lifting protection.
Applicable Scenarios and Notes¶
Suitable for users who need to add protected path guardrails, pre-change backups, and CLI recovery commands to DSH. Please note:
strictis declarative/advisory, actual sandbox execution is still handled by the host sandbox backend.- The plugin runs with the current dsh process permissions; check the source code and license before installing.
@deepseek-ai/cordisand@deepseek-ai/dsh-fsare provided by the DSH host runtime and should not be installed standalone vianpm install.- Built-in protected paths cannot be removed via configuration;
strictdoes not lift path interception. safetyNet.extraProtectedPathscan only be added at runtime; removal requires modifying the configuration and restarting DSH.safetyNet.backupRetentiondefaults to 30, but retention-based pruning is planned for future versions.
Directory and Source Code¶
Community directory page:
https://www.skillhub.cn/plugins/Asuna486-desuwa/dsh-safety-net
GitHub:
https://github.com/Asuna486-desuwa/dsh-safety-net
The value of dsh-safety-net lies in breaking down DSH self-protection into executable actions: intercepting critical paths, retaining backups, providing recovery commands, and issuing sandbox policy warnings in strict mode.