helmd
ADWMC/helm-d单包逆向与渗透测试安全分析插件:首轮工具收敛、领域路由与 33 个工具,覆盖 APK、Web、原生二进制、协议、恶意样本与 LLM 场景的逆向分析、加壳脱壳与 License 破解绕过;内置 H-CoT 评估引擎(语义路由、/hcot 命令)、账本驱动的 Web 工作台与工具货架、磁盘案件工作区(证据链自动存证、E 编号结论校验、上下文压缩后恢复)、GitHub 工具检索与 361 篇按需参考文档。
DeepSeek Harness 的 PII 脱敏:请求前匿名化姓名、电话、邮箱、证件与密钥,展示层还原,明文不进入会话日志。
npm i -g dsh1024 once, then dsh1024 plugin --profile web add dsh-mask (counts toward the deepseek1024.com install ranking).PII masking middleware for DeepSeek Harness — anonymize personal data before it reaches the model, keep it reversible host-side.
*Phones, emails, ID cards, bank cards, keys, and more become placeholders at the model boundary; the plaintext never enters your session log.*
English · 简体中文 · Español · Português · हिन्दी
dsh plugin --profile <name> add dsh-mask📖 Ecosystem knowledge base — measured data, not marketing: plugin development guide · plugin-selection data · maintenance criteria.
main): dsh plugin --profile web add github:PerryLink/dsh-mask (equivalent to installing from git+https://github.com/PerryLink/dsh-mask.git). No build step — index.mjs and lib/ are the shipped artifacts.dsh plugin --profile web add dsh-mask.pnpm pack in this repo, then dsh plugin --profile web add ./dsh-mask-.tgz.dsh plugin --profile web remove dsh-mask (or remove the row from the profile patch).dsh-mask no longer bundles the storage stack. Profiles that already compose it (the web profile does, via @deepseek-ai/dsh-web-app) provide storageDomain, so persistence works out of the box. On a bare profile without storage the plugin still mounts and masks, but the restore table is memory-only (lost on restart) — compose the storage stack in your profile patch, or set persistRestoreTable: false.
这个插件是 DSH 插件家族的一员(95 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
*English:* part of a 95 plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.
PII masking middleware for DeepSeek Harness — anonymize personal data before it reaches the model, keep it reversible host-side.
Phones, emails, ID cards, bank cards, keys, and more become placeholders at the model boundary; the plaintext never enters your session log.
*Workflow overview: call → plugin → result. The examples below use the real command surface.*
108 synthetic samples (60 positive, 48 negative) · from benchmark/RESULTS.md
Surface · Status Harness · DeepSeek Harness dsh-v0.2.1-alpha.1 (adapted 2026-09-18): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-18 against the dsh-v0.1.7-alpha.1 master checkout (full gate chain + profile install smoke). Node · ^22.19.0 \ · \ · >=24.0.0 Platforms · Anywhere DSH runs (pure host, zero-dependency regex; no browser half) Model · Text models fully supported; no extra model capability required
dsh-mask anonymizes personal data at the model boundary — before a message reaches the model — and keeps a restore table host-side so placeholders stay reversible:
agent/pre-step messages are rewritten so phones, emails, ID cards, bank cards, and keys (on by default) and IPs (opt-in) become ``-style placeholders. The masked text is what gets logged and sent to the model.placeholder → original map lives only in memory and a controlled storage domain (dsh_mask); the plaintext never enters the session log.mask/applied session event records only "replaced N values + type distribution", never the original text or the mapping.status (counts + distribution), on/off (runtime toggle), restore (unmap placeholders and deliver the plaintext as a file, never as logged text), help.user message ──agent/pre-step──▶ placeholders ──model──▶ placeholders ──restore──▶ controlled file
▲ │
└──────── restore table (memory + dsh_mask) ───────────┘dsh plugin --profile web add github:PerryLink/dsh-mask# 1. install the bundle into your profile
dsh plugin --profile web add github:PerryLink/dsh-mask
# or from npm (published releases)
dsh plugin --profile web add dsh-mask
# 2. verify the row mounts
dsh --profile web --dump-config | grep -A2 'id: mask'Then tailor the entity list in your profile patch:
- insert:
- id: mask
name: dsh-mask
config:
entities: [phone, email, id-card, bank-card, key]> /mask status
> /mask restore <PHONE_1>
mask: restored 1 placeholder(s): <PHONE_1>
file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)These are the plugin's real entry points; install once, then call one.
Command
~~~sh mask_test ~~~
Input
~~~json {"text":"电话 13812345678"} ~~~
Output
~~~text mask_test: replaced 1 PII value(s) (PHONE=1) masked: 电话 ~~~
*Observed from plugins/dsh-mask/index.mjs:243-250; test/index.test.mjs:306-315*
Input
~~~text /mask restore with restoreDir=/tmp/dsh-mask-probe-not-a-dir (a regular file) ~~~
Output
~~~text mask: restore failed: EEXIST: file already exists, mkdir '/tmp/dsh-mask-probe-not-a-dir' ~~~
*Observed from plugins/dsh-mask/index.mjs:501-506; plugins/dsh-mask/lib/deliver.mjs:89-97; plugins/dsh-mask/test/index.test.mjs:278-290*
mask_test/mask restore All tunables are Schemastery Config fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. cordis.patch.yml documents each key inline.
Key · Default · Meaning enabled · true · Master switch; false unregisters the listener, the /mask command, and the mask_test tool mode · regex · Detection mode; only regex is implemented (regex+ner for name/address recognition is reserved and fails loud) entities · [phone, email, id-card, bank-card, key] · Which PII types to mask; ip is also regex-capable (opt-in), person/address require NER scope · [messages] · Masking surface(s); messages masks agent/pre-step messages, tools masks tool-result text on tools/post-execute. Accepts a string or an array, e.g. [messages, tools] registerCommand · true · Register the /mask command registerTools · true · Register the mask_test tool when the tools service is present persistRestoreTable · true · Persist the restore table to the controlled dsh_mask storage domain (false = memory only) maxRestoreEntriesPerSession · 500 · Per-session restore entry cap (oldest evicted first) maxSessions · 1000 · In-memory session cap (least-recently-used evicted, mapping reloaded on demand) maskClientEnabled · false · Feature flag for the browser half "reveal" bubble (defensive; off by default until the live slot catalog verifies the target slot). The key is schema-declared and validated, but no runtime code reads it yet, so it changes nothing until the browser half ships restoreDir · '' · Where /mask restore delivers the restored plaintext. Empty = os.tmpdir()/dsh-mask-restore; a relative value resolves against the host process working directory. The directory is created 0700 and the file written 0600, one file per session
Example override in your profile patch:
- insert:
- id: mask
name: dsh-mask
config:
entities: [phone, email, id-card, bank-card, key, ip]
persistRestoreTable: false
registerCommand: trueSurface · Reveals plaintext · Notes agent/pre-step masking · never · Rewrites messages to placeholders before they are logged or sent to the model tools/post-execute masking · never · Rewrites tool-result text blocks to placeholders before they are logged or fed back to the model (scope: tools) /mask status · never · Enabled state, total replaced, type distribution /mask on / /mask off · never · Runtime toggle (resets to config.enabled on restart) /mask restore · yes (explicit) · Unmaps placeholders back to the values stored for this session and writes them to a controlled file (one per session, mode 0600); the result text and the session log carry only that path and the placeholder names mask_test · never · Masks a snippet and reports the placeholder result + counts
dsh-mask performs no network requests and stores no credentials; it reads the session at the agent/pre-step boundary, writes its own dsh_mask storage domain, and writes the /mask restore delivery file (the manifest declares filesystem:write for exactly that). The dshWorkshop manifest also declares network:none and credentials:none.placeholder → original restore table lives in memory and, when persistRestoreTable: true, in the controlled dsh_mask storage domain — it is never written to the session log. The only other plaintext copy is the delivery file an explicit /mask restore writes under restoreDir (mode 0600, one file per session, overwritten by the next restore); nothing writes plaintext to disk implicitly.mask/applied is declared in types.d.ts and appended only when the host records the type (see Known limitations). Its payload is counts + type distribution only./mask restore writes the plaintext to a controlled file and returns only its path.lib/sanitize.mjs redacts PII, secrets, and URL credentials before any text reaches the model or the log; mask_test, /mask status, and every /mask error path never echo originals./mask restore is the single explicit reveal surface, and it only reads the mapping for the active session. Failure fails closed: if the delivery file cannot be written, the command reports an error and never falls back to echoing the plaintext.mode (regex+ner), unknown scope values, NER-only entities, and out-of-bounds numbers all fail loudly at load.person) and address (address) recognition needs an external NER recognizer, which the pure-host zero-dependency form does not bundle; mode: regex+ner and those entities fail loudly at load. The PII types covered out of the box are phone, email, ID card, bank card, key, and (opt-in) IP.phone and id-card detectors match mainland-China formats only: phone is 1[3-9] followed by nine digits, and id-card is an 18-character Chinese resident ID (17 digits plus a digit or X). Phone numbers and national identifiers from other countries are not detected. email, ip, and key are region-agnostic; bank-card accepts any 16-19 digit run at a lower confidence score.RestoreStore seam (its methods take a session id), so a future client half would reach them through a host remote rather than directly; today the unmasking surface is the /mask restore command, which delivers the plaintext as a file because a command result is logged verbatim (see Security boundaries), and the maskClientEnabled key is validated but read by no runtime code yet.{placeholder: original} map with no per-message index, so that message has to be located in the session event log; and the host deprecated Session.snapshotEvents() / eventAt() / ownEvents() with an explicit "new calls are prohibited", leaving an incremental projection as the only sanctioned route — which this plugin's declared host corridor (>=0.1.2-rc.1) cannot rely on. Placeholders keep working one at a time instead: /mask restore .mask/*; its Session.append also cannot stamp the ignorable envelope, so the session-log audit appends are skipped and sessions keep loading. The gate is not silent about it: the first refusal per session logs one visible warning naming the skipped type and this documented limitation. The plugin enables the append automatically once a host records the type or supports the ignorable envelope.pnpm install # node ^22.19 || >=24
pnpm run typecheck && pnpm run typecheck:ci # two rulers: checkout face (guarded; unverifiable without the checkout) + published-line face
pnpm test # node --test
pnpm run verify:self-contained # dependency specs resolve from the registry
pnpm run verify:artifacts # shipped files present + index.mjs importable
pnpm run check:readmes # five-language README consistency
pnpm pack # the published tarballThere is no build step: pure ESM, index.mjs and lib/ are the shipped artifacts.
The PII benchmark (per-type P/R/F1 over 108 synthetic samples) is published in benchmark/RESULTS.md; regenerate it with node benchmark/run.mjs (no build step, zero new dependencies).
Verified against DSH `0.2.0-rc.2` (the runtime this README ships for) and the high-star plugin set surveyed on 2026-10-05.
This plugin does not interfere with other plugins, including the widely installed high-star ones:
shadows-shipped-ui seat.webServer prefix.inserts its own row; it never overrides a built-in row's config.process.env, or replace the global fetch dispatcher.Shared event listeners are non-interfering by construction. It observes the ordering-sensitive events agent/pre-step, tools/post-execute with ctx.on() — Cordis's broadcast registration, where every listener runs and none can starve another. Every listener here delegates through `next()`, so the chain is never short-circuited, and a mutation is applied to the value next() produced rather than returned in its place:
agent/pre-step — also used by dsh-routing-suite (7000★, 7 listeners), modlens (4122★), dsh-purge (3317★), dsh-agent-teams (1923★), dsh-context (1849★).tools/post-execute — also used by cc-safety-net (1576★).Static evidence: dsh-plugin-doctor K10–K13 report pass for every check on this repository.
dsh, dsh-plugin, deepseek-harness, deepseek, cordis, pii, mask, privacy, anonymization, security
agent/pre-step masking seam, the restore table, the /mask command and mask_test tool, and the five-language docs.This project is part of the DeepSeek Harness plugin family from PerryLink. The roster stays collapsed below so every README keeps a short first screen; expand it to see every row and its status.