HunYiSage/dsh-purge
Security & PrivacyPatches a locally installed DeepSeek Harness to replace host prompts and policy defaults for authorized red-team evaluation.
What it does
dsh-purge is a plugin for a DeepSeek Harness (DSH) installation you already run locally. It targets DSH 0.2.1-rc.2 (0.2.0 also works) and explicitly does not support 0.2.1-rc.3 or newer release candidates. Its purpose is to separate host-layer restrictions from model refusals: DSH rewrites prompts, applies approval gates and sandbox policy at runtime, so a blocked request may never reach the model. The plugin patches local @deepseek-ai packages and profile configuration, then injects a prompt from its own encrypted slot so you can evaluate which default policies are too tight installation and scope.
It supports the official dsh web host and the official desktop EXE as separate installations. A dock beside the session title contains a Clean page for patch status, Apply/Restore/Uninstall, the prompt editor and multiple rule sets, and a Drill page that requires an authorization acknowledgement. The open-source build is local-lab only: attack tasks are restricted to loopback and RFC1918 addresses, every resolved address must be private, and game cheats are blocked maintainer scope. The published build does not include the skill library or knowledge base.
Install and first run
Prerequisites: a supported DSH host, Node.js 18 or newer, and either the dsh CLI or pnpm. Do not install from the plugin marketplace or try pnpm add dsh-purge from the npm registry; the package is distributed through a GitHub tarball install notes.
- Pick the profile matching the host you actually open:
webfordsh web,desktopfor the desktop EXE. - From a terminal with
dshonPATH, add the plugin:
dsh plugin --profile web add https://codeload.github.com/HunYiSage/dsh-purge/tar.gz/refs/heads/master
Use --profile desktop for the desktop client. If you only have pnpm, run pnpm add https://codeload.github.com/HunYiSage/dsh-purge/tar.gz/refs/heads/master inside $DSH_HOME/profiles/web (or profiles/desktop). The README warns that github.com/.../archive URLs redirect and fail under pnpm, so use the codeload URL. pnpm 11/12 may skip the postinstall script; the README provides --allow-build and pnpm approve-builds forms, plus node node_modules/dsh-purge/scripts/ensure-profile-bundle.mjs if profile registration is missing quick start.
3. Fully quit and reopen the host. For dsh web, stop and restart the process; for the desktop app, quit the tray icon as well.
4. Click dsh-purge beside the session title, open Clean, and click Apply. A successful apply restarts the host once. Confirm with /purge status in chat, which prints DSH_HOME and the patch list.
If the command-line flow fails, the README includes a manual path: clone or extract the repository to $DSH_HOME/plugins/dsh-purge, add "dsh-purge": "file:../../plugins/dsh-purge" to the correct profile's dependencies, append "dsh-purge" to dsh.profile.bundles, then run pnpm install inside that profile directory manual install.
Usage and restoration
In the Clean page you can edit the session prompt, manage rule sets, and apply or revert patches. In chat, /purge status, /purge apply, /purge revert, /purge uninstall, and /purge edit expose the same operations; /rules list|use|create|delete|reset manages rule sets, and /rewind removes the last round of sent messages and returns the text to the input. The CLI equivalents include dsh-purge --status, --apply, --revert, --uninstall, and --edit commands.
Before the first apply, each target file is copied to <file>.dshpurge.bak. Restore copies those backups back and deletes them; if no backup exists, only shim lines written by the plugin are stripped. prompt-inject.md is treated as a user file and is kept. Uninstall restores patched files first, then removes the inject file, rule library and the plugin itself. Apply is idempotent restore behavior.
Constraints
- Host compatibility is narrow. Use plugin 1.1.81 or newer for DSH 0.2.1-rc.2, 1.1.40 or newer for 0.2.0-rc.2, and 1.1.39 or older for DSH 0.1.7. DSH 0.2.1-rc.3 and later are unsupported; unmatched patches stay pending or skipped. Web and desktop installs are patched separately, and applying one host's controls to the other does not work supported hosts.
- Local-lab restriction. The open-source build permits attack tasks only against loopback and RFC1918 addresses. DOMAIN suffixes such as
.labor.htbare not trusted; names are resolved and each address checked. A public IP, a domain resolving publicly, a failed lookup, or a hosts entry pointing a lab name at a public address is rejected. Statements in chat do not add exceptions local lab rules. - License and attribution. The code is Apache-2.0, but the maintainers prohibit reselling the original build and require forks and borrowed prompts or ideas to name the source repository attribution.
- No model preferences are changed automatically. Timeout and reasoning settings are user profile edits described in the README, not plugin defaults.
HotRepo's take
The project shows up in HotRepo's JavaScript weekly leaderboard for the week of 2026-11-03 at position 4, with 6,560 Stars added in that period and 17,007 Stars and 3,926 forks in total. Those numbers describe attention in a single weekly snapshot, not a long-term trend or evidence that the patching approach works across DSH versions. The technical value here is much more specific than the star count suggests: the plugin is tightly coupled to DSH release candidates, and the README itself says newer RCs are unsupported. Anyone evaluating it should check the installed DSH version against the compatibility table before applying anything, since the main failure mode is silently skipped patches rather than a clean error.
Written by AI from the project's README, updated . The project's own docs are the source of truth.