Skip to content

Dhruvil-8/CleanPrompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CleanPrompt

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.

Python Privacy


Features

  • 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.

Installation (Run from Source)

Prerequisites

  • Python 3.10+ installed.

1. Clone the Repo

git clone https://github.com/Dhruvil-8/CleanPrompt.git cd CleanPrompt

2. Setup Virtual Environment

python -m venv venv Windows: venv\Scripts\activate Mac/Linux: source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Download AI Model

This tool uses the Spacy "Large" English model (approx 400MB) for high-accuracy detection. python -m spacy download en_core_web_lg

5. Run the App

python main.py

How to Use

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>."""

Building the EXE (Windows)

If you want to create a portable .exe Install PyInstaller: pip install pyinstaller

Run the build command: pyinstaller build_app.spec --clean --noconfirm

Security

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.

Limitations

  • 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.

License

This project is licensed under the MIT License

About

CleanPrompt is a floating, OS-level gateway that sanitizes your text before you paste it into LLM It runs 100% locally, using Microsoft Presidio and Regex to detect and mask sensitive data like PII, API Keys, and Personal Names.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages