Skip to content
Luca Tariciotti.

How to Use dsh-purge for Red-Teaming Every DeepSeek Model

Luca Tariciotti 3 min read

Guide on using dsh-purge for local DeepSeek red-team testing

dsh-purge is a red-team plugin for the DeepSeek Harness. It helps you see which default policy is too tight and apply patches on your local machine.

If you want to test every model in the DeepSeek Harness, you’ve likely hit a wall. The default policy is too restrictive, or you need to swap prompts per model. dsh-purge solves both problems. It’s a red-team plugin that lives on your local Harness, not a public scanner. You can use it to see which default policy is too tight, apply and revert patches, and manage prompt injection on your own machine.

This article walks you through what dsh-purge is, how it works, how to install it, and where it fits in your security evaluation workflow. You’ll also learn who it’s for and how to avoid common mistakes. The project is open-source, so you can build on it if you want.

What dsh-purge Is

dsh-purge is a cybersecurity red-team plugin for the official DeepSeek Harness. It works alongside the Harness you already have installed. The plugin lets you apply patches, manage prompt injection, and switch between different default policies. You don’t need to touch the official Harness source tree.

How It Works

The plugin separates two layers of control. Harness rewrites prompts, approval gates, sandbox policy, and session migration at runtime. dsh-purge separates those two layers on your own install. You can see which default policy is too tight, and you can apply, inject, revert, and uninstall patches in your own files.

Key Features

  • Clean page: Grouped patch status, Apply / Restore / Uninstall, prompt editor, multiple rule sets
  • Drill page: Built into the stable release. After authorization, assets and the local environment. Local lab only
  • Host policy: Default copy, permission policy, and tool limits. Official capabilities stay. No second invented identity
  • On start: Checks and reapplies. After npm overwrites node_modules, you do not hand-edit files

Installation and Setup

To get started, you need the Harness installed. dsh-purge works with the official Web (dsh web) and the official desktop EXE. Install and apply them separately.

Installing dsh-purge

  1. Clone the repository to your local machine.
  2. Run npm install in the project directory.
  3. Apply the plugin to the Harness you have installed.

Local Home Path

The plugin looks at $DSH_HOME, .dsh next to the dsh launcher, then ~/.dsh. It does not patch the Harness source tree. Apply on the Clean page of dsh-purge is what writes the changes.

Who Needs This Tool

dsh-purge is for anyone who wants to run red-team evaluations on the official Harness. It’s not a public scanner. The target is the user's own official local software, not someone else's website or server. You can use it on authorized local official Harness, offline local synthetic fixtures, authorized cybersecurity ranges, and compliant lab environments.

Common Mistakes to Avoid

  • Don’t run dsh-purge against the public internet. It only evaluates local Harness.
  • Don’t forget to check for updates. The plugin may only contact its own GitHub repository to compare versions.
  • Keep your default policy tight. Unmarked timeouts and other custom values are preserved; an unmarked 10-minute value cannot reliably be distinguished from a user setting.

FAQ

When should I use dsh-purge over the official Harness?

Use it when you need to apply custom patches, manage prompt injection, or see which default policy is too tight. The Harness itself handles forwarding prompts, approval gates, sandbox policy, and session migration.

How do I revert a patch?

Open the Clean page in dsh-purge. Use the Restore option to revert a previously applied patch. You don’t need to hand-edit files.

Can I use dsh-purge on a public website?

No. It works on the official Harness installed on your machine. It does not scan, probe, intrude, or send attack traffic to any public host.

Conclusion

dsh-purge is a practical tool for red-team researchers who want to evaluate every model in the DeepSeek Harness. It keeps you in control of your local policy, allows you to swap prompts per model, and gives you clear visibility into which default policy is too restrictive. If you follow the installation steps and avoid running it against the public internet, you’ll get the results you need.