Skip to content

aparimeet/prompt-redaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Prompt Redaction Tool

Automatically detect and redact sensitive information from AI prompts before sharing them.

Quick Start

# Install dependencies
npm install

# Run the development server
npm start

Open http://localhost:3000 in your browser.

Features

Real-time redaction - See changes as you type
🎯 Smart pattern detection - Configurable detection patterns
📁 File upload - Import text files for redaction
👁️ Show/hide toggle - Compare original vs redacted text
📋 One-click copy - Copy redacted text to clipboard
💾 Download - Save redacted text as a file
🎨 Modern UI - Clean, responsive design

How to Use

  1. Input your text - Paste directly or upload a .txt file
  2. Configure patterns - Toggle detection patterns on/off in the left sidebar
  3. Add custom patterns - Use regex for organization-specific data
  4. Review detection - See what was found in the "Detected Items" panel
  5. Toggle view - Switch between original and redacted text
  6. Export - Copy to clipboard or download as file

What It Detects

  • Email Addresses[EMAIL_REDACTED]
  • Phone Numbers[PHONE_REDACTED]
  • Credit Card Numbers[CC_REDACTED]
  • Social Security Numbers[SSN_REDACTED]
  • IP Addresses[IP_REDACTED]
  • URLs[URL_REDACTED]
  • API Keys (Generic)[API_KEY_REDACTED]
  • Names (Common Patterns)[NAME_REDACTED] (disabled by default)

Test Example

Hi! I'm John Smith ([email protected], 555-123-4567). 
Our API key is sk_live_abc123def456 and the server is at https://api.example.com.
Customer paid with card 4532-1234-5678-9012, SSN 123-45-6789.

Redacted output:

Hi! I'm [NAME_REDACTED] ([EMAIL_REDACTED], [PHONE_REDACTED]). 
Our API key is [API_KEY_REDACTED] and the server is at [URL_REDACTED].
Customer paid with card [CC_REDACTED], SSN [SSN_REDACTED].

Custom Patterns

Add your own regex patterns for organization-specific data:

  • \bPROJ-\d{4}\b for project codes like "PROJ-1234"
  • \bEMP\d{6}\b for employee IDs like "EMP123456"
  • \b[A-Z]{3}-[0-9]{3}\b for custom formats like "ABC-123"

Technology Stack

  • React 18 - Modern React with hooks
  • Tailwind CSS - Utility-first CSS framework
  • Lucide React - Beautiful icons
  • Create React App - Zero-config build setup

Important

⚠️ Always review the output manually - This tool uses pattern matching and may not catch all sensitive information or context-specific data. Consider manual review for highly sensitive content.

About

A tool for redacting sensitive data in AI prompts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published