darkmagic-ai/dsh-guard ↗★ 0

dsh-guardrail

DSH (DeepSeek Harness) security guard plugin: blocks/asks on dangerous commands & sensitive paths, redacts secrets in tool output, local JSONL audit log + guard_report. DSH 安全护栏插件。

套件
dsh-guardrail
相容性
待驗證
Harness 依賴範圍
>=0.2.1-rc.5
版本
0.1.2
授權
MIT
最近更新
2026年11月5日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:darkmagic-ai/dsh-guard

配置

在网页 Plugins → dsh-guardrail 里改,或者写进 profile 配置。

配置项默认值说明
enabledtrue总开关
dryRunfalse演练模式:只写审计日志,不拦截、不脱敏
announcetrue往系统提示里加一小段护栏说明(约 60 token)
ignoreTools["guard_report"]这些工具不做拦截检查
commandArgKeys内置列表哪些参数名算“命令文本”
pathArgKeys内置列表哪些参数名算“路径”
disabledRules[]要关掉的内置规则 id
rules[]自定义规则:{ id, kind: command|path, pattern, flags="i", action="ask", reason }
allow[]白名单正则,命中的参数不会触发拦截
redact.enabledtrue是否给工具输出打码
redact.modecontentcontent 只改模型看到的文本;value 改规范化后的 value(PTC 场景用)
redact.disabled[]要关掉的内置脱敏规则名
redact.emailsfalse给邮箱打码
redact.chileRutfalse给智利 RUT 打码
redact.extra[]自定义脱敏:{ name, pattern, flags="g", replacement="[REDACTED]" }
audit.enabledtrue写审计日志
audit.dir""日志目录,留空就用 $DSH_HOME/dsh-guard
audit.logAllowedtrue放行的调用也记下来
audit.logArgstrue记录参数预览(先脱敏再截断)
audit.maxArgChars200参数预览最多保留几个字符

没有审批通道时(比如 headless 运行),ask 会退化成拒绝,审计里记为 unavailable。

Configuration

The keys and defaults are the same as in the Chinese table above. The ones you'll use most are dryRun (false), disabledRules ([]), allow ([]), rules ([]), redact.mode ("content"), redact.emails (false), audit.dir ("" → $DSH_HOME/dsh-guard) and audit.maxArgChars (200). Without an approval channel (headless), ask falls back to deny and is logged as unavailable.