证据快照复核于 2026-09-10GitHub 数据核对日期: 2026-08-21
证据已验证Plugin Bundle安全与治理Web Profile

dsh-mask

在 DeepSeek Harness 将文本发送给模型前,把选定的 PII 替换为占位符。

快速了解

它能做什么

在 DeepSeek Harness 将文本发送给模型前,把选定的 PII 替换为占位符。

本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。

使用场景
安全与治理安全配置会话管理
适配技术
deepseek-harnesscordis
兼容性

Web Profile
DeepSeek Harness 0.1.2-rc.1 or 0.1.5-rc.1 (declared)

可信度与状态

证据已验证
核对日期 2026/9/10 UTC 14:05

有代码证据的贡献

它为 DSH 增加什么

PII 脱敏控制

提供 `/mask` 控制命令和 `mask_test` 工具,用占位符脱敏,并可在当前会话中显式还原。

机制证据

选择前先看

dsh-mask 是一个 DeepSeek Harness/Cordis 插件:它会在模型边界把已配置的手机号、邮箱、身份证号、银行卡号、密钥以及可选 IP 替换为占位符。它提供 `/mask` 状态、开关和显式还原命令,以及 `mask_test` 工具;随附补丁默认启用消息脱敏和还原表持久化。

适合谁

需要让常见敏感标识符不进入模型可见消息和会话日志、同时保留受控还原能力的 DeepSeek Harness 管理员与使用者。

常见任务

  • 在消息提交给模型前脱敏手机号、邮箱、身份证号、银行卡号和密钥。
  • 可选地在工具结果被记录或返回给模型前进行脱敏。
  • 通过 `/mask` 查看替换统计、在当前运行中开关脱敏,或显式还原当前会话中的占位符。

权限与数据

它会在脱敏边界处理会话文本,并保存当前会话的还原映射。

权限
  • filesystem:read
  • session-log:read
  • storage-domain:read
  • storage-domain:write
数据处理
  • 占位符到原文的还原表保存在内存中;也可持久化到受控的 `dsh_mask` 存储域。
  • 文档声明发送给模型和写入会话日志的是脱敏后的占位符,而不是明文。
外部服务
  • 声明不访问网络。
凭据
  • 声明不需要凭据。

局限

  • 仅支持正则检测;人名和地址需要未随包提供的 NER 集成,在所给配置中会加载失败。
  • 没有存储栈的 Profile 只能在内存中保存还原映射,重启后会丢失。
  • 浏览器端的显示还原功能默认关闭,且该 Bundle 不包含客户端部分。
  • 所给补丁将每个会话的还原条目限制为 500 条,较早条目会被淘汰。

DSHub 已核对

  • Git 源已固定到提交 57f441daa35849ceef67615a0bbd034a2a6aec2e。
  • 已验证包结构和 Cordis Bundle 补丁。
  • 已检查声明的权限、Peer 依赖、Node 版本范围和 Harness 版本声明。

DSHub 未核对

  • DSHub 未独立执行安装、脱敏、还原或运行时兼容性测试。
  • 未审计已发布 npm 包的内容。

固定版本安装

安装 dsh-mask

这个Plugin Bundle没有 DSH Plugin 安装操作,请根据源码文档使用真实交付方式。

访问源码项目

维护者原文

项目 README

查看 commit 57f441d 对应的 README
维护者编写的上游内容原文于 2026/9/10README.md 获取,正文和仓库相对媒体固定到 commit 57f441daa358,内容哈希为 139cf157941c。以下是未经 DSHub 翻译的上游原文,语言可能与当前页面不同;第三方托管的 badge 可能独立更新。
<div align="center">

dsh-mask

  • 1024 store channel: npm i -g dsh1024 once, then dsh1024 plugin --profile web add dsh-mask (counts toward the deepseek1024.com install ranking). Gitee

PII masking middleware for DeepSeek Harness — anonymize personal data before it reaches the model, restore it at the display layer.

Phones, emails, ID cards, bank cards, keys, and more become placeholders at the model boundary; the plaintext never enters your session log.

License DSH plugin dsh-doctor Node CI Version npm version npm downloads

English · 简体中文 · Español · Português · हिन्दी

</div>

Compatibility

