Skip to content

Latest commit

ย 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Presidio Browser Anonymizer

๐Ÿ” Presidio Browser Anonymizer

Chrome Extension + Local Backend - Auto-anonymize PII when pasting text!

Automatically anonymize personal data when pasting into ChatGPT, Claude, Perplexity, Gmail, and any website.
Powered by Microsoft Presidio. Works 100% locally - no data leaves your computer.

License Python Chrome Extension Version Manifest V3

๐Ÿ‡ต๐Ÿ‡ฑ Polski przewodnik dla kaลผdego โ€ข Features โ€ข Installation โ€ข How It Works โ€ข Documentation


โœจ Features

๐Ÿ†• New in v1.4.0:

  • ๐ŸชŸ Windows one-click - Uruchom-Windows.bat: installs everything (incl. Python) and starts the backend with a double-click; Autostart-Windows.bat for start-at-login. Guide for non-technical users: WINDOWS.md
  • ๐Ÿ”Œ New default port 6677 - unified across backend, extension and docs (configurable via PRESIDIO_PORT)
  • ๐Ÿ› Send-button fix - fixed an infinite anonymize/click loop when intercepting send buttons
  • ๐Ÿ”’ No PII in console - extension logs no longer print clipboard/text fragments

v1.3.x:

  • ๐Ÿ”˜ Toggle ON/OFF - Enable/disable auto-anonymization with one click in extension popup
  • ๐Ÿ“Š Dashboard Logs - View history: original โ†’ anonymized text with timestamps
  • ๐Ÿš€ Chrome Web Store Ready - Manifest V3 compliant, ready for publication

Core Features:

  • โšก Auto-Paste Anonymization - Automatically anonymizes when you paste (Ctrl+V) anywhere!
  • ๐ŸŽฏ Works on AI Sites - ChatGPT, Claude, Perplexity, Gemini - 100% reliable PASTE method
  • โœ… Zero configuration - One-click installation scripts for Windows/Mac/Linux
  • ๐Ÿ”’ 100% offline - Everything runs locally, no data leaves your machine
  • ๐Ÿ† Microsoft Presidio - Professional PII detection engine
  • ๐Ÿ“‹ 28 entity types - PESEL, NIP, REGON, emails, phones, credit cards, passports, IDs
  • ๐Ÿ‡ต๐Ÿ‡ฑ Polish language optimized - Native support for Polish PII
  • ๐ŸŒ Works everywhere - ChatGPT, Claude, Gmail, forms, content-editable fields
  • ๐Ÿ“Š Web Dashboard - Real-time monitoring, testing, and logs

๐Ÿš€ Quick Installation

๐Ÿ‡ต๐Ÿ‡ฑ PROSTY PRZEWODNIK PO POLSKU: JAK-ZACZฤ„ฤ†.md - Instrukcja krok po kroku dla kaลผdego!

๐Ÿ“– Full Documentation: INSTALLATION.md - Complete step-by-step guide with troubleshooting

Option 1: Automatic Installation (Recommended)

Windows (no technical knowledge needed!)

๐ŸชŸ Nie znasz siฤ™ na komputerach? Zobacz WINDOWS.md โ€” instalacja w 3 krokach, bez gita i terminala.

  1. Download ZIP: green Code button โ†’ Download ZIP โ†’ extract
  2. Double-click Uruchom-Windows.bat โ€” first run installs everything (auto-installs Python if missing), then starts the backend and opens the dashboard
  3. Optional: double-click Autostart-Windows.bat to start the backend automatically at login

Or via git:

git clone https://github.com/gacabartosz/presidio-local-anonymizer
cd presidio-local-anonymizer
Uruchom-Windows.bat

macOS

git clone https://github.com/gacabartosz/presidio-local-anonymizer
cd presidio-local-anonymizer
chmod +x install-mac.sh
./install-mac.sh

Linux

git clone https://github.com/gacabartosz/presidio-local-anonymizer
cd presidio-local-anonymizer
chmod +x install-linux.sh
./install-linux.sh

Option 2: Install Chrome Extension

  1. Open Chrome: chrome://extensions/
  2. Enable "Developer mode" (top-right toggle)
  3. Click "Load unpacked" โ†’ select chrome-extension/ folder
  4. Done! Extension is now installed

Option 3: Start Backend Manually

cd backend
source .venv/bin/activate  # Windows: .venv\Scripts\activate
python app.py

Backend runs at: http://localhost:6677


๐ŸŽฏ How It Works

