Detect and Mask Sensitive Data in Images Locally
Privacy Mask detects and redacts sensitive information in images locally before they leave your machine, supporting IDs, phone numbers, financial data, and API
Why it matters
Protect privacy by automatically detecting and redacting personally identifiable information, credentials, and sensitive data from screenshots and images before they leave your machine or are shared with external services.
Outcomes
What it gets done
Scan images for PII including IDs, phone numbers, emails, addresses, and financial data across multiple countries
Detect developer secrets like API keys, tokens, connection strings, SSH keys, and crypto wallet addresses
Run dry-run detection to preview sensitive information before masking
Generate masked versions of images with redacted regions while preserving originals
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-privacy-mask | bash Overview
Privacy Mask
Privacy Mask detects and masks sensitive information in images locally, scanning for IDs, phone numbers, financial data, developer keys, crypto addresses, and other PII. With optional NER support, it also identifies person names, addresses, organizations, dates of birth, and medical conditions. Use Privacy Mask when users send screenshots or images that may contain private data, when they mention privacy or redacting, or when you need to analyze an image but must redact sensitive info first. Always run detection before sharing images externally.
What it does
Privacy Mask is a local image redaction skill that detects and masks sensitive information in screenshots and images before they leave your machine. It scans for personally identifiable information (PII), credentials, and financial data, then outputs a masked version of the image with all detections redacted.
When to use - and when NOT to
Use Privacy Mask when a user sends a screenshot or image file (.png, .jpg, .jpeg, .bmp, .tiff) that may contain private data, when they mention privacy, masking, redacting, or anonymizing, or when you need to analyze an image but want to redact sensitive info first. If a user shares a screenshot for debugging, run privacy-mask mask <path> --dry-run first to check for PII; if detections are found, mask the image before proceeding with analysis.
Do NOT use this skill on very large images (>10MB) without warning the user about processing time. Do NOT send unmasked images to any external API or cloud service. Do NOT skip masking when detections are found - always mask before sharing.
Inputs and outputs
Users provide an image file path and optional flags (--dry-run for detection only, --in-place to modify the original, --detection-engine regex to skip NER, or --config for custom rules). The skill returns JSON output with detection results:
{
"status": "success",
"detections": [{"label": "PHONE_CN", "text": "***", "bbox": [10, 20, 100, 30]}],
"summary": "Masked 1 regions: 1 PHONE_CN"
}
Unless --in-place is specified, the original image is preserved.
What it detects
Privacy Mask identifies IDs (Chinese ID card, passport, HK/TW ID, US SSN, UK NINO, Canadian SIN, Indian Aadhaar/PAN, Korean RRN, Singapore NRIC, Malaysian IC), phone numbers (Chinese mobile/landline, US phone, international), financial data (bank card, Amex, IBAN, SWIFT/BIC), developer keys (AWS, GitHub, Slack, Google, Stripe tokens, JWT, connection strings, API keys, SSH/PEM keys), crypto wallet addresses (Bitcoin, Ethereum), and other sensitive data (email, birthday, IP/IPv6, MAC, UUID, license plate, MRZ, URL auth tokens). With optional NER support, it also detects person names, street addresses, organizations, dates of birth, and medical conditions.
Prerequisites and installation
This skill requires the privacy-mask CLI pre-installed on the system. Install via pip: pip install privacy-mask. Ensure Tesseract OCR is installed: brew install tesseract (macOS) or apt install tesseract-ocr (Linux). Verify installation: privacy-mask --version. For NER support, install: pip install privacy-mask[ner].
Usage examples
privacy-mask mask /path/to/screenshot.png
privacy-mask mask /path/to/screenshot.png --in-place
privacy-mask mask /path/to/screenshot.png --dry-run
privacy-mask mask /path/to/screenshot.png --detection-engine regex
privacy-mask mask /path/to/screenshot.png --config /path/to/custom-config.json
Who it's for
Privacy Mask is for developers, security engineers, and support teams who need to share screenshots containing sensitive data without exposing PII or credentials. It is ideal for debugging workflows where images must be analyzed but cannot be sent to external services unredacted. All processing is local and offline - no data leaves the machine.
Source README
Prerequisites
This skill requires the privacy-mask CLI to be pre-installed on the system.
If it is not available, inform the user that they need to install it first:
- Install via pip:
pip install privacy-mask - Ensure Tesseract OCR is installed:
brew install tesseract(macOS) orapt install tesseract-ocr(Linux) - Verify installation:
privacy-mask --version - (Optional) Install NER support:
pip install privacy-mask[ner]
When to use
- User sends a screenshot or image file (
.png,.jpg,.jpeg,.bmp,.tiff) that may contain private data - User mentions privacy, masking, redacting, or anonymizing
- You need to analyze an image but want to redact sensitive info first
- IF the user shares a screenshot for debugging, THEN run
privacy-mask mask <path> --dry-runfirst to check for PII - IF detections are found, THEN mask the image before proceeding with analysis
Usage
Mask an image:
privacy-mask mask /path/to/screenshot.png
privacy-mask mask /path/to/screenshot.png --in-place
privacy-mask mask /path/to/screenshot.png --dry-run # detect only, no masking
privacy-mask mask /path/to/screenshot.png --detection-engine regex # regex only, skip NER
privacy-mask mask /path/to/screenshot.png --config /path/to/custom-config.json
Output is JSON:
{
"status": "success",
"detections": [{"label": "PHONE_CN", "text": "***", "bbox": [10, 20, 100, 30]}],
"summary": "Masked 1 regions: 1 PHONE_CN"
}
Example workflow
- User provides a screenshot:
~/Desktop/error-screenshot.png - Run detection:
privacy-mask mask ~/Desktop/error-screenshot.png --dry-run - IF detections found, mask the image:
privacy-mask mask ~/Desktop/error-screenshot.png - The masked output is saved as
~/Desktop/error-screenshot_masked.png - Use the masked image for further analysis
What it detects
- 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
- NER (optional): Person names, street addresses, organizations, dates of birth, medical conditions
Constraints
- Do NOT send unmasked images to any external API or cloud service
- Do NOT skip masking when detections are found - always mask before sharing
- Do NOT modify the original image unless
--in-placeis explicitly requested - Avoid running on very large images (>10MB) without warning the user about processing time
Anti-patterns
- Don't assume images are safe - always run detection even if the image "looks clean"
- Don't use
--in-placeby default - preserve the original unless the user asks otherwise - Don't ignore dry-run results - if
--dry-runfinds PII, the image must be masked before use - Don't hardcode config paths - use the bundled default or let the user specify
--config
Important
- All processing is local and offline - no data leaves the machine
- Configure rules in the bundled
config.jsonor pass--configfor custom rules
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.