DamonKoy/dsh-plugins--packages-dsh-secret-redactor ↗★ 0
dsh-secret-redactor
Sensitive-information redaction for DeepSeek Harness: masks API keys, bearer tokens, JWTs, private keys and configured secrets in every tool result shown to the model, plus a redact_text tool and a redact RPC. · DSH 敏感信息脱敏插件:自动掩码工具输出中的 API key / token / 私钥 / 配置密钥。
AI 분석
核心用途是防止敏感凭证泄露给模型。适合在执行工具或展示历史记录时,需要自动对 API 密钥、私钥等高熵文本进行脱敏的安全敏感型任务。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:DamonKoy/dsh-plugins#fd97e01fb1c26454f27310dd42a6f8d7b66e8e29&path:packages/dsh-secret-redactordsh-secret-redactor
Sensitive-information redaction plugin for DeepSeek Harness. Inspired by Codex 0.147's "redact secrets from displayed commands and replayed conversation history".
English | 中文
What it does
- Auto-redaction of tool results: hooks the
tools/post-executewaterfall and masks API keys, bearer tokens, JWTs, PEM private keys, and generic high-entropy tokens in every text block the model sees — verified live in a real harness session (sk-abc123...becomessk-***). - Environment secret collection: any env var whose name matches
TOKEN / KEY / SECRET / PASSWORD / PASSWD / CREDENTIAL / AUTH / SIGNING(value length >= 8) is collected and masked when it appears in output. - SSH password collection: passwords stored in
~/.dsh/dsh-ssh.jsonare masked (opt-out via config). redact_textmodel tool: mask arbitrary text or JSON before it is logged, persisted, or echoed.redact_secret_statusmodel tool: report rule count and collected secret counts (never the values) to verify the redactor is active.- Package-private RPC (
harness.handle):secret-redactor/redactandsecret-redactor/statusfor client halves and other plugins.
Install
dsh plugin --profile web add link:~/dsh-plugins/packages/dsh-secret-redactor
Restart dsh web. The redactor is active by default.
Config
Optional file ~/.dsh/dsh-secret-redactor.json:
{
"enabled": true,
"mask": "***",
"patterns": ["^custom-\\d{8}$"],
"extraSecrets": ["literal-secret-1"],
"collectEnv": true,
"collectSshPasswords": true
}
| Field | Default | Meaning |
|---|---|---|
enabled | true | Master switch |
mask | "***" | Replacement text for user-supplied secrets/patterns |
patterns | [] | Extra regexes applied with g flag |
extraSecrets | [] | Literal strings to mask (length >= 4) |
collectEnv | true | Collect matching env var values |
collectSshPasswords | true | Collect ~/.dsh/dsh-ssh.json passwords |
Config is re-read on every hook, so edits apply without a restart.
Security notes
- Redaction applies to the model-facing content of tool results (the main leak surface). The durable log still stores the raw canonical result value; full log-level redaction is on the roadmap.
- Collected secrets live only in memory; nothing is persisted or uploaded.
- Counts reported by
redact_secret_statusnever include the values.
License
MIT