PerryLink/dsh-mask6

dsh-mask

PII masking middleware for DeepSeek Harness: regex-detect and replace phones, emails, ID cards, bank cards, keys, and (opt-in) IPs with placeholders before they reach the model, keep the restore table host-side (memory plus a controlled storage domain, never the session log) with the /mask restore command and the exported RestoreStore seam, and expose /mask status and the mask_test tool. Name and address recognition needs an external NER recognizer, which this pure-host form does not bundle: mode "regex+ner" and the person/address entities fail loudly at load. The phone and ID-card detectors match mainland-China formats only.

包名
dsh-mask
版本
0.2.10
许可证
Apache-2.0
最近更新
2026年9月12日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PerryLink/dsh-mask

Configuration

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.

KeyDefaultMeaning
enabledtrueMaster switch; false unregisters the listener, the /mask command, and the mask_test tool
moderegexDetection 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]
registerCommandtrueRegister the /mask command
registerToolstrueRegister the mask_test tool when the tools service is present
persistRestoreTabletruePersist the restore table to the controlled dsh_mask storage domain (false = memory only)
maxRestoreEntriesPerSession500Per-session restore entry cap (oldest evicted first)
maxSessions1000In-memory session cap (least-recently-used evicted, mapping reloaded on demand)
maskClientEnabledfalseFeature 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

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: true