D
dsh-safeguard
v0.1.1 · 3 天前发布
面向 DeepSeek Harness(DSH)的危险命令 + 密钥泄漏拦截插件。挂载到 `tools/pre-execute` waterfall,在工具解析前短路拒绝,被拦截的副作用不会发生。
README
dsh-safeguard
面向 DeepSeek Harness(DSH)的危险命令 + 密钥泄漏拦截插件。挂载到 tools/pre-execute waterfall,在工具解析前短路拒绝,被拦截的副作用不会发生。
简介
bash 工具的命令做正则匹配,命中即 deny。JSON.stringify 后扫描常见密钥模式,命中即 deny。guard_list(列出当前规则)与 guard_check(纯检查不拦截,供调试/自检)。重要:本插件是基于正则的启发式拦截,不验签、不识别密钥真伪、不做沙箱隔离。它无法替代密钥扫描器、签名校验或操作系统级沙箱,只能拦截明显的高风险动作。
安装
sh
dsh plugin --profile <profile> add dsh-safeguard
本地开发安装:
sh
dsh plugin --profile <profile> add file:./plugins/dsh-safeguard
默认规则表
危险命令(enableDanger)
| 规则名 | 匹配内容 |
|---|---|
| rm -rf | rm -rf / rm -fr 且目标是 /、*、./、../、., ~、$HOME |
| git push --force | git push --force / --force-with-lease / -f |
| git reset --hard |
版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ✅ 兼容 | cordis patch ✅ |
dsh@0.1.0 | ✅ 兼容 | 标准 patch ✅ |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- dsh-safeguard
- Repo
- —
- Engines
{}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"}}