Automatic secret redaction in tool results: masks API keys, tokens, JWTs, private keys and configured secrets before the model sees them.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:DamonKoy/dsh-plugins#path:/packages/dsh-secret-redactor
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
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 secrets in every text block the model sees — verified live in a real harness session (sk-abc123...becomessk-***). - 25 built-in rules (see Rule catalog) covering vendor
API keys, PEM private keys, bearer tokens, JWTs, connection-string and URL
passwords,
key = valuepairs, data URIs, and generic high-entropy tokens — engineered to avoid false positives (tool names, file names, git hashes, UUIDs, credential-free URLs and plain long words are never masked). - 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 active rule names and collected secret counts (never the values) to verify the redactor.- Package-private RPC (
harness.handle, sandbox realm only; skipped when loaded via CLI):secret-redactor/redactandsecret-redactor/statusfor client halves and other plugins.
Install
dsh plugin --profile web add github:DamonKoy/dsh-plugins#path:/packages/dsh-secret-redactor
Restart dsh web. The redactor is active by default.
Config
Optional file ~/.dsh/dsh-secret-redactor.json:
{
"enabled": true,
"mask": "***",
"disablePatterns": ["generic-mixed"],
"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 |
disablePatterns |
[] |
Disable built-in rules by name (see catalog) |
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.
Rule catalog
| Rule name | What it masks | Example |
|---|---|---|
sk-openai |
sk- prefixed keys (OpenAI/DeepSeek) |
sk-abc… → sk-*** |
gh-tokens |
GitHub tokens | ghp_… → gh*** |
aws-akid |
AWS access key ids | AKIA… → AKIA*** |
slack |
Slack tokens | xoxb-… → xox*** |
google-api |
Google API keys | AIza… → AIza*** |
huggingface |
HF tokens | hf_… → hf*** |
gitlab |
GitLab PATs | glpat-… → glpat-*** |
bitbucket |
Bitbucket tokens | ATBB… → ATBB*** |
aliyun |
Alibaba Cloud AK | LTAI… → LTAI*** |
tencent |
Tencent Cloud AK | AKID… → AKID*** |
stripe |
Stripe keys | sk_live_… → sk_*** |
npm |
npm tokens | npm_… → npm*** |
telegram |
Telegram bot tokens | 123456:AA… → 1234567890*** |
sendgrid |
SendGrid API keys | SG.… → SG.*** |
digitalocean |
DO PATs | dop_v1_… → dop_v1*** |
shopify |
Shopify tokens | shpat_… → shpat_*** |
pem-private-key |
PEM private key blocks (RSA/EC/OpenSSH/PGP/encrypted) | whole block |
bearer |
Bearer <token> headers |
Bearer *** |
jwt |
JWTs | ***JWT*** |
data-uri |
base64 payloads of data:…;base64,… URIs |
data:image/png;base64,*** |
url-credentials |
scheme://user:password@ credentials |
mongodb://***@host |
key-value |
apiKey/password/secret/token-style pairs (quoted or not) |
"password": "***" |
hex-mixed |
32+ hex with mixed case + digits | *** |
base64-mixed |
64+ base64-looking text, mixed case + digits | *** |
generic-mixed |
40+ identifier-shaped text, mixed case + digits | *** |
False-positive protection is baked into the generic rules: plain tool names
(hindsight_search_knowledge_pages), lowercase-only words (even 45 chars),
git commit hashes, UUIDs, https://user@host URLs, git SSH URLs and git@…
forms are never masked. Run node --test test/ for the 13-case bidirectional
suite (positives and negatives).
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
Links
More in this category
superdesigndev/treg★ 428
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
Lum1104/dsh-browser★ 216
Chrome sidebar extension that lets DSH operate your browser directly, no vision capabilities required.
zhaoolee/notes★ 142
Export DSH conversations as Smartisan Notes-style PNGs, or create and update Markdown notes in a configured account-scoped workspace.
liustack/modsearch★ 115
Web search bridge for text-only agents: ask the web or X, get structured JSON evidence (search, fetch, citations).
taxueseek/argo★ 94
Search built for agents: multilingual coverage across web, academic, code, shopping, finance, news, and encyclopedias.
Vladimir-Human/ru-marketplace-mcp#dsh★ 64
Skills and optional MCP rows for ten Russian marketplaces: price comparison across Wildberries, Detsky Mir and Yandex Market, plus per-source search, product cards and reviews. The 13 skills load on install; both MCP rows stay disabled until RU_MARKETPLACE_MCP_DIR points at a local clone, which needs Python 3.12+ and uv.