>LOCAL-FIRST PII SCRUBBING

prompt-scrub

Local-first PII scrubbing for LLM prompts. Maps emails, secrets, and paths to stable placeholders and rehydrates model responses locally.

$ echo "My email is user@example.com" | prompt-scrub scrub
My email is Email_1
$ echo "Hello Email_1" | prompt-scrub rehydrate --session-id <id>
Hello user@example.com
8GitHub Stars
4Contributors
4Forks
271Community

Privacy-first prompts.

prompt-scrub is a small open-source, local-first utility designed to strip identifying content out of prompts and messages before they hit any cloud LLM.

It maps your sensitive data (emails, secrets, paths) to stable placeholders locally, allowing you to rehydrate the model's responses back to their original forms securely.

Premium capabilities.
Zero paid tiers.

Local-First Scrubbing

Runs entirely on your machine. Strips identifiers before they ever reach a cloud LLM.

Stable Placeholders

Maps secrets, emails, paths, and URLs to stable markers like Email_1, preserving prompt determinism.

Seamless Rehydration

Restores the original identifying content into the model's response automatically using local session maps.

Custom Detectors

Extend the built-in detectors with your own rules to catch domain-specific sensitive data.

Install in seconds.

Zero complex setup. Available on your favorite package manager.

NPM
npm install prompt-scrub
Global
npm install -g prompt-scrub

Why developers choose prompt-scrub

Privacy by Default

Never accidentally leak an API key or customer email to a cloud provider again.

Cache-Aware

Maintains exact byte-prefix determinism to preserve LLM provider prompt caching.

Developer Friendly

Available as both a CLI tool and a Node.js library for easy integration into your pipelines.

Supported by

Sponsorship funds the people building open, privacy-respecting AI tools, and keeps every line of it free at the point of use.

Become a sponsor
[ Join the Collective ]

Build with us.

Join developers building the future of local-first AI tooling.