Surface Status
Harness DeepSeek Harness dsh-v0.1.5-rc.1 (adapted 2026-09-09): 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-10 against the dsh-v0.1.5-rc.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

What you get

dsh-mask anonymizes personal data at the model boundary — before a message reaches the model — and keeps a restore table so placeholders can be mapped back to the originals at the display layer:

  • Request-time maskingagent/pre-step messages are rewritten so phones, emails, ID cards, bank cards, keys, and IPs (each opt-in) become <PHONE_1>-style placeholders. The masked text is what gets logged and sent to the model.
  • Restore table — the placeholder → original map lives only in memory and a controlled storage domain (dsh_mask); the plaintext never enters the session log.
  • Audit, not plaintext — the mask/applied session event records only "replaced N values + type distribution", never the original text or the mapping.
  • /mask commandstatus (counts + distribution), on/off (runtime toggle), restore <text> (unmap placeholders), help.
  • mask_test tool — run a snippet through the detector and see the placeholder result; it never reveals the original values.
user message ──agent/pre-step──▶ placeholders ──model──▶ placeholders ──restore──▶ display
                                   ▲                                                    │
                                   └──────── restore table (memory + dsh_mask) ────────┘

Quick start

# 1. install the bundle into your profile
dsh plugin --profile web add "github:PerryLink/dsh-mask#main"

# 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>

Install & uninstall

  • git channel (latest main): dsh plugin --profile web add "github:PerryLink/dsh-mask#main" (equivalent to installing from git+https://github.com/PerryLink/dsh-mask.git). No build step — index.mjs and lib/ are the shipped artifacts.
  • npm channel (published releases): dsh plugin --profile web add dsh-mask.
  • tarball channel: pnpm pack in this repo, then dsh plugin --profile web add ./dsh-mask-<version>.tgz.
  • uninstall: 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.

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.

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)

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

Tools & surfaces

Surface 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 <text> yes (explicit) Unmaps placeholders back to the values stored for this session
mask_test never Masks a snippet and reports the placeholder result + counts

Permissions & data

  • Permissions: dsh-mask performs no network requests and stores no credentials; it only reads the session at the agent/pre-step boundary and writes its own dsh_mask storage domain. The dshWorkshop manifest declares network:none and credentials:none.
  • Data: the placeholder → original restore table lives in memory and, when persistRestoreTable: true, in the controlled dsh_mask storage domain — this is the only place plaintext PII is stored, and it is never written to the session log.
  • Session log: 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.

Security boundaries

  • Plaintext never enters the session log. The masked (placeholder) form is what gets logged and sent to the model, so model-visible content is reconstructable from the log in placeholder form; the originals stay in the restore table.
  • Sanitize before display/log. lib/sanitize.mjs redacts PII, secrets, and URL credentials before any text reaches the model or the log; mask_test and /mask status never echo originals.
  • Controlled restore. /mask restore is the single explicit reveal surface, and it only reads the mapping for the active session.
  • Fail closed. Unimplemented mode (regex+ner), unknown scope values, NER-only entities, and out-of-bounds numbers all fail loudly at load.
  • Registrations are effects. The listener, command, tool, and storage-domain close are all Cordis effects — stop/hot-reload removes them.