๐ŸŒŸ PASTE Method (Best!)

  1. Copy text with PII:

    Jan Kowalski, email: jan@example.com, PESEL: 92010212345
    
  2. Paste anywhere (Ctrl+V):

    • ChatGPT prompt
    • Claude conversation
    • Perplexity query
    • Gmail compose
    • Any form field
  3. Text automatically anonymized:

    [OSOBA], email: [EMAIL], PESEL: [PESEL]
    

Alternative Methods

Keyboard Shortcut: Select text โ†’ Press Ctrl+Shift+A (Mac: Cmd+Shift+A)

Context Menu: Select text โ†’ Right-click โ†’ "Anonimizuj zaznaczony tekst"

Extension Toggle: Click extension icon โ†’ Toggle ON/OFF


๐Ÿ“Š Web Dashboard

Open in browser: http://localhost:6677/dashboard

Dashboard

Dashboard features:

  • โœ… Service status - Backend online/offline indicator
  • ๐Ÿ“Š Statistics - Requests, detected entities, processing time
  • ๐Ÿงช Live testing - Test anonymization without extension
  • ๐Ÿ“‹ Activity logs - See original โ†’ anonymized history (last 100 entries)
  • ๐Ÿ”‘ Entity management - Enable/disable specific PII types

๐Ÿ”’ Detected Data Types

๐Ÿ‡ต๐Ÿ‡ฑ Polish Data (Default: Enabled):

Type Example Mask Confidence
EMAIL jan@example.com [EMAIL] 100%
PL_PESEL 92010212345 [PESEL] 95-100%
PL_NIP 123-456-78-90 [NIP] 90-100%
PL_REGON 123456789 [REGON] 85-95%
PL_PASSPORT AB1234567 [PASZPORT_PL] 90-100%
PL_ID_CARD ABC123456 [DOWOD_PL] 90-100%
PHONE_NUMBER +48 123 456 789 [TELEFON] 85-100%
CREDIT_CARD 4532-1234-5678-9010 [KARTA] 95-100%
IBAN_CODE PL61109010140000071219812874 [IBAN] 100%
IP_ADDRESS 192.168.1.1 [IP] 100%
URL https://example.com [URL] 90-100%
DATE_TIME 2024-12-10 [DATA] 80-95%
LOCATION Warsaw [LOKALIZACJA] 70-90%

๐ŸŒ International Data (Default: Disabled):

Type Example Mask Country
US_SSN 123-45-6789 [SSN] ๐Ÿ‡บ๐Ÿ‡ธ USA
US_PASSPORT 123456789 [PASZPORT_US] ๐Ÿ‡บ๐Ÿ‡ธ USA
US_BANK_NUMBER 123456789 [BANK_US] ๐Ÿ‡บ๐Ÿ‡ธ USA
US_DRIVER_LICENSE D1234567 [PRAWO_JAZDY_US] ๐Ÿ‡บ๐Ÿ‡ธ USA
UK_NHS 123 456 7890 [NHS] ๐Ÿ‡ฌ๐Ÿ‡ง UK
AU_ABN 12 345 678 901 [ABN] ๐Ÿ‡ฆ๐Ÿ‡บ Australia
SG_NRIC_FIN S1234567D [NRIC_SG] ๐Ÿ‡ธ๐Ÿ‡ฌ Singapore

๐Ÿ” Other Data:

Type Example Mask Default
PERSON Jan Kowalski [OSOBA] โŒ OFF
CRYPTO 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa [CRYPTO] โŒ OFF
MEDICAL_LICENSE MD123456 [LICENCJA_MED] โŒ OFF

Total: 28 PII entity types!

Configure in Dashboard: http://localhost:6677/dashboard โ†’ Ustawienia


๐Ÿงช Testing

Test on ChatGPT:

  1. Open https://chatgpt.com
  2. Copy test text:
    Jan Kowalski, PESEL: 92010212345, email: jan@example.com, tel: +48 123 456 789
    
  3. Paste (Ctrl+V) into ChatGPT
  4. โœ… See result: [OSOBA], PESEL: [PESEL], email: [EMAIL], tel: [TELEFON]

Test on Dashboard:

  1. Open http://localhost:6677/dashboard
  2. Navigate to "Test" section
  3. Paste test text and click "Anonymize"
  4. See results with entity detection details

Check Logs:

  1. Open http://localhost:6677/dashboard
  2. Click "Logi" in navigation
  3. See history: original โ†’ anonymized (last 100 entries)

