A Local-First AI Privacy Firewall for Windows.
CleanPrompt is a floating, OS-level gateway that sanitizes your text before you paste it into ChatGPT, Claude, or Gemini. It runs 100% locally, using Microsoft Presidio and Regex to detect and mask sensitive data like PII, API Keys, and Personal Names.
- 100% Offline: No data leaves your device until you choose to paste it.
- Floating UI: Always-on-top window accessible via Global Hotkey.
- Intelligent Sanitization: Uses Microsoft Presidio (AI) to detect names, locations, and phones.
- Strict Secrets Detection: Uses Regex to catch API Keys (OpenAI, AWS), Emails, and IPs.
- Magic Paste: Sanitizes text and auto-inserts it into your active app (Browser/IDE).
- Glassy UI: Modern, transparent interface with Dark/Light mode support.
- Python 3.10+ installed.
git clone https://github.com/Dhruvil-8/CleanPrompt.git cd CleanPrompt
python -m venv venv Windows: venv\Scripts\activate Mac/Linux: source venv/bin/activate
pip install -r requirements.txt
This tool uses the Spacy "Large" English model (approx 400MB) for high-accuracy detection. python -m spacy download en_core_web_lg
python main.py
Open/Close: Press Ctrl + Shift + Space anywhere in Windows. Sanitize: Paste your text into the window. Click "Sanitize & Insert" (or press Ctrl + Enter). Result: The window disappears, and the safe version of your text is pasted into your browser.
Raw Input,CleanPrompt Output """Email john@test.com about the sk-12345 key.""","""Email about the <OPENAI_KEY>."""
If you want to create a portable .exe Install PyInstaller: pip install pyinstaller
Run the build command: pyinstaller build_app.spec --clean --noconfirm
Logging: Disabled by default in production builds. Clipboard: The app accesses the clipboard only when requested to copy/paste. Network: The app makes zero network calls.
- Probabilistic Detection: The tool uses the Microsoft Presidio engine and Spacy (en_core_web_lg). While accurate, it is probabilistic. It may occasionally miss non-standard names, obscure locations, or highly ambiguous text.
- Regex Scope: API key detection relies on specific patterns (e.g., standard OpenAI
sk-keys or AWS IDs). It may not detect proprietary keys from other services or generic high-entropy strings that do not match the defined rules. - Contextual Understanding: Unlike an LLM, this tool does not understand the "intent" of a sentence. It identifies entities based on syntax and pattern matching only.
- Platform Support: The current release is optimized for Windows 10/11. The global hotkey listener and auto-paste functionality may require code modifications to function correctly on macOS or Linux (Wayland).
- Privileged Applications: The "Magic Paste" feature simulates keystrokes. It may not function if the target application is running with higher administrative privileges than CleanPrompt.
This project is licensed under the MIT License