Local · no account · MIT

Share the context. Mask the secret.

MaskPrompt replaces likely secrets with stable local tags before a prompt, log, or code snippet reaches an AI. The model keeps the context. Your values stay on your machine.

Try the live demo $ pip install maskprompt
View source on GitHub →

LOCAL PROCESSING · NO ANALYTICS · PATTERN MATCHING HAS LIMITS

sk-proj-FAKE-demo you@example.invalid

drag a zipper · the secrets underneath are fake

Try it

Type something you would never paste into a chatbot.

This runs entirely in your browser with the same detection logic the CLI uses. Edit the text and watch it get redacted live.

your prompteditable
masked output

The loop

Detect, mask, then put it back.

One local vault. Every secret gets a stable tag, so the same key reads the same in a chat today and a repo tomorrow. The model reasons normally, and you restore the real values in its answer.

01

Detect

Over 30 provider key formats, a Luhn check for cards, and optional entropy scanning find emails, API keys, private keys, JWTs, and password-style assignments across a string, a file, or a whole repo.

python3 maskprompt.py -scan ./my-repo -report findings.json
02

Mask

Each secret becomes a stable tag like <APIKEY_1>, saved in your local vault so the same value always gets the same tag everywhere. The audit log stores hashes, never the raw secret.

python3 maskprompt.py -clip
03

Unmask

Paste the model's reply back through MaskPrompt with your vault and every tag turns back into the real value. The vault never leaves your disk.

python3 maskprompt.py -unmask -file answer.txt

Out of the box

What it catches today.

emailscredit cards (Luhn)OpenAI keysAnthropic keysGitHub tokensAWS access keysGoogle API keysStripe keysSlack tokensGroq keysGitLab tokensNotion tokensHugging Face keysJWTsprivate key blocksbearer tokenspassword= assignmentsphone numbershigh-entropy strings30+ providers+ your own patterns

The honest part

A guardrail, not a guarantee.

MaskPrompt is pattern matching. It can miss unusual secret formats, and it can flag text you meant to keep. It reduces accidental exposure; it does not make it safe to paste anything anywhere. Review what you send.

Naive masking can also break the model: swap a name for a random blob and it starts hallucinating “fixes”. MaskPrompt uses consistent, structured tags and gives you the reverse map, so the reply still lines up with reality.

“I tried basic regex to swap the email. The model immediately pushed back and started hallucinating realistic names instead.”

a developer on r/LLMDevs, describing the problem MaskPrompt is built around

Support the project

Free to use. Easy to back.

No subscriptions, no locked features. The tool is MIT and stays that way. If it saves you from one leaked key, that is the whole point.

CommunityFree
  • The full CLI, MIT licensed
  • Every detector, no limits
  • Custom patterns and config
  • Works fully offline
Clone the repo
SupportersOptional
  • Fund maintenance and new detectors
  • Name in the readme credits
  • Vote on the roadmap
Contact Zeolant
Team RelaySoon
  • Shared policies for a team
  • Central custom patterns
  • Audit trail for admins
Not for sale yet