Privacy Mask
Detect and mask sensitive information in images locally before they leave your machine.
When to use
- User sends a screenshot that may contain private data
- User mentions privacy, masking, or redacting
- You need to analyze an image but want to redact sensitive info first
Quick start
pip install privacy-mask
privacy-mask install # one-time: sets up global Claude Code hook
After install, all images are automatically masked before upload. No further action needed.
Manual usage
Mask an image:
privacy-mask mask <image_path>
privacy-mask mask <image_path> --in-place
privacy-mask mask <image_path> --dry-run # detect only
Output is JSON:
{
"status": "success",
"detections": [{"label": "PHONE_CN", "text": "***", "bbox": [10, 20, 100, 30]}],
"summary": "Masked 1 regions: 1 PHONE_CN"
}
What it detects (47 rules)
- IDs: Chinese ID card, passport, HK/TW ID, US SSN, UK NINO, Canadian SIN, Indian Aadhaar/PAN, Korean RRN, Singapore NRIC, Malaysian IC
- Phone: Chinese mobile/landline, US phone, international (+prefix)
- Financial: Bank card, Amex, IBAN, SWIFT/BIC
- Developer keys: AWS, GitHub, Slack, Google, Stripe tokens, JWT, connection strings, API keys, SSH/PEM keys
- Crypto: Bitcoin, Ethereum wallet addresses
- Other: Email, birthday, IP/IPv6, MAC, UUID, license plate, MRZ, URL auth tokens
Important
- All processing is local and offline — no data leaves the machine
- The hook intercepts images before upload to cloud API
- Configure rules in the bundled
config.json or pass --config for custom rules
1---2name: privacy-mask3description: Mask and redact sensitive information (PII) in screenshots and images before analysis — phone numbers, emails, IDs, API keys, crypto wallets, credit cards, passwords, and more. Uses OCR (Tesseract / EasyOCR) to detect private data and applies redaction overlays. All processing is 100% local and offline — no data leaves your machine. Use when receiving screenshots that may contain private data, or when the user mentions privacy / masking / redacting / PII removal / sensitive data protection.4---56# Privacy Mask78Detect and mask sensitive information in images locally before they leave your machine.910## When to use1112- User sends a screenshot that may contain private data13- User mentions privacy, masking, or redacting14- You need to analyze an image but want to redact sensitive info first1516## Quick start1718```bash19pip install privacy-mask20privacy-mask install # one-time: sets up global Claude Code hook21```2223After install, all images are automatically masked before upload. No further action needed.2425## Manual usage2627Mask an image:28```bash29privacy-mask mask <image_path>30privacy-mask mask <image_path> --in-place31privacy-mask mask <image_path> --dry-run # detect only32```3334Output is JSON:35```json36{37 "status": "success",38 "detections": [{"label": "PHONE_CN", "text": "***", "bbox": [10, 20, 100, 30]}],39 "summary": "Masked 1 regions: 1 PHONE_CN"40}41```4243## What it detects (47 rules)4445- **IDs**: Chinese ID card, passport, HK/TW ID, US SSN, UK NINO, Canadian SIN, Indian Aadhaar/PAN, Korean RRN, Singapore NRIC, Malaysian IC46- **Phone**: Chinese mobile/landline, US phone, international (+prefix)47- **Financial**: Bank card, Amex, IBAN, SWIFT/BIC48- **Developer keys**: AWS, GitHub, Slack, Google, Stripe tokens, JWT, connection strings, API keys, SSH/PEM keys49- **Crypto**: Bitcoin, Ethereum wallet addresses50- **Other**: Email, birthday, IP/IPv6, MAC, UUID, license plate, MRZ, URL auth tokens5152## Important5354- All processing is **local and offline** — no data leaves the machine55- The hook intercepts images **before** upload to cloud API56- Configure rules in the bundled `config.json` or pass `--config` for custom rules