Introduction¶
The plugin ecosystem of DSH emphasizes “everything is a plugin.” Plugins can extend commands, tools, and workspace capabilities, but this also means third-party code enters the local runtime environment. For agent developers, common questions are: Are there malicious calls within plugins? Will prompts be injected? Will unnecessary token consumption occur? Manually reviewing source code, installation scripts, and tool calls is costly, and it is difficult to monitor every dangerous runtime action one by one.
Below, we introduce bigclawd/dsh-security-guard. It integrates pre-installation static scanning and runtime dangerous action interception into a single mechanism and uses block / warn / clean to provide a conclusion.
What is it¶
dsh-security-guard is a DeepSeek Harness security plugin maintained by bigclawd, licensed under the MIT License.
It is positioned as a static scanner and runtime protector: it scans for malicious code, context injection, and token waste within DSH plugins and the workspace, intercepts dangerous runtime tool calls and prompt steps, and exposes the /scan command, plugin_scan tool, a scanning web panel, and user-managed allowlists.
Its key constraint is that the static analysis component performs only static analysis; it does not import, evaluate, or execute the scanned code.
Core Features¶
- Static Scanning: Performs rule analysis on source files; scanned code will not be imported or executed.
- Runtime Observation: Intercepts dangerous tool calls, prompt steps, and file operations before they occur.
- Result Classification: Conclusions are categorized as
block,warn, orcleanand can be written to JSON or human-readable reports. - Rule Extension: Rules are standard JSON and can be overridden by
id. - Install Hook: Automatically scans newly installed plugins via profile-manifest watcher.
- Usage Entry Points:
/scancommand,plugin_scantool, real-time web panel, and user-managed allowlists.
Runtime observation is enabled by default.
Installation¶
Install in the default profile:
dsh plugin --profile default add dsh-security-guard
Enable in Host Application¶
Below is an example configuration for the host application provided by the documentation. It configures the rules directory, scan size limits, runtime interception, allowlist file, web panel path, and install hook polling interval.
ctx.plugin(Guard, {
rulesDir: 'config/guard-rules',
scan: {
maxFiles: 5000,
maxFileSize: 4 * 1024 * 1024,
skipSegments: ['node_modules', '.git', 'dist', 'lib']
},
runtime: {
enabled: true,
blockOnSeverity: ['block'],
maxFindingsPerScan: 200
},
allowlist: {
file: 'data/guard-allowlist.json'
},
web: {
enabled: true,
path: '/scan'
},
installHook: {
enabled: true,
intervalMs: 5000
}
})
This configuration registers the plugin with the host application and specifies the runtime parameters for static scanning, runtime interception, allowlists, and the web panel.
Typical Usage¶
Static Scanning¶
For human-readable reports:
/scan ./plugin-dir
Output machine-readable JSON:
/scan ./plugin-dir --json
Write to a specified report file:
/scan ./plugin-dir --json --out report.json
plugin_scan Tool¶
You can also use the plugin_scan tool with parameters:
target, severity, json, out
Web Panel¶
The web panel is provided by the harness web server under the configured path; the default path is:
/scan
Applicable Scenarios and Notes¶
Suitable for the following scenarios:
- Perform static checks before installing third-party DSH plugins.
- Scan workspace files and output reports.
- Intercept dangerous actions for runtime tool calls and prompt steps.
- Maintain scanning strategies using JSON rules, allowlists, and severity overrides.
Notes to be aware of:
- Plugins will acquire the permissions of the current
dshprocess. Before use, you should check the source code, license, and execution behavior during installation. - It is recommended to scan before installing. Malicious
postinstallscripts run when packages are installed; use/scanto check the target package first, then executedsh plugin add. - False positives may exist. Use allowlists and
ruleSeverityoverrides to handle them. - Obfuscation is an arms race. This plugin is a risk reduction layer, not a security guarantee.
Conclusion¶
The value of dsh-security-guard lies in integrating pre-installation plugin checks, workspace scanning, and runtime dangerous action interception into DSH, providing auditable results using block / warn / clean.
GitHub Repository:
https://github.com/bigclawd/dsh-security-guard
The provided materials do not include a link to a verified community directory page.