๐ก๏ธ Pre-Publish Security Gate
A security-first content sanitization system that scans, classifies, and redacts sensitive information before public sharing.
- ๐ Smart Detection - Rule-based engine with 40+ patterns for sensitive information
- ๐ฏ Risk Classification - Three-tier system (P0/P1/P2) for graded response
- ๐จ Pixelation Masking - Mosaic-style masking for effective redaction
- ๐ Detailed Reports - Markdown and JSON outputs for audit trails
- ๐ Fast Processing - ~1000 lines/second for text scanning
- ๐ก๏ธ Privacy First - All processing done locally, no external requests
Perfect for:
- ๐ธ Screenshots - Code, terminal, chat logs before sharing
- ๐ Documents - Logs, configs, documentation before publishing
- ๐ฌ Messages - Forum posts, emails, chat messages
- ๐ Security Reviews - Pre-publication security audits
# Clone the repository
git clone https://github.com/ijerrywong/safe-share.git
cd safe-share
# Install dependencies
pip install -r requirements.txt
# Install tesseract OCR (required for image scanning)
# macOS
brew install tesseract
# Ubuntu/Debian
sudo apt-get install tesseract-ocr
# Windows
# Download from https://github.com/UB-Mannheim/tesseract/wiki```bash
# Scan a text file
python3 main.py --file config.txt
# Scan an image
python3 main.py --file screenshot.png
# Verbose mode
python3 main.py --file screenshot.png --verbose
# Different security modes
python3 main.py --file screenshot.png --mode strict # Maximum protection
python3 main.py --file screenshot.png --mode balanced # Balance
python3 main.py --file screenshot.png --mode relaxed # MinimalTo use as an OpenClaw skill, copy the skill file to your skills directory:
# Find your OpenClaw skills directory (usually ~/.openclaw/skills/)
# Create the directory if it doesn't exist
mkdir -p ~/.openclaw/skills/
# Copy the skill file
cp SKILL.md ~/.openclaw/skills/safe-share.md
# Or for Chinese version
cp SKILL_CN.md ~/.openclaw/skills/safe-share-cn.mdThen you can use it directly in OpenClaw:
Scan this file for sensitive information before sharing
Or:
Use safe-share to check this screenshot
After scanning, Safe Share generates:
outputs/
โโโ redacted_<filename> # Masked content (image or text)
โโโ risk_report.md # Human-readable audit report
โโโ findings.json # Machine-readable detection data
- API keys & tokens
- Database passwords
- Personal data (phone, email, SSN)
- Private keys & certificates
- File paths (.env, .ssh, secrets/)
- Local services (127.0.0.1:5000)
- Database usernames
- Infrastructure URLs
- Project names
- Device information
- Business context
See RULES.md for complete pattern list.
| Style | Description | Use Case |
|---|---|---|
pixelate |
Mosaic/blur blocks | Default, recommended |
black |
Solid black bars | High contrast needed |
red |
Solid red bars | Warning emphasis |
blur |
Gaussian blur | Softer redaction |
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest tests/
# Run linting
black utils/ main.pyContributions are welcome! Please read CONTRIBUTING.md for details.
| Input Type | Speed | Memory |
|---|---|---|
| Text (1000 lines) | ~1s | <50MB |
| Image (1920x1080) | ~6s | <100MB |
Safe Share uses automated pattern matching. While it catches many common patterns, it may have:
- False positives (safe content flagged as sensitive)
- False negatives (sensitive content not detected)
Always review the output manually before sharing content.
MIT License - see LICENSE for details.
- Built with Pillow for image processing
- Uses tesseract-ocr for OCR
- Pattern matching powered by PyYAML
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: ijerrywong@gmail.com
โญ Star us on GitHub!
Made with โค๏ธ by JerryWong