DeepSeek Harness plugin

dsh-safety-net

Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting

Jump to install

Source facts

Repository
Asuna486-desuwa/dsh-safety-net
Latest update
Aug 19, 2026
Category
Security & Permissions
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Asuna486-desuwa/dsh-safety-net
Plugin: dsh-safety-net
Author: Asuna486-desuwa

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

dsh-safety-net

Self-protection guardrails for the DeepSeek Harness (DSH). When an agent runs autonomously, a wrong write can silently destroy the harness itself — this plugin makes that damage impossible by default and reversible by command.

> 中文文档见 README.zh-CN.md · Chinese docs live in > README.zh-CN.md

Why this plugin exists

DSH's own runtime state lives in plain files under ~/.dsh (profiles, session state, patches) and under the plugin data directory. An agent that misreads its sandbox boundaries can write/edit those files, corrupt the harness, and leave you unable to start DSH at all. dsh-safety-net is the seatbelt: it hard-blocks mutations on DSH critical assets, snapshots files before refusing, and keeps a CLI recovery channel that works even when the GUI is gone.

The four guardrails

1. Protected-path guard (hard interception)

fs/write-intent and fs/edit-intent waterfall listeners hard-block any mutation that targets a DSH critical path. Protected by default:

Rule idPath
dsh-home~/.dsh (the DSH data root, $DSH_HOME override)
plugin-data~/.claude/plugins/data/dsh-deepseek-dsh
profile-manifest / profile-patch~/.dsh/profiles (profile manifests & patches)
session-state~/.dsh/state (session state)

A blocked mutation raises an FS_POLICY_DENIED error — the agent cannot silently retry its way past it. Extra paths can be added via safetyNet.extraProtectedPaths (see [Configuration](#configuration)).

2. Backup before destroy

Before a protected path is refused, the original file is snapshotted into the backup store. Nothing is ever destroyed: every blocked write/edit leaves a restorable copy behind (unless the snapshot itself fails), so the worst case is one command away from being undone.

3. CLI self-recovery channel

Five slash commands, registered on the DSH CLI surface, work even when the GUI is down:

  • /safety-net-status — guardrail health report (protected rules, backups, strict mode)
  • /safety-net-backup — manual full snapshot of protected assets
  • /safety-net-restore — list backups, or restore one by id
  • /safety-net-repair — detect missing critical files and print recovery instructions
  • /safety-net-approve <path> — one-time approval to write a protected path (grants a single bypass, then the guard is re-armed)

See [Commands](#commands) for details.

4. Strict privilege tiering

Strict mode is on by default: safety-net declares a read-only default sandbox mode and warns when the host sandbox default is wider (workspace-write / danger-full-access). The declaration is advisory — actual enforcement stays with the host sandbox backend, which safety-net cannot force. Turn strict off only if you understand the trade-off (safetyNet.strict: false).

Installation

Requires Node.js ≥ 20 and a running DeepSeek Harness (DSH) host.

> Dependencies: @deepseek-ai/cordis and @deepseek-ai/dsh-fs are declared > as peer dependencies — they are provided by the DSH host runtime itself > and are not fetched from the public npm registry (the dsh-fs version DSH > ships may not exist on public npm). Install this plugin inside a DSH > profile; do not npm install it standalone.

From npm:

dsh plugin add dsh-safety-net

From git:

dsh plugin add git+https://github.com/Asuna486-desuwa/dsh-safety-net.git

Manual mount: clone the repository and wire it into your DSH plugin flow as usual — cordis.patch.yml already declares the bundle patch, and package.json carries the dsh.bundle metadata.

Configuration

All options live under the safetyNet key:

safetyNet:
  # Strict mode: declares a read-only default and warns if the host sandbox
  # default is not tightened. Default: true
  strict: true
  # Additional paths to protect (beyond the built-in DSH critical paths)
  extraProtectedPaths: []
  # Reserved — retention-based pruning wiring lands in a later release. Default: 30
  backupRetention: 30
KeyTypeDefaultDescription
safetyNet.strictbooleantrueDeclares a read-only default sandbox mode; warns when the host sandbox default is wider (workspace-write / danger-full-access).
safetyNet.extraProtectedPathsstring[][]Extra paths treated as DSH critical assets.
safetyNet.backupRetentionnumber30Max snapshots kept in the backup store before pruning (reserved; pruning wiring lands in a later release).
safetyNet.dshHomestringenv DSH_HOME or ~/.dshOverride the DSH data root (used by the guard, the backup store and the status report alike).
safetyNet.pluginDataRootstring~/.claude/plugins/dataOverride the plugin data root (mainly for tests/injection).

The backup store is created under <DSH_HOME>/safety-net/backups/.

Commands

Command names are registered without a slash (safety-net-status, ...) and are shown below with a leading / as they appear in the DSH UI/CLI.

CommandBehavior
/safety-net-statusReports guardrail health: number of protected rules, stored backups, strict mode, and the resolved DSH home.
/safety-net-backupManually snapshots every protected asset into the backup store.
/safety-net-restoreWith no argument, lists all backups (newest first).
/safety-net-restore <id>Restores the files of the given backup id to their original locations.
/safety-net-repairDetects missing critical files and prints recovery instructions (never auto-modifies anything).
/safety-net-approve <path>Grants a one-time write bypass for a protected path (calls guard.approveOnce); the next matching mutation passes, then the guard re-arms.

Unblocking a false positive

If a legitimate write is blocked — e.g. you really need to modify a file under a protected path — keep this in mind:

  • one-time bypass: /safety-net-approve <path> grants a single write

approval for that path; the next matching mutation passes, then the guard re-arms. (This wires guard.approveOnce into the CLI.)

  • paths you added via safetyNet.extraProtectedPaths are **add-only at

runtime**: to stop protecting one, remove the entry from the config and restart DSH;

  • the built-in rules (~/.dsh, profiles, state, plugin data) cannot be

removed through configuration. strict only declares the sandbox posture and does not lift path interception. To modify a built-in protected file, unload this plugin first (dsh plugin remove dsh-safety-net), do the edit, then re-add it.

A runtime one-time approval channel (approveOnce, already unit-tested on the guard) is planned for v0.2; until then the blocked error message points at the two options above.

Backup layout

<DSH_HOME>/safety-net/backups/
└── <timestamp-id>/          # e.g. 1750000000000-a1b2c3
    ├── _meta.json           # maps each snapshot file back to its EXACT original path
    └── <relative-path>      # original path, drive letter stripped, '/' separators

Each snapshot is one directory named by a time-based id; the original relative path is preserved beneath it, and _meta.json records the full original path (drive letter included) so restore writes every file back to exactly where it came from — even across Windows drive letters.

Scope & disclaimer

This plugin intentionally does not:

  • provide a GUI panel — recovery lives in the CLI, where it still works when

the GUI is down;

  • sync backups to the cloud — backups are local files under

<DSH_HOME>/safety-net/backups/;

  • restore file content diffs — restore is whole-file, snapshot-point based;
  • intercept operations on non-critical paths — only DSH critical assets and

paths you explicitly add are protected.

Development & testing

node --test tests/*.test.mjs

Tests run against an injected fake fs adapter and injected dshHome / pluginDataRoot overrides — they never touch your real ~/.dsh.

License

MIT