Zero-Trust Data Sanitization

Automated Directory Auditing: Codebase Secrets & PII Pre-Flight Scanner

Audit Your Entire Codebase Offline

100% Local RAM Processing
Trusted by 10,000+ teams & engineers · $0 Free / $99/mo Teams
Airplane Mode Verified
0 Bytes Server Egress
Directory Bulk Audit

AI Summary / Key Takeaways

Verified Zero-Trust Logic

"Prevent catastrophic vector poisoning and supply chain leaks. The PrivacyScrubber MCP Server scans entire local repositories in <4 seconds, catching hardcoded API keys, JWTs, and customer test PII before autonomous AI coding agents or RAG pipelines ingest your codebase."

How fast is the directory audit?
Does it upload my code anywhere?
Which IDEs and agentic tools support the directory audit MCP tool?

Enterprise-Grade AI Privacy

Add custom redaction rules and priority support with PRO.

GO PRO
Live Turnkey Simulator · ZTDS Engine

Interactive PII Detection & Sanitization Sandbox

Test real-time client-side RAM tokenization. Choose a specialized preset or paste your own raw prompt to test instant reversible redaction.

0 Bytes Server Egress
<1.8ms Latency
Select Industry Test Payload:
Raw Input Payload
0 chars
RAM-Only Isolated Session
Automated Detection Classes:
API Access Keys / TokensSECRETEmail AddressesCustomer / Employee Names
Enterprise Challenge

The Challenge with AI Data Workflows

Developers routinely hardcode API keys or production database credentials during testing and accidentally commit them to GitHub. Existing secret scanners often send code telemetry back to cloud vendors, violating air-gapped security policies.

Zero-Egress Data Protection
Eliminates corporate data leaks before prompts hit external AI models.
Zero-Trust Resolution

How It Works

1

Initialize MCP Server

Connect the PrivacyScrubber MCP Server to your IDE. It runs completely offline.

2

Trigger the Audit

Instruct your AI agent to run the 'audit_directory_for_pii' tool against your current working directory.

3

Review the Report

The tool generates a comprehensive list of flagged files, exact line numbers, and entity types (e.g., AWS Key, Email). You can then instruct the AI to call 'sanitize_file' on the flagged items.

Customer Proof

What Teams Achieve with Local PII Masking

"Before giving Cursor access to our entire monolithic repository, we run the PrivacyScrubber directory audit. It found 3 leaked API keys we didn't know about."

A

Alex T., CTO

Verified User

"The fact that the agent can audit the directory and autonomously sanitize flagged files using the MCP server eliminates 90% of manual code sanitization overhead."

S

Sam D., DevSecOps Engineer

Verified User

"Autonomous coding agents like Claude Code and Cursor indexing entire monorepos without pre-flight secrets checks was keeping our CISO awake at night. PrivacyScrubber's local directory audit catches AWS credentials, RSA keys, and customer test data before the agent starts prompting."

M

Marcus V., Principal Cloud Security Engineer

Verified User

Swipe to read verified reviews

Supported Formats & Limitations

Supported Formats

Source Code (JS, Python, Go, etc.)JSONYAMLENV

System Limitations

  • Excludes binary files (images, compiled objects) by default
  • Scans are bounded by OS file-read constraints and local memory limits
  • Heuristics optimized for code, so prose-heavy documentation may yield false positives for specific variables

Prevent Irreversible Vector Poisoning: Audit Repositories for Secrets in Under 4 Seconds

When engineering organizations deploy autonomous coding agents (Claude Code, Cursor Composer, Windsurf) or feed internal codebases into enterprise Retrieval-Augmented Generation (RAG) vector databases, they confront an irreversible privacy vulnerability. Repositories frequently contain forgotten test fixtures, historical SQL seed scripts with real customer PII, uncommitted .env staging files, and hardcoded API keys.

Once an autonomous agent or RAG vectorizer (Pinecone, Chroma, pgvector) indexes these files, personal data becomes embedded into high-dimensional vector weights. Under GDPR Article 17 (Right to be Forgotten), extracting an individual's data from dense vector indexes is mathematically impossible without wiping and re-indexing the entire database at massive expense. The PrivacyScrubber Automated Directory Audit acts as an instant pre-flight firewall, scanning 10,000+ source files locally in under 4 seconds to sanitize code and data before ingestion occurs.

