xiayuhkust/dsh-shell-kit--packages-secret-guard ↗★ 0
dsh-plugin-secret-guard
Blocks model-facing tools from reading secret and PII files (.env, keys, credentials) in DeepSeek Harness. Deny with reason via the tools/pre-execute waterfall.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-plugin-secret-guard
阻止 DeepSeek Harness 的模型侧工具读取敏感文件(.env、私钥、credentials、含密码的文本等)。命中即在 tools/pre-execute 上带理由拒绝,模型收到拒绝原因而非静默失败。
agent 对工作区有完整读权限,默认是否读取密钥文件全凭模型自觉。本插件把这条纪律变为强制执行。
安装
dsh plugin --profile web add -w dsh-plugin-secret-guard
在 profile 的 cordis.patch.yml 挂载(用 - insert: 插入新行,不是裸 - id:):
- insert:
- id: secret-guard
name: dsh-plugin-secret-guard
重启 dsh web 生效。dsh --profile web --dump-config 可确认插件行已在。
配置(可选)
- insert:
- id: secret-guard
name: dsh-plugin-secret-guard
config:
extraPatterns: ['server.txt', '*.token'] # 在默认规则上追加
# patterns: [...] # 整体替换默认规则
默认规则见 src/index.mjs 的 DEFAULT_PATTERNS(.env / 私钥 / credentials / *.token 等)。匹配按文件名通配(*),大小写不敏感。
覆盖范围
read/read_image/edit/write:检查file_pathglob/grep:检查path与patternpwsh/bash:检查命令文本里的字面敏感文件名
不覆盖脚本正文内的间接读取(如 python open())——拦截面与实用性的取舍,不做内容级检测。
License
MIT