2026-12-03 23:38:48 +00:00
2026-12-03 23:18:02 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:18:02 +00:00
2026-12-03 23:18:02 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:18:02 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:38:48 +00:00
2026-12-03 23:38:48 +00:00

Redactor MCP

A zero-egress local MCP server and in-memory vault for redacting state-work PII (SSN, ITIN, EIN, DOB, addresses, bank routing/account numbers, state/case IDs) and software engineering secrets (API keys, tokens, private keys, DB URIs, .env values) before they reach AI agents (Antigravity and Amazon Kiro), with deterministic placeholder mapping and one-way egress rehydration.

Architecture

  • Persistent Docker Vault (network_mode: none, tmpfs RAM only): Holds session placeholder mappings (<<REDACT:PII_SSN:a9f3:1>> or format-preserving synthetic tokens like 900-00-0001) strictly in memory with TTL expiration and zero network access.
  • Schema / Key-Aware & Document Redaction: Automatically redacts sensitive keys/columns (names, DOBs, SSNs, Medicaid/case IDs, secrets) in .json, .jsonl, .csv, .tsv, and SQL INSERT dumps, plus extracts and redacts text/tables from .pdf, .docx, and .xlsx files.
  • Scrubbed Execution (vault_run_scrubbed): Runs test suites or linters strictly inside clean-staging/ and scrubs any secrets/PII from stdout/stderr before returning output.
  • Batch Output Sync & Auto-Watch: vault_sync_output batch-rehydrates clean-staging/ into final-output/, and redactor-mcp watch <dir> polls sensitive/ (WSL2 /mnt/c/ safe) to auto-stage new files.
  • Allowlists & .redactorignore: Skip noisy lockfiles/assets and allowlist known benign placeholder strings.
  • Compliance Audit & Encrypted Pause/Resume: Append-only non-secret JSONL audit log (REDACTOR_AUDIT_LOG) plus AES-256 encrypted snapshot-save / snapshot-load CLI commands.
  • MCP stdio Bridge (docker exec -i): Both Antigravity and Amazon Kiro connect over stdio via wsl.exe into the same running container, sharing the same session vault without opening any TCP ports.
  • One-Way Egress: vault_write_file, vault_rehydrate_file, and vault_sync_output restore placeholders back into real values only when writing to approved final-output/ paths (never clean-staging/ or symlinks), and return only byte/token counts—never raw secrets—to the agent.
  • Antigravity Plugin & Guardrails: Drop-in plugins/redactor-vault bundle (MCP config + PreToolUse/PreInvocation hooks + rule + skill), plus standalone hooks.json / hooks.windows.json templates.

Quick Start (Windows + WSL2 + Docker)

  1. Copy this repository into your WSL2 filesystem (e.g., ~/redactor-mcp) for POSIX permissions and fast I/O:

    cd ~/redactor-mcp
    chmod +x scripts/wsl_setup.sh scripts/hooks/agy_guard.py
    ./scripts/wsl_setup.sh
    

    (To enable offline Microsoft Presidio + spaCy NER for unstructured person names/locations in case notes, build with INSTALL_NER=true in docker-compose.yml and set REDACTOR_ENABLE_NER: "true".)

  2. Connect Antigravity:

    • Copy configs/antigravity/mcp_config.json into ~/.gemini/config/mcp_config.json (merge under mcpServers).
    • Copy configs/antigravity/hooks.json to your project's .agents/hooks.json (adjusting the path to agy_guard.py) and configs/antigravity/GEMINI.md to your workspace root.
  3. Connect Amazon Kiro:

    • Copy configs/kiro/mcp.json into .kiro/settings/mcp.json (or ~/.kiro/settings/mcp.json).
    • Copy configs/kiro/hooks/protect-sensitive.json into .kiro/hooks/.
  4. Clipboard Sanitize / Restore on Windows:

    • Before pasting sensitive text into chat: powershell -File .\scripts\win_clipboard.ps1 -Mode sanitize
    • After copying an agent response with placeholders: powershell -File .\scripts\win_clipboard.ps1 -Mode restore

Running Tests Locally

Works on Python 3.9+ with zero external dependencies (or via pytest):

PYTHONPATH=src python3 -m unittest discover -s tests -v
S
Description
Zero-egress local MCP server and vault for redacting PII & SWE secrets
Readme
107 KiB
Languages
Python 98.5%
Dockerfile 0.7%
PowerShell 0.5%
Shell 0.3%