dsh-secret-guard
A DeepSeek Harness (dsh) security plugin: blocks agents from reading or writing sensitive files (.env, credentials, key material), masks leaked secret-shaped values in tool results, keeps an audit journal, and exposes safe inspection tools that never print raw values.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JohnXu22786/secret-guard说明文档
阅读完整 README ↗Configuration
Configuration lives under the config key of the plugin line in cordis.patch.yml, or can be overridden via the profile's cordis.patch.yml patch:
- insert:
- id: secret-guard
name: 'dsh-secret-guard'
config:
# custom rules (evaluated before the default rules; first match wins)
rules:
- id: my-prod-creds
match: '**/prod-secrets.yml'
effect: block # block | block-read | block-write | allow
reason: 'production credentials, no access'
# allowlist (checked before any rules; also supports globs)
allow:
- 'tests/fixtures/.env'
- '**/sandbox.env'
# tools participating in interception (file-type tools whose args contain file_path / path; includes read_image by default)
gateTools: [read, write, edit, glob, grep, read_image]
# also intercept grep whose pattern hits sensitive keywords (env/credential/password…)
guardSearchPatterns: true
# content-masking fallback for results
maskResults: true
# seal key (HMAC): environment variable first, then a local file (auto-created, 0600)
sealKey:
env: SECRET_GUARD_SEAL_KEY
path: .secret-guard/seal.key
# audit journal
audit:
enabled: true
dir: .secret-guard/logs
maxBytes: 1048576 # rotate when a single file exceeds this
keep: 5 # number of rotation files to keep
# external rule file (JSON, hot-reloadable): { "rules": [...], "allow": [...] }
rulesFile: .secret-guard/rules.json
watchRules: true # automatic polling hot-reload (~400ms interval)
Relative paths (sealKey.path, audit.dir, rulesFile) resolve against dsh's startup working directory.