More testing guides: TESTING.md


๐Ÿ“š Documentation

User Guides:

  • ๐Ÿ“– README-USER.md - Quick start guide for users (co zostaล‚o zrobione)
  • ๐Ÿค– AI-SITES-GUIDE.md - Complete guide for ChatGPT, Claude, Perplexity
  • ๐Ÿงช TESTING.md - Comprehensive testing and debugging instructions
  • ๐Ÿ’พ INSTALLATION.md - Detailed installation guide with troubleshooting

Developer / Publishing:

Test Page:


๐Ÿช Chrome Web Store

Status: Ready for Publication! โœ…

The extension is fully compliant with Chrome Web Store requirements:

  • โœ… Manifest V3
  • โœ… All icons (16, 32, 48, 128px)
  • โœ… Privacy Policy published
  • โœ… Specific host permissions (no wildcards)
  • โœ… Description within 132 character limit

Latest Release: presidio-extension-v1.3.2.zip (30KB)

Publication Guide: See CHROME-WEB-STORE.md for step-by-step instructions.


๐Ÿ› Troubleshooting

Extension shows "Offline" or "Disconnected"

Problem: Backend not running.

Solution:

# Start backend
cd backend
source .venv/bin/activate
python app.py

Then reload extension:

  1. Open chrome://extensions/
  2. Find "Presidio Browser Anonymizer"
  3. Click ๐Ÿ”„ Reload button

Text not anonymizing on paste

Check:

  1. โœ… Extension toggle is ON (click extension icon)
  2. โœ… Backend is running (dashboard shows "online")
  3. โœ… Using PASTE method (Ctrl+V) - most reliable!
  4. โœ… Extension is reloaded after any changes

Debug:

  • Open DevTools (F12) โ†’ Console
  • Look for [Presidio] logs
  • Check backend terminal for API requests

Where to check logs?

Content Script Logs (webpage):

  • F12 โ†’ Console
  • Look for: [Presidio] Paste event detected

Background Service Worker:

  • chrome://extensions/ โ†’ Find extension โ†’ "service worker"
  • Look for: [Presidio Background] Anonymization successful

Backend Logs:

  • Terminal where backend runs
  • Look for: POST /api/anonymize with status 200

๐Ÿ“ฆ Project Structure

presidio-local-anonymizer/
โ”œโ”€โ”€ backend/                    # Flask API (localhost:6677)
โ”‚   โ”œโ”€โ”€ app.py                 # Main server
โ”‚   โ”œโ”€โ”€ api/                   # REST endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ anonymize.py       # Anonymization + logs API
โ”‚   โ”‚   โ”œโ”€โ”€ health.py          # Health check
โ”‚   โ”‚   โ””โ”€โ”€ entities.py        # Entity management
โ”‚   โ”œโ”€โ”€ core/                  # Presidio integration
โ”‚   โ”‚   โ”œโ”€โ”€ analyzer.py        # PII detection
โ”‚   โ”‚   โ””โ”€โ”€ anonymizer.py      # PII anonymization
โ”‚   โ””โ”€โ”€ config/                # Configuration
โ”‚
โ”œโ”€โ”€ chrome-extension/          # Browser Extension (Manifest V3)
โ”‚   โ”œโ”€โ”€ manifest.json          # Extension config
โ”‚   โ”œโ”€โ”€ background.js          # Service worker
โ”‚   โ”œโ”€โ”€ content-script.js      # Content injection
โ”‚   โ”œโ”€โ”€ popup.html/js          # Extension popup (toggle)
โ”‚   โ”œโ”€โ”€ options.html/js        # Settings page
โ”‚   โ””โ”€โ”€ icons/                 # Extension icons (16,32,48,128)
โ”‚
โ”œโ”€โ”€ web-ui/                    # Web Dashboard
โ”‚   โ”œโ”€โ”€ app.html               # Dashboard UI (logs, stats, test)
โ”‚   โ””โ”€โ”€ favicon.svg
โ”‚
โ”œโ”€โ”€ assets/                    # Branding
โ”‚   โ”œโ”€โ”€ logo.svg
โ”‚   โ”œโ”€โ”€ logo-banner.svg
โ”‚   โ””โ”€โ”€ icon.svg
โ”‚
โ””โ”€โ”€ docs/                      # Documentation
    โ”œโ”€โ”€ README-USER.md
    โ”œโ”€โ”€ AI-SITES-GUIDE.md
    โ”œโ”€โ”€ TESTING.md
    โ”œโ”€โ”€ INSTALLATION.md
    โ”œโ”€โ”€ CHROME-WEB-STORE.md
    โ”œโ”€โ”€ PRIVACY_POLICY.md
    โ””โ”€โ”€ SPRINT-REVIEW.md