Known limitations

  • Regex only. Name (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.
  • Display-layer restore needs a client half. Masking is fully host-side, but transparently un-masking the assistant bubbles in the client UI is a browser-half feature this pure-host form does not ship; the restore table and restore() are the complete host-side seam a client plugin would consume, and /mask restore covers interactive needs today.
  • Session events on 0.1.2-rc.1. The harness does not yet record mask/* event types, and its Session.append does not stamp the ignorable envelope, so on alpha.3 the session-log audit appends are skipped (sessions keep loading); the plugin enables them automatically once a host records the types or supports the ignorable envelope.

Development

pnpm install                                       # node ^22.19 || >=24
pnpm run typecheck && pnpm run typecheck:ci        # tsc --checkJs against the published 0.1.5-rc.1 peers
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 tarball

There is no build step: pure ESM, index.mjs and lib/ are the shipped artifacts.

Benchmark

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).

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, pii, mask, privacy, anonymization, security

Contributors

  • @PerryLink — creator and maintainer: the regex PII detector ported from Pii-Stripper-Middleware, the agent/pre-step masking seam, the restore table, the /mask command and mask_test tool, and the five-language docs.

PerryLink DSH Plugin Family

This project is one of the 37 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:

Plugin One-liner
dsh-auto-review Second-model auto-review on the approval chain, fail-closed by default
dsh-background-agents Durable background child agents with a Web UI sidebar, messaging and interrupt
dsh-budget Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel.
dsh-checkpoint-rewind Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-claude-move Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH
dsh-click Cross-platform native desktop control for DeepSeek Harness — Windows first.
dsh-composer-history Terminal-style input history for the web composer: arrows, Ctrl+R search
dsh-data-quality Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here)
dsh-defend Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness.
dsh-doublecheck Engineering-discipline guard: requirements grill, test gates, adversary review
dsh-draw Unified static-image generation routing for DeepSeek Harness.
dsh-fast Read-only performance diagnostics for DeepSeek Harness.
dsh-fund-research Deterministic research reports for Chinese public mutual funds
dsh-github GitHub PR/issues integration for DSH, every write gated by approval
dsh-industry-research Industry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble
dsh-library Local document knowledge base for DeepSeek Harness.
dsh-local-ai Local-model (Ollama) integration for DeepSeek Harness.
dsh-lsp-actions LSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-mcp-panel Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-memento Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool
dsh-observe OpenTelemetry and Langfuse observability exporter for DeepSeek Harness.
dsh-output-styles Claude Code outputStyles-equivalent runtime style switching
dsh-permission-rules Claude Code-style declarative allow/deny/ask permission rules with audit
dsh-personal-directive Personal directive injector with top-bar toggle (framework edition)
dsh-plugin-guide Plugin-development knowledge base as an on-demand agent skill
dsh-reach Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console
dsh-research-report Verifiable research-report engine: content-addressed evidence ledger and sealed versions
dsh-score Multi-dimensional quality scoring for DeepSeek Harness plugins.
dsh-session-pin Pin sessions in the Web sidebar with durable ordering
dsh-session-sync Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store.
dsh-skill-pack-security Security-audit skill pack: secret scan, dependency and supply-chain review
dsh-talk Voice-first session loop for DeepSeek Harness: talk to it, hear it answer.
dsh-test-drive Isolated install-and-smoke test drives for DeepSeek Harness plugins.
dsh-ticktick TickTick/Dida365 task bridge: session-header panel + 11 tools
dsh-translate Vendor parameter translation and deterministic JSON repair for DeepSeek Harness.
dsh-wechat WeChat ↔ DSH bridge (Tencent iLink bot): text/image/file/voice, approvals in chat

Install from the DSH Desktop Market

All PerryLink plugins are browsable in the built-in DSH Desktop Market: Market → Sources → add source → paste https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json → select it. Installation still goes through the Market's npm-identity verification and your confirmation.

License

LICENSE (Apache License 2.0) © 2026 dsh-mask contributors

有意识地管理

安装与管理

前置条件与目标 Profile

目标 Web Profile

交付方式 Git Bundle — PerryLink/dsh-mask#57f441daa35849ceef67615a0bbd034a2a6aec2e

验证、更新与移除

显示生命周期命令
验证
dsh plugin --profile web list

兼容性与访问范围

DeepSeek Harness plugin; requires declared peer services and Node 22.19+ or 24+ DeepSeek Harness 0.1.2-rc.1 or 0.1.5-rc.1 (declared)

检查兼容性证据

风险事实

sensitive-data-storage

Original PII may be retained in memory and, when enabled, the controlled `dsh_mask` storage domain for restoration.

证据
permissions

The manifest declares filesystem and session-log reads plus controlled storage-domain reads/writes; it declares no network access or credentials.

证据
证据与编辑审查Manifest、Bundle patch、分发与新鲜度

不可变证据

审查状态与源码活动

AI 已审查

建议先在测试 Profile 中使用,并确认受控存储域中持久化还原映射是否符合你的数据保留政策。

AI 审查于 2026/9/10 UTC 14:05GitHub 事实核对日期: 2026/9/10 UTC 14:05

自当前证据基线以来,没有记录到重要源码变化。

下一步

按 Plugin 安装流程操作

订阅重要变化: dsh-mask