Intercept, analyze, and redact PII/secrets before pasting into AI assistants (ChatGPT, Gemini, etc.)
π Documentation Website | π GitHub Wiki
SafePaste is a privacy-first Chrome extension that uses aggressive client-side PII detection to identify and redact sensitive information before it reaches AI text areas. It gives users granular control over what gets pasted, with an opt-in keyboard shortcut for maximum privacy.
When using AI assistants like ChatGPT or Google Gemini, users often paste sensitive information (phone numbers, emails, credit cards, API keys, passwords, etc.). This data is sent to third-party AI services, potentially violating privacy regulations (GDPR, HIPAA, etc.) and creating security risks.
SafePaste acts as a privacy firewall between your clipboard and AI assistants:
- Opt-in via Keyboard Shortcut: Use
Ctrl+Alt+V(orCmd+Alt+Von Mac) to trigger SafePaste - Aggressive Detection: Comprehensive regex patterns detect 25+ types of sensitive data
- Client-side Processing: All detection happens locally in your browser
- Granular Control: Three paste options - Mask All, Paste Original, or Custom Select
- 100% Local: No external API calls, no data transmission, no storage
β
Opt-in design - Normal paste (Ctrl+V) works normally
β
25+ entity types detected - Phone, email, credit cards, API keys, passwords, private keys, and more
β
100% local processing - All detection happens in your browser
β
No external libraries - Self-contained detection logic for maximum security
β
Chrome Web Store compliant - Self-contained, minimal permissions
β
Granular control - Choose which entities to redact via Custom Select
- Node.js 20+ and npm
- Chrome/Chromium browser
# 1. Clone the repository
git clone https://github.com/gautamjkr/safe-paste.git
cd safe-paste
git checkout main
# 2. Install dependencies
npm install
# 3. Build the extension
npm run build- Open
chrome://extensions/ - Enable Developer mode (top right)
- Click Load unpacked
- Select the
distfolder
| Shortcut | Action |
|---|---|
Ctrl+V / Cmd+V |
Normal paste (works as usual) |
Ctrl+Alt+V / Cmd+Alt+V |
SafePaste (triggers PII detection) |
- Navigate to ChatGPT (
chatgpt.com) or Gemini (gemini.google.com) - Click in a text area to focus it
- Copy content containing PII to your clipboard
- Press
Ctrl+Alt+V(orCmd+Alt+Von Mac) to trigger SafePaste - Ghost Overlay appears showing detected entities
- Choose:
- Paste Masked: Redact all detected entities
- Paste Original: No redaction
- Custom Select: Choose which entities to redact
Input:
My phone number is +1-555-123-4567.
Email: [email protected]
Credit card: 4532-1234-5678-9010
Masked Output:
My phone number is <PHONE_NUMBER_1>.
Email: <EMAIL_ADDRESS_1>
Credit card: <CREDIT_CARD_1>
The aggressive PII detector can identify 25+ types of sensitive information:
Personal Information: Phone numbers, emails, SSNs, passport numbers, driver licenses, dates of birth, person names
Financial Information: Credit cards, bank accounts, IBANs, SWIFT codes, Bitcoin/Ethereum addresses
Network & System: IP addresses (IPv4/IPv6), MAC addresses, URLs
Security & Authentication: API keys (Stripe, AWS, Google), passwords, JWT tokens, AWS keys, private keys (RSA, DSA, EC, OpenSSH, PGP)
Other: UUIDs, dates, locations (addresses, ZIP codes, coordinates)
π For detailed information about the detection engine, see the GitHub Wiki
β
Opt-in keyboard shortcut for SafePaste
β
Aggressive PII detection with 25+ entity types
β
100% local processing in your browser
β
Never sends data to external servers
β
Never stores data in databases
β
No external libraries - self-contained
β
Chrome Web Store compliant
β Intercept normal paste operations
β Store raw secrets or PII
β Send data to third-party services
β Make external API calls
β Require backend infrastructure
β Track user behavior
safepaste/
βββ src/
β βββ contentScript.tsx # Main content script
β βββ piiDetector.ts # Client-side PII detection
β βββ background.ts # Background service worker
β βββ overlayMount.tsx # Overlay mounting logic
β βββ overlay/
β βββ GhostOverlay.tsx # Overlay UI component
βββ dist/ # Built extension
βββ manifest.json
βββ package.json
npm run dev # Development mode (watch for changes)
npm run build # Build for production- Extension: React 18, TypeScript, Vite, Tailwind CSS
- PII Detection: Client-side regex patterns and heuristics
- Build Tool: Vite
Extension not working?
- Check extension is enabled in
chrome://extensions - Verify you're on a supported site (
chatgpt.comorgemini.google.com) - Use
Ctrl+Alt+V(not justCtrl+V) - Check browser console for errors (F12)
Detection not working?
- The detector uses aggressive patterns and may have false positives
- Very short or unusual formats may not be detected
- Prioritizes privacy protection over perfect accuracy
- π Documentation Website - Complete documentation and examples
- π GitHub Wiki - Technical details, detection engine, and architecture
- π Report Issues - Found a bug? Let us know!
This project is licensed under the MIT License - see the LICENSE file for details.
- Support for more AI platforms (Claude, Perplexity, etc.)
- Custom entity recognizers (user-defined patterns)
- Multi-language support
- Browser extension for Firefox/Edge
- Configurable detection sensitivity levels
Built with π for privacy-first AI interactions.