Enterprise Velocity: Scan 10,000+ Files Locally in <4 Seconds with 0 Network Egress

Engineered for zero-overhead local execution, the directory audit tool processes enterprise monorepos in seconds using non-blocking asynchronous file system streams:

Asynchronous I/O Streams

Reads files via Node.js fs.promises pipelines with chunked buffers, scanning 10,000+ files in under 4 seconds without disk locks or memory spikes.

Intelligent Boundary Isolation

Automatically excludes .git/, node_modules/, dist/, build/, binary executables, and images to focus exclusively on sensitive source code.

ReDoS-Hardened Regex

All 25+ regulatory profiles and secret heuristics are evaluated against linear-time state machines, eliminating catastrophic backtracking on 50MB minified bundles.

Immediate Actionable Reports: Pinpoint Violations with Exact Line Numbers & Compliance Citations

Whether invoked directly via the CLI or triggered autonomously by an AI agent through the audit_directory_for_pii MCP tool, PrivacyScrubber generates an actionable structured report pinpointing exact file paths, line numbers, and compliance framework violations:

$ npx @privacyscrubber/mcp-server audit ./services --profile=DevOps --verbose

[PRIVACYSCRUBBER] Initializing Zero-Trust Directory Audit Engine...
[STATUS] Target: /workspace/services (Recursive) | Active Profile: DevOps & Cloud Secrets
[STATUS] Scanning 1,482 source files across 84 subdirectories...

========================================================================================
AUDIT FINDINGS SUMMARY: 4 SENSITIVE VIOLATIONS DETECTED ACROSS 2 FILES
========================================================================================

[!] FILE: services/auth/src/config/database.ts:18
    FOUND:    postgresql://dbadmin:Sup3rS3cr3tP4ss!@prod-cluster.internal:5432/app_prod
    ENTITY:   [DB_URI_1] (Database Connection String with Credentials)
    SEVERITY: CRITICAL | COMPLIANCE: SOC 2 Type II CC6.6, ISO 27001 A.8.24

[!] FILE: services/billing/fixtures/stripe_mock.json:42
    FOUND:    sk_live_51OzSecretKeyProductionLiveStripeKey991
    ENTITY:   [TOKEN_1] (Stripe Live Secret Key)
    SEVERITY: CRITICAL | COMPLIANCE: PCI DSS v4.0 Requirement 3.4

[!] FILE: services/billing/fixtures/stripe_mock.json:88
    FOUND:    Marcus Sterling <m.sterling@fintechventures.co.uk>
    ENTITY:   [NAME_1], [EMAIL_1] (Real Customer PII in Mock Data)
    SEVERITY: HIGH | COMPLIANCE: GDPR Article 4(1), CCPA § 1798.140

----------------------------------------------------------------------------------------
EXECUTION BENCHMARK: 1,482 files audited in 1.14s | Network Egress: 0 Bytes (Air-Gapped)
REMEDIATION ACTION:   Agent can invoke `sanitize_file` to tokenize flagged files in RAM
========================================================================================

Automated Prevention: Block Unmasked Secrets at Git Pre-Commit in 1 Step

Prevent accidental commits of credentials and customer test dumps by embedding PrivacyScrubber's zero-dependency scanner directly into your Git lifecycle. Add this snippet to .husky/pre-commit or .git/hooks/pre-push:

.husky/pre-commit Zero-Dependency Shell Script
#!/bin/sh
# PrivacyScrubber Pre-Commit Guard: Verify no unmasked credentials in staged files
echo "[PrivacyScrubber] Auditing staged files for PII and cloud secrets..."

# Run local audit against staged git changes
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(ts|js|py|json|env|sql)$')

if [ -n "$STAGED_FILES" ]; then
  npx -y @privacyscrubber/mcp-server audit $STAGED_FILES --fail-on-secrets
  if [ $? -ne 0 ]; then
    echo "[BLOCK] PrivacyScrubber detected raw secrets in staged files!"
    echo "Run 'npx @privacyscrubber/mcp-server sanitize [file]' or use .env variables."
    exit 1
  fi
fi

exit 0

Security & Compliance Comparison: Air-Gapped Directory Audit vs. Cloud SaaS Scanners

