dsh-prompt-drift: Drift Gatekeeping for DSH-Assembled System Prompts

Introduction

In DeepSeek Harness (DSH), multiple plugins or presets contribute sections to the final assembled system prompt. When upgrading a plugin, what the model is “told” might be silently altered; malicious plugins could even write text like “ignore all safety rules” directly into the prompt. Among existing capabilities, dsh-mcp-test focuses on constraining which tools the model can call; prompt-injection plugins targeting “inbound content streams” do not equate to monitoring the assembled prompt itself—a channel where every plugin can write, yet few perform a section-by-section diff.

Below is an introduction to the community plugin dsh-prompt-drift (maintainer: zhengqiuyang, category: admin-security): It generates a name → sha256(text) fingerprint for each section on the system-prompt/assemble pipeline, establishes a baseline, and compares additions, deletions, and modifications during subsequent assemblies, exposing silent rewrites as warnings. It does not call an LLM on the trust path.

What is this

dsh-prompt-drift is a system prompt surface drift gatekeeper for DeepSeek Harness: It solidifies a baseline by hashing sections contributed by various plugins. If any section is added, deleted, or rewritten during any subsequent assembly, it triggers a diff and warning (duplicate drifts of the same kind are deduplicated by signature to avoid spam).

Repository: https://github.com/zhengqiuyang/dsh-prompt-drift
Directory Page: https://www.skillhub.cn/plugins/zhengqiuyang/dsh-prompt-drift

The current package version is 0.1.0, licensed under MIT. SkillHub is an independent community directory and has no official affiliation with DeepSeek / High-Flyer.

Core Features

Hook Point and Data Flow

The plugin hooks into system-prompt/assemble. The flow can be summarized as:

system-prompt/assemble ──> sections [{name, sha256(text)}] name-sorted
                     ──> baseline absent? freeze it (commit the file)
                     ──> diff: added / removed / changed sections
                     ──> warn once per distinct drift (signature dedup)
  1. Each assembly yields a section list sorted by name, recording the section name and the sha256 of the body text for each entry.
  2. If the baseline does not exist, the current surface is frozen and written to a file (this should be纳入 version control subsequently as a contract).
  3. If the baseline exists, it compares added, deleted, and content-changed sections, and issues a warning once for each drift signature that has not been warned about before.

Baseline and Dynamic Sections

  • The baseline is a stable, name-sorted JSON file. The default path is defined by the baselinePath config option.
  • Sections that vary with the working directory, timestamps, etc., can be excluded via ignoreSections to prevent false positives.

Relationship with Adjacent Capabilities

The README explains: A similar tool, dsh-modelprint (also 0★), fingerprints the model config, not the prompt surface; this plugin specifically watches the assembled prompt itself.

Installation and Activation

Official installation command (from the README, using --profile default):

dsh plugin --profile default add github:zhengqiuyang/dsh-prompt-drift

The repository includes pre-built lib/ files, so no build step is required when installing via dsh plugin add, nor is allowBuilds authorization needed.

Compatibility (from source materials):

  • DSH: Verified on the 0.2.x line (source snapshot 0.2.1-alpha.2); installable via dsh plugin add on any profile.
  • Node: >= 20 (CI matrix includes Node 20/22/24 on Ubuntu and Windows).

Once enabled, a message like [dsh-prompt-drift] active: … will appear in the startup logs (as described in the disposable-profile verification notes).

Configuration

Add an entry to the DSH plugin configuration. Fields are based on the README:

- id: dsh-prompt-drift
  name: dsh-prompt-drift
  config:
    baselinePath: .dsh-prompt-drift/baseline.json
    rebaselineOnDrift: false
    ignoreSections: []

Descriptions:

  • baselinePath: The storage path for the baseline JSON; on the first run with no baseline, the current surface will be frozen at this path.
  • rebaselineOnDrift: Defaults to false; whether to automatically re-baseline upon detecting drift is a decision to be made based on team policy (if the materials do not elaborate on automatic re-baseline behavior, refer to subsequent repository documentation).
  • ignoreSections: A list of section names excluded from hash comparison, used for dynamic segments like cwd or timestamps.

Typical workflow: Run the assembly successfully on the local machine or CI for the first time → Commit the generated .dsh-prompt-drift/baseline.json to the repository → If subsequent plugin upgrades or preset changes alter the prompt surface, warnings will be issued during the diff phase, facilitating human review before deciding whether to update the baseline.

Use Cases and Precautions

Who is it for

  • Teams stacking multiple plugins and presets on DSH who wish to audit “whether the model’s system instruction surface is being silently rewritten” in a supply-chain style.
  • Developers who need to treat the section set of the assembled system prompt as a reviewable, versionable contract, rather than a black box assembled at every startup.

Important Notes

  • The plugin runs with the current dsh process privileges; before installation, please read the GitHub source code and the MIT license to ensure compliance with your security and compliance requirements.
  • This plugin does not replace MCP tool-side protections (such as dsh-mcp-test), nor does it replace injection scanning for user input streams; it only covers the assembled system prompt section set.
  • End-of-life condition provided by the maintainer: If DSH officially provides first-party prompt-surface pinning in the future, this plugin will freeze at its last available version and leave a postmortem explanation in this repository.

Local development and self-testing (maintainer documentation):

npm install && npm test

Conclusion

dsh-prompt-drift transforms the most easily overlooked channel in DSH—the assembled system prompt—into a surface that is hashable, baselineable, and diffable; if a plugin or preset upgrade silently changes what the model is told, it will fail loud rather than silent drift. If you are using DSH for multi-plugin combinations, it is worth incorporating the baseline into code review and CI.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye