dshbase

插件目录 / Developer / dsh-privacy-mask

dsh-privacy-mask

已验证 · 实测可装 Huauauaa

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-20最近推送
跨平台平台

功能简介

dsh-privacy-mask

✅
我们的评价
可用 — 实测通过,早期项目

dsh-privacy-mask 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-privacy-mask

Display-only privacy mask for the DeepSeek Harness (dsh) web UI. Regex matches in chat text render as a placeholder (default ***); hover reveals the original. Copy, selection, and LLM context are unchanged.

What it does

  • Scans user messages, assistant body text, and tool/result cards in the conversation DOM
  • Wraps regex matches in a CSS mask — the DOM still holds the original text
  • Shows a configurable placeholder instead of matched substrings; hover reveals the real value
  • Built-in rules for common secret shapes (API keys, Bearer tokens, email, PEM headers) plus custom rules
  • Settings page section Privacy mask (open via the bottom-left Settings button)

What it does not do

  • Does not redact session data, exports, telemetry, or model/tool payloads
  • Does not change what the LLM sees or what gets stored server-side
  • Does not alter clipboard output — copy/paste still yields the original secret text

Config still lives in browser localStorage (not Host settings.plugin.item); see Configuration storage.

Install

From a checkout of this repo:

dsh plugin --profile web add /absolute/path/to/privacy

Then restart (or reload) the web profile so the client bundle loads.

lib/client.js is a classic-script ModuleLoader factory (window.__ModuleLoader__.load, id dsh-privacy-mask), self-contained for the browser.

Dev overlay (optional): dsh web --patch ./cordis.patch.yml with absolute plugin paths per dsh docs.

Settings

Open the bottom-left Settings control, then choose Privacy mask in the settings nav.

Field Description
Enabled Master switch. Off unwraps all masks and stops scanning.
Placeholder Text shown instead of matches (default ***).
Rules Ordered list. Each rule has an enable toggle, name, and regex pattern.

Per rule:

  • Builtin rules — name and pattern are read-only; you can disable them but not delete or edit the pattern.
  • Custom rules — fully editable; use Delete to remove. Add rule appends a blank custom row.

Actions:

  • Save — validates every pattern; invalid regex or empty/whitespace-only patterns show an inline error and are not written.
  • Reset to defaults — restores built-in rules and default placeholder immediately.

Storage key: dsh-privacy-mask:v1 in localStorage. After changing package.json client injects, restart the web profile so __DSH_BOOT__ picks up slots.

Default built-in rules

All enabled by default:

Name Pattern (JS RegExp source)
API key-like \b(?:sk-or-|sk-|rk-)[A-Za-z0-9_\-]{16,}\b
Bearer token \bBearer\s+[A-Za-z0-9\-._~+/]+=*
Email \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b
PEM private key header -----BEGIN [A-Z0-9 ]*PRIVATE KEY-----

The API-key rule is intentionally conservative; disable it if you see false positives.

Tests

npm test

Runs Node node:test suites for mask-core (match/segment contract), writeConfig (persist + invalid/empty-pattern rejection), and conversation selectors. Tests import ESM sources (lib/mask-core.js, lib/settings-store.js, lib/selectors.js); the browser file inlines those.

Compatibility / DOM selectors

DSH web UI markup can change between versions. If masking misses the chat or hits the wrong area, edit lib/selectors.js (keep the inlined copy in lib/client.js in sync):

  • conversationRoots() — scan start: prefers [data-conversation-scroll], then [role="log"] / [data-testid="conversation"], then main, then document.body
  • shouldSkip() — ignores composer ([data-composer-seat] / [data-composer-card]), sidebar ([data-slot="sidebar"]…), inputs/contenteditable, shell overlays, the settings panel, and nodes already masked

Prefer stable data-* / roles over hashed class names. On first install, still verify in DevTools that the transcript root and composer markers match your dsh build.

Configuration storage

The Privacy mask page is registered as a Settings nav section (settings.section). Values still persist in browser localStorage, not Host settings.plugin.item.

Public dsh rc builds enforce a WEB_SETTINGS_NAMESPACES allowlist that blocks third-party plugin namespaces from the Host settings store. Until that allowlist includes privacy-mask, localStorage remains the persistence path. The Host entry (lib/index.js) is a no-op mount marker only.

Manual smoke checklist

After install into a web profile:

  1. Send or view a message containing a fake Bearer token (e.g. Authorization: Bearer abc.def-123) — UI should show the placeholder.
  2. Hover the masked span — original text appears.
  3. Select and copy — clipboard contains the original token, not ***.
  4. Disable the Bearer rule (or master Enabled) and save — text renders plainly.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-privacy-mask」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Huauauaa/dsh-privacy-mask

Headless(CLI)profile:

dsh plugin --profile headless add github:Huauauaa/dsh-privacy-mask

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7819 个插件 →