How PrivacyScrubber's AI-native, client-side directory audit compares against legacy cloud-based secret scanners:

Scanning CapabilityCloud Scanners (GitGuardian SaaS)Static CLI Tools (TruffleHog)PrivacyScrubber Directory Audit
Execution PrivacyUploads code snippets to vendor cloudLocal CLI execution100% Air-gapped (0 network calls)
Customer PII DetectionZero (Secrets/API keys only)Zero (High-entropy strings only)25+ Profiles (Names, SSN, PHI, IBAN)
Autonomous AI IntegrationWebhook alerts (No agent loop)CLI shell only (Manual review)Native MCP tool (Cursor, Claude Code)
Autonomous RemediationNone (Requires manual Git edit)None (Alert only)1-Click sanitize_file token swap
Vector Ingestion DefenseNot designed for RAG pipelinesNot designed for RAG pipelinesPrevents irreversible vector poisoning

Closed-Loop Remediation: Find, Sanitize, and Unblock Autonomous AI Agents in 4 Steps

When integrated with autonomous agent workflows like Cursor Composer or Claude Desktop, the directory audit creates a closed-loop security workflow:

  1. Pre-Flight Audit: The AI agent triggers audit_directory_for_pii before analyzing the repository to fulfill a complex refactoring task.
  2. Report Parsing: The agent receives structured JSON metadata with exact line numbers and entity types without leaking plaintext values to the conversation history.
  3. Automated Redaction: The agent invokes sanitize_file on flagged test fixtures or replaces hardcoded database URIs with process.env references.
  4. Clean Ingestion: The agent proceeds with code generation and testing against a completely sanitized, compliant context window.

Learn more about integrating local sanitization into your editor with the IDE Prompt Security Gateway (MCP) guide, or inspect our enterprise Developer SDK for programmatic backend integration.

Client-Side Reliability & Audit Verification

Powered by the Zero-Trust Sanitization Engine (ZTDS). All detection, tokenization, and regex evaluation execute 100% inside your local client process boundary — eliminating cloud proxies, intermediate servers, and third-party data retention risks.

100% Local Execution RAM-Only (Zero Disk I/O) Zero Outbound Telemetry
Airplane Mode
Zero Network Dependency

Step-by-Step Guide

How to use this feature

4 min total
1

Ask the AI Agent

Prompt your AI: 'Run a security audit on this directory using the PrivacyScrubber MCP server.'

2

Agent Executes Tool

The agent autonomously calls audit_directory_for_pii, parsing your entire file tree locally.

3

Agent Plans Fixes

Based on the audit report, the agent can autonomously propose code changes or call sanitize_file to redact the hardcoded secrets.

4

Commit Securely

Your codebase is now clean of PII and secrets, preventing leakage into the AI's training data stream.

What you need: Cursor or MCP-compatible IDE PrivacyScrubber MCP Server installed

Frequently Asked Questions

Technical Details & Privacy Architecture

How fast is the directory audit?
The audit tool is heavily optimized using asynchronous I/O and worker threads in Node.js. It can scan a 10,000-file repository in under 4 seconds.
Does it upload my code anywhere?
No. The MCP server runs as a local process on your machine. The audit tool reads files locally and returns the report directly to the IDE's agent context. Zero data is transmitted to our servers.
Which IDEs and agentic tools support the directory audit MCP tool?
Any MCP-compliant client, including Cursor, Claude Desktop, Windsurf, Roo Code, Continue.dev, and custom LangChain/LlamaIndex pipelines.
Does the directory audit respect .gitignore and .env conventions?
Yes. The scanner automatically respects standard ignore rules and can be configured to selectively audit or exclude .env, .env.production, or test/fixtures directories.
Can the MCP server automatically fix flagged secrets and PII?
Yes. Agents can call the companion sanitize_file or scrub_text tool to replace hardcoded production keys with environment variables or deterministic tokens.
What file types are supported during directory auditing?
All text-based source files including JavaScript, TypeScript, Python, Go, Rust, Java, C/C++, JSON, YAML, TOML, Markdown, and configuration files.
100% Zero-Trust Deployment

Audit Monorepos & Secrets Before AI Ingestion

No server uploads. No account required. 100% offline in your browser's local RAM.