Preface¶
When using DeepSeek Harness to process conversations or files containing real customer data, sensitive information (names, mobile numbers, ID numbers, etc.) is exposed directly to the model and logs, posing compliance risks. The Local Privacy Gateway plugin desensitizes data before messages are sent to the model, restores the display only in the local interface, and generates desensitized file copies.
Plugin Positioning¶
This is a local, MIT-licensed DSH plugin designed to replace personal information in conversations with placeholders and to scan and desensitize CSV/XLSX files.
Core Functions¶
This plugin primarily solves two problems:
1. Conversation Message Masking: Replaces personal information with placeholders before sending to the model, ensuring the model and logs only see placeholders.
2. Spreadsheet Scanning & Desensitization: Supports column-level scanning of CSV/XLSX files to generate desensitized copies.
1. Detection Rules¶
Supports the following types of rule detection:
* PERSON: Chinese names with context (e.g., labels, titles).
* PHONE: Mainland China mobile numbers (supports +86, spaces, or hyphens).
* EMAIL: Email addresses.
* ID_CARD: Mainland China Resident Identity Card numbers (includes checksum validation).
* BANK_CARD: 16-19 digit bank card numbers (Luhn check).
* IP: IPv4 addresses (disabled by default due to common occurrence in technical text).
2. Local UI Restoration¶
Original text is displayed only in the local interface, where sensitive content is marked with 🔒. Placeholders are generated using a local HMAC key; the model can identify and distinguish between different objects, and prompt caching remains stable.
3. Custom Dictionary¶
Content that rules cannot capture (e.g., bare names without context, company names, project codes) can be added to the dictionary. The dictionary supports importing from CSV/XLSX columns and matching line by line.
4. Data Storage Isolation¶
All data is stored locally in ~/.dsh-privacy-gateway/ with file permissions set to 0600, ensuring only the current user can read and write to it.
Installation & Activation¶
Install via CLI:
dsh plugin --profile web add github:ethanrise/dsh-privacy-gateway
Or add the plugin in DSH Desktop settings.
After installation, click the 🔒 button in the sidebar to open the Privacy Gateway and enable the masking toggle to start using it.
Typical Usage¶
- Conversation Desensitization: Enable masking in the sidebar. When inputting a conversation containing personal information, the model will receive placeholders (e.g.,
[PERSON_7C1E0A93B2]), while the local interface will restore and display the original text with🔒. - File Desensitization:
- Upload a CSV/XLSX file.
- The plugin suggests actions based on classification results (e.g., MASK, TOKENIZE).
- Select KEEP, MASK, TOKENIZE, or REMOVE.
- Manually download the desensitized
.safe.csvor.safe.xlsxfile.
Caveats¶
- Context Dependency: Name detection relies on context (labels, titles); bare names without context must be added to the dictionary.
- Addresses & Companies: Addresses and company names are not detected by rules and must be manually added to the dictionary.
- Tool Result Masking: Tool results are not masked by default;
maskToolResultsmust be enabled in the configuration. - Manual Download: Desensitized copies require manual download and sending to the AI; the plugin does not attach them automatically.
- Timing of Effect: Masking and dictionary changes only apply to messages sent afterwards and do not modify historical messages.
Ecosystem Background¶
DSH adopts an “Everything is a Plugin” architecture. This plugin is maintained by community developer ethanrise. For details, visit the Skill Cloud Directory, and find the source code on GitHub.