๐Ÿ› ๏ธ Tech Stack

Backend:

  • Flask 3.0 - Lightweight web framework
  • Microsoft Presidio 2.2.354 - PII detection engine
  • SpaCy 3.7.2 - NLP for Polish language
  • Python 3.8+ - Modern Python

Extension:

  • Manifest V3 - Latest Chrome extension standard
  • Vanilla JavaScript - No framework bloat
  • Auto-connect to localhost - Zero configuration

Dashboard:

  • HTML/CSS/JavaScript - Simple, fast, responsive
  • Real-time updates - Live monitoring
  • No external dependencies - 100% self-contained

๐Ÿ”ง Requirements

  • Python 3.8+ (3.11 recommended)
  • Chrome/Edge browser (Manifest V3 support)
  • Operating System: macOS, Linux, or Windows
  • Disk space: ~500 MB (for SpaCy model)
  • RAM: Minimum 2GB, recommended 4GB+

โšก Performance

  • Detection: ~50-100ms per request
  • Anonymization: ~100-500ms (first call), ~50-100ms (cached)
  • Paste interception: Instant (< 10ms)
  • Memory: ~200MB (backend with SpaCy model)

๐Ÿ’ก FAQ

Q: Do I need to configure anything?

A: NO! Extension automatically connects to backend. Just install and use.

Q: Extension shows "Offline"?

A: Backend not running. Start: cd backend && source .venv/bin/activate && python app.py

Q: Text doesn't anonymize?

A: Check:

  1. Extension toggle is ON (click icon)
  2. Backend running (dashboard: http://localhost:6677/dashboard)
  3. Using PASTE method (Ctrl+V) - most reliable!

Q: Does it work on ChatGPT/Claude/Perplexity?

A: YES! Use PASTE method (Ctrl+V) - 100% reliable. See AI-SITES-GUIDE.md

Q: Where can I see what's happening?

A: Open dashboard: http://localhost:6677/dashboard

  • Real-time statistics
  • Activity logs (last 100 operations)
  • Test anonymization
  • Service status

Q: How do I enable/disable anonymization temporarily?

A: Click extension icon โ†’ Toggle ON/OFF. State persists across tabs.

Q: Can I publish this on Chrome Web Store myself?

A: YES! All files ready. See CHROME-WEB-STORE.md for instructions.

Q: Must I keep terminal open?

A: Yes, backend must run. You can minimize terminal or create a system service/alias.

Create alias in .bashrc or .zshrc:

alias presidio='cd /path/to/presidio-local-anonymizer/backend && source .venv/bin/activate && python app.py'

Then just: presidio ๐Ÿš€


๐Ÿค Contributing

Contributions welcome! Please follow these steps:

  1. Fork repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m "feat: add amazing feature"
  4. Push branch: git push origin feature/amazing-feature
  5. Open Pull Request

Code style:

  • Python: PEP 8
  • JavaScript: ESLint recommended
  • Commit messages: Conventional Commits

๐Ÿ“„ License

MIT License - see LICENSE

You are free to use, modify, and distribute this software.


๐Ÿ™ Credits

  • Microsoft Presidio - PII detection and anonymization engine
  • SpaCy - Industrial-strength NLP for Polish language support
  • Flask - Lightweight web framework
  • Claude Code - AI-powered development assistant

โš ๏ธ Disclaimer

This tool helps protect personal data, but:

  • โŒ Does NOT guarantee 100% detection of all PII
  • โŒ May produce false positives/negatives
  • โŒ Should not be solely relied upon for GDPR compliance

Always review anonymized text before sending to third parties.

For sensitive data, consider additional security measures.


๐Ÿ“ฎ Support & Community

Need help?

Star this repo if you find it useful! โญ


Made with โค๏ธ using Claude Code
Version 1.4.0 | Last Updated: July 2026

Get Started โ€ข Installation Guide โ€ข AI Sites Guide โ€ข Chrome Web Store

About

Real-time text anonymization for ChatGPT, Claude AI, and Perplexity using Microsoft Presidio. Browser extension + localhost backend API. 100% offline, zero configuration.

Topics

Resources

Stars

18 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages