dsh-plugin-guardkit: Runtime Monitoring and Risk Scoring for DSH Plugins

Introduction

It is convenient to install third-party plugins in DeepSeek Harness (DSH), but the challenge lies in answering a post-installation question: what exactly are these plugins doing in the process, and how significant is the risk? Static inventories (scanning package.json during installation) often diverge from the actual topology on Cordis—entries may be stuck in loading, overridden, or accompanied by install scripts and remote injection declarations.

dsh-plugin-guardkit (referred to as Plugin Guardian in the README) targets the “runtime posture of installed plugins”: the Host side reads pluginManager and the package.json of each bundle, displaying health status, findings, timeline, and one-click containment operations in the Plugins → Monitor panel. Below, the usage is explained by positioning, capabilities, installation, and configuration.

What is this

Item Description
npm Package Name dsh-plugin-guardkit
Maintainer karla-zhang
Category admin-security (Community Directory)
Version 0.1.2 (MIT)
Runtime Requirements Node >=22

In short: monitors installed DSH plugins under the current profile, scores runtime risks, and enables/disables individual Cordis entries or entire bundles within the same panel.

Panel data is derived from the Host’s real-time Cordis topology, rather than a static list scraped at build time.

What can be seen in the panel

The README divides the interface into several sections, corresponding to different granularities of information:

  1. Health bar: Overall risk score/level, count of plugins by fiber phase, number of bundles, snapshot freshness.
  2. Top findings: All triggered findings, sorted by severity from critical to info, with subject and evidence.
  3. Bundle cards: Installation source (third-party/official), version, license, repository, install scripts, declared bin, client/typert injection, overrides, version exemptions, etc.
  4. Runtime table: Each Cordis entry: module, belonging bundle, enabled/disabled, fiber phase, state transition, recent changes, diagnostic info.
  5. Timeline: Phase changes, enable/disable, version and availability changes, guardian operation logs.
  6. Actions: Enable/disable single plugin entry or entire bundle (one-click containment).

Client-side copy switches between Chinese and English based on the UI language; styles use --dsw-alias-* theme tokens.

Risk Model

Each finding has a severity level; the plugin’s total score is the sum of the weights of its findings, with a maximum of 100:

critical 40 · high 20 · medium 8 · low 3 · info 0

Level classification: ≥ 40 is high, ≥ 10 is watch, otherwise safe.

The finding types listed in the README include: failed/uninstalling/stuck entries, read-only entries, disabled entries, third-party bundles, missing or erroneous bundles, patch overrides, DSH version exemptions, install scripts (preinstall/install/postinstall/prepare), declared bin, client-bundle or typert remote injection, missing licenses, local/git installation sources, and stale monitoring data.

Data Flow and Interfaces

The Host side collects data from the pluginManager service (listPlugins, listBundles, listVersionExemptions), reads the package.json of each installed package from the profile, diffs the inventory on every refresh to generate the timeline, and serves it via same-origin read-only JSON routes:

GET  /plugin-guardian/api/snapshot
POST /plugin-guardian/api/action   # body: { action, entryId?, name? }

The browser side registers React components in the Plugins page tab (plugins.tab) and, when on that page, the Settings → Plugins tab (settings.plugins.tab): it polls for the snapshot, renders the panel, and performs POST actions.

Route security: responses include no-store; cross-site requests are rejected by comparing Origin with Host; the action body is limited to 64 KiB and validated.

Installation and Enablement

You can install from the plugin market in the DSH desktop app under Settings → Plugins, or install a local directory and restart. When installing via the terminal, you must use the real profile name (usually desktop for the desktop version):

dsh plugin --profile desktop add dsh-plugin-guardkit                       # from npm
dsh plugin --profile desktop add github:karla-zhang/dsh-plugin-guardkit   # straight from GitHub
dsh plugin --profile desktop add /path/to/plugin-guardian                 # local directory

Adding a new bundle changes the Host splash screen; you must restart DSH after installation.

Uninstall:

dsh plugin --profile desktop remove dsh-plugin-guardkit

You can also uninstall it from the Settings → Plugins page.

Configuration

Optional configurations are written under the plugin-guardian line in the profile’s Cordis patch:

- id: plugin-guardian
  name: dsh-plugin-guardkit
  config:
    refreshMs: 12000   # 3000..120000
    audit: true        # write snapshot.json / timeline.ndjson / route-hits.ndjson
    auditDir: null     # defaults to <DSH_HOME>/plugin-guardian
    trusted: []        # extra Origins allowed to call the action route
    maxTimeline: 100   # timeline ring size

When audit is enabled, the default directory is <DSH_HOME>/plugin-guardian/, and it writes:

  • snapshot.json: most recent snapshot, convenient for offline viewing
  • timeline.ndjson: append-only event log, one JSON object per line
  • route-hits.ndjson: last 20 API requests (method, path, status, time)

Typical Usage

  1. After installing the plugin and restarting DSH, open Plugins → Monitor (or the corresponding Plugins tab under Settings).
  2. Check the Health bar and Top findings to identify high-risk bundles or entries.
  3. In Bundle cards, verify the installation source, install scripts, bin, and injection declarations; in the Runtime table, compare fiber phases and diagnostics.
  4. When containment is needed temporarily, execute disable on a single entry or the entire bundle in Actions; if the Host reports that a restart is required to take effect, follow the prompt rather than assuming it has already taken effect.
  5. If compliance or post-event auditing is needed, set audit: true and regularly check timeline.ndjson and snapshot.json.

When a fetch fails, the panel displays an error bar and retains the previous frame’s snapshot; it will not crash the entire page.

Suitable Scenarios and Notes

Who is it for: Developers or administrators maintaining a large number of community plugins on DSH; those who need to compare the Cordis runtime against package.json declarations and make containment decisions based on risk scores.

Permissions and Trust: The plugin runs at the same level as the current DSH process and can enable/disable other plugins via pluginManager. Before installation, you should read the source code and MIT license on the GitHub repository to determine for yourself whether to include it in the profile.

Behavioral Boundaries (README Notes):

  • Read-only entries (management-required, unaddressable) are reported and do not default to a healthy status; attempts to switch them return the explanation provided by the Host.
  • Containment is handled via the Host’s pluginManager API; changes requiring a restart will be clearly prompted.

Ecosystem Notes: DSH operates on the philosophy that “everything is a plugin”; the community plugin directory (such as SkillHub) is an independent site with no official affiliation to DeepSeek or Hypothesis. This plugin can also be installed from npm (dsh-plugin-guardkit) or GitHub; star counts and category information are based on the directory page.

Conclusion

dsh-plugin-guardkit translates “what third-party plugins are doing” into pollable snapshots, quantifiable risk scores, and actionable containment entry points, binding the data chain to live Cordis rather than a static inventory. For more information or to raise an issue, visit:

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

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

Xiaoye