scrub-vault
ScrubVault provides reversible PII masking and privacy-risk auditing for safe AI/LLM workflows.
Mask sensitive PII such as emails, phones, IBANs, IPs, and tax IDs in text, returning a reversible token map.
Unmask or restore original values in LLM responses using the local token map.
Audit text for GDPR/DSGVO Art. 32 privacy risks and return an audit score.
Recursively anonymize PII in JSON/dictionary data for safe staging or testing.
Allows masking PII in prompts before sending them to OpenAI's API and unmasking the responses, ensuring no confidential data is transmitted to OpenAI.
🛡️ ScrubVault: Zero-Data-Leak AI Airgap & Reversible PII Masking Engine
Send sensitive data to Cloud LLMs (ChatGPT, Claude, Gemini) without ever leaking confidential PII.
pip install scrub-vaultScrubVault is a lightweight, zero-dependency in-memory privacy proxy and Model Context Protocol (MCP) server. It intercept prompts, replaces personal identifiable information (emails, IBANs, IP addresses, credit cards, tax IDs) with deterministic local tokens ({{EMAIL_1}}, {{IBAN_1}}), and restores the original values when the AI responds.
🚀 The Architecture
+----------------------------------+
| Your Prompt (Confidential PII) |
+----------------------------------+
│
▼
┌─────────────────────────────┐
│ ScrubVault (Local RAM) │
│ - Scans & Masks Sensitive │
│ - Stores Mapping in Memory │
└─────────────────────────────┘
│
▼ (Masked Prompt: "{{EMAIL_1}}, {{IBAN_1}}")
┌─────────────────────────────┐
│ Public Cloud LLM API │
│ (OpenAI / Anthropic / ...) │
│ *Zero PII is transmitted* │
└─────────────────────────────┘
│
▼ (Response with tokens)
┌─────────────────────────────┐
│ ScrubVault (Local RAM) │
│ - Deterministic Unmasking │
└─────────────────────────────┘
│
▼
+----------------------------------+
| End-User Result (Restored PII) |
+----------------------------------+Related MCP server: pseudonym-mcp
⚡ Quickstart
1. Python SDK (Zero Dependencies)
from src.core.vault import ScrubVault
vault = ScrubVault()
# 1. Mask sensitive input
input_text = "Order for client Max, email: max@corp.de, IBAN: DE89370400440532013000"
result = vault.mask(input_text)
print(result.masked_text)
# Output: "Order for client Max, email: {{EMAIL_1}}, IBAN: {{IBAN_1}}"
# 2. Transmit result.masked_text to your LLM of choice...
ai_response = "Received confirmation for {{EMAIL_1}} on account {{IBAN_1}}."
# 3. Unmask locally
clean_response = vault.unmask(ai_response, result.token_map)
print(clean_response)
# Output: "Received confirmation for max@corp.de on account DE89370400440532013000."2. Standalone CLI
# Calculate GDPR Art. 32 Risk Score
python -m src.cli.main audit "Contract with Herr Schmidt, IBAN: DE89370400440532013000"
# Mask a dataset file directly
python -m src.cli.main scrub-dataset input.json output_clean.json🤖 Model Context Protocol (MCP) Integration
ScrubVault includes a native stdio Model Context Protocol (MCP) server. Add it to your claude_desktop_config.json or Antigravity configuration:
{
"mcpServers": {
"scrub_vault": {
"command": "python",
"args": ["-m", "src.mcp.server"],
"cwd": "/path/to/scrub_vault"
}
}
}1-Click Install via Smithery (Claude Desktop, Cursor):
npx -y @smithery/cli install @tastenkasperle/scrub-vault --client claudeAvailable MCP Tools:
scrub_mask_text: Masks PII in input text and returns a reversible token map.scrub_unmask_text: Replaces tokens with original values.scrub_audit_risk: Calculates risk scores and detection breakdowns.scrub_anonymize_json: Recursively scrubs JSON structures.
🛡️ Security & Clean Code Standard
Pure Python Standard Library: Zero third-party dependencies (
re,json,sys,typing).In-Memory Vault: Token maps live exclusively in volatile RAM and are never written to disk.
ReDoS Hardened: Regex patterns are strictly bounded against algorithmic complexity attacks.
Audit Passed: Tested and verified by Raptor Guard SAST (0 Critical, 0 High, 0 Medium findings).
📄 License & Attribution
Apache License 2.0. Engineered and orchestrated by THE HIVE // BSO (Bio-Synthetic Organism).
Provenance & Stewardship: Maintained by C. H. (BSO Steward).
Available Tools
4 toolsscrub_anonymize_jsonC
Recursively scans and anonymizes all PII in a JSON data structure for safe staging or testing.
Inputs: data (required).
scrub_audit_riskB
Audits a text or document for GDPR / DSGVO Art. 32 PII risks and returns an audit score.
Inputs: text (required).
scrub_mask_textA
Masks sensitive PII (emails, phones, IBANs, IPs, tax IDs) from text and generates a local token_map for zero-leakage prompt forwarding.
Inputs: text (required).
scrub_unmask_textC
Restores original sensitive values into an LLM response using the local token_map.
Inputs: text (required), token_map (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct operation: masking text, restoring values, auditing risk, and anonymizing JSON. Mask/unmask are clearly paired complements rather than overlapping, and audit/anonymize are separate concerns.
All tools use a consistent scrub_ prefix followed by a verb_noun pattern (mask_text, unmask_text, audit_risk, anonymize_json) in uniform snake_case.
Four tools is well-scoped for a focused PII-scrubbing server, with mask/unmask round-trip, an audit function, and a JSON variant each earning its place.
Covers the core lifecycle of mask, unmask, audit, and JSON anonymization with no obvious dead ends. Minor gaps exist around token_map persistence/management and document/file-level operations, but agents can work around these.
Maintenance
Related MCP Connectors
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
Mask, restore and black out personal data in text and files, processed in the EU.
Detect and redact PII and secrets (API keys, tokens) in text, HTML or PDF before it reaches an LLM.
Zero-retention GDPR PII redaction gate (IBAN, Tax-ID, HRB, Names) with signed Ed25519 VC.
Related MCP Servers
- FlicenseAqualityBmaintenancePII sanitization layer for autonomous AI agent pipelines. Detects and redacts emails, phone numbers, national IDs, private keys, and financial data before text reaches LLMs. Supports EN, ES (LATAM), PT (BR/PT), DE, JA.12-
- AlicenseAqualityBmaintenanceLocal pseudonymisation MCP server that detects PII in text, replaces it with opaque tokens before sending to cloud LLMs, and restores tokens afterward.273 npm2MIT
- AlicenseAqualityBmaintenanceEnables safe interaction with cloud LLMs by redacting sensitive entities into reversible placeholders, enforcing deterministic egress policies with human approval, and rehydrating responses so real data never leaves the process.4MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables agents to encrypt and sanitize sensitive data such as credentials, credit card numbers, and addresses locally before dispatching prompts to cloud LLMs, then rehydrate the masked values client-side. It runs deterministically with zero external dependencies over MCP JSON-RPC stdio, so no plaintext PII leaves the user's machine.-