Static PII redactors destroy data structure. When an LLM hands [REDACTED_CARD] to Stripe or SQL, downstream Pydantic schemas crash instantly.
ShadowVault introduces bi-directional, format-preserving pseudonymization purpose-built for autonomous agent tool-calling boundaries and Model Context Protocol (MCP).
Synthetic tokens satisfy Luhn mod 10, Verhoeff D5, RFC-5322, & Pydantic schemas.
Tools receive real PII at execution time via @vault_guard; outputs re-dehydrate.
Lookahead holdback buffer reassembles split tokens across streaming SSE chunks.
Test how real customer PII is dehydrated into valid mathematical tokens for cloud LLMs, then safely restored at local private tool boundaries.
Arguments hydrated with real values right before tool execution:
| Type | Synthetic Token | Storage |
|---|
Protect any Python function or agent tool in seconds. The decorator @vault_guard re-hydrates real PII right before your tool executes and sanitizes return values automatically.
# pip install shadow-vault from shadow_vault import ShadowVault, vault_guard vault = ShadowVault() # 1. Protect your internal tool: automatically receives real PII, returns masked PII @vault_guard(vault=vault, session_id_arg="session_id") def charge_customer(email: str, card: str, session_id: str = "default") -> dict: # Tool executes with REAL PII: email='alice@example.com', card='4532 0151 1283 0366' return {"status": "PAID", "receipt": email, "backup_phone": "+91 9876543210"} # 2. Dehydrate safe prompt for the Cloud LLM: prompt = vault.dehydrate("Charge alice@example.com on card 4532 0151 1283 0366", session_id="s1") # Prompt becomes: "Charge u_c09753@shadow.vault on card 4000009995970590" (Valid Luhn!) # 3. Model executes tool with synthetic tokens -> returns sanitized output back to agent state: result = charge_customer(email="u_c09753@shadow.vault", card="4000009995970590", session_id="s1") # Result: {'status': 'PAID', 'receipt': 'u_c09753@shadow.vault', 'backup_phone': '+919000597059'}
Wrap any existing MCP server (Node.js, Python, Go, Rust, SQLite) with a transparent stdio privacy proxy. Intercept JSON-RPC messages between Claude Desktop, Cursor, and your tools with zero application code changes.
{
"mcpServers": {
"secure-sqlite": {
"command": "shadow-vault",
"args": [
"mcp-proxy",
"--session-id", "claude_session",
"--fail-closed",
"--",
"uvx", "mcp-server-sqlite", "--db", "customers.db"
]
}
}
}
The proxy automatically swaps synthetic tokens back to real records when Claude executes a tool, and re-dehydrates results before sending them back to Anthropic.
from langchain_openai import ChatOpenAI from shadow_vault import ShadowVault, protect_tool, ShadowVaultChatWrapper vault = ShadowVault() # Protect LangChain Tool safe_tool = protect_tool(lookup_customer_db, vault=vault, session_id="s1") # Protect ChatModel: prompts dehydrated, tool arguments kept synthetic llm = ChatOpenAI(model="gpt-4o") safe_llm = ShadowVaultChatWrapper(llm=llm, vault=vault, session_id="s1")
Ensures 0% raw PII enters LangGraph checkpoints, SQLite memory savers, or external wire telemetry.
Unlike regex-only scanners that flag random numbers, ShadowVault couples strict regex boundaries with mathematical checksum verification (Global + India standards).
| Entity Type | Mathematical Checksum / Standard | Real Sample | Synthetic Format-Preserving Token |
|---|---|---|---|
| CREDIT_CARD | Luhn Checksum Modulo 10 (13–19 digits) | 4532 0151 1283 0366 | 4000009995970590 (Luhn valid!) |
| AADHAAR | Verhoeff Dihedral D5 Algorithm (12 digits) | 3675 9834 6016 | 999905970594 (Verhoeff valid!) |
| PAN_CARD | Indian Income Tax Format ([A-Z]{5}[0-9]{4}[A-Z]{1}) | ABCDE1234F | SHDWV7059Z |
| UPI_ID | Evaluated before email (@okaxis, @okhdfcbank, @paytm) | dhiraj@okaxis | u_a81c25@okshadow |
| RFC-5322 (ignores internal @shadow.vault handles) | alice@example.com | u_c09753@shadow.vault | |
| PHONE | E.164, Indian mobile (+91 [6-9]\d{9}), US/NANP | +91 9876543210 | +919000597059 (10-digit mobile) |
| SSN | US Social Security Number (Area/Group/Serial checks) | 219-45-7890 | 900-99-7059 (Unissued area code) |
| API_KEY | OpenAI (sk-...), GitHub (ghp_...), Google (AIza...) | sk-live-51A2B3C4D5E... | sk-sv-shadow-c09753000... |
ShadowVault ships with zero-key self-audit tools. Verify all 6 cryptographic, mathematical, and streaming invariants locally on your machine with one command:
Why traditional document PII redactors fail in agentic tool-calling workflows
| Capability | ShadowVault | Microsoft Presidio | Rizzo PII |
|---|---|---|---|
| Primary Architecture | AI Agent Tools & MCP | Document Extraction NLP | Italian Legal Anonymization |
| Format-Preserving Tokens | Yes (Pydantic valid) | No (<EMAIL>) | No (<LOC>) |
| Reversible Tool Boundaries | Yes (@vault_guard) | Manual glue needed | No (One-way redaction) |
| Model Context Protocol (MCP) | Yes (stdio gateway) | No | No |
| Runtime Core Footprint | ~0 MB (Pure Python) | ~500 MB (spaCy / PyTorch) | Trained Model Weights |