Skip to content

gni/redac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ Redac

A lightweight PII (Personally Identifiable Information) moderation MVP designed to sanitize sensitive data before it reaches LLM APIs.

🚀 Key Features

  • Multi-Language Support: High-accuracy detection for English and French using spaCy Large models.
  • Double-Pass Protection: Combines NLP-based detection with expert Regex patterns for PII coverage.
  • Expert French Recognizers: Built-in support for French-specific data: SIRET, NIR (Social Security), IBAN, and addresses.
  • Balanced Anonymization: Preserves job titles and document structure to keep texts readable.
  • Minimal Dashboard: React-based UI with Risk Assessment visualization.
  • Custom Theme UI: Switch between Premium, Minimal Light, and Deep Midnight modes.

🎥 Demo

Check out Redac in action:

Redac Demo Video

Click to watch the full demo on YouTube


🛠️ Architecture

  1. Core API (/api): FastAPI server powered by Microsoft Presidio.
  2. Web Dashboard (/ui): React + Vite + Tailwind CSS.

📦 Getting Started (Docker)

Quick Start with Makefile

If you have make installed, you can use these shortcuts:

make build   # Build containers
make up      # Start Redac
make logs    # View logs
make test    # Run tests

Manual Docker commands

docker compose up --build
  • API: http://localhost:8000
  • UI Dashboard: http://localhost:5173

🔌 API Usage

You can interact directly with the Redac API using curl.

Redact Text

Request:

curl -X POST http://localhost:8000/redact \
     -H "Content-Type: application/json" \
     -d '{"text": "My name is John Doe, call me at 06 12 34 56 78."}'

Response (JSON):

{
  "original_text": "My name is John Doe, call me at 06 12 34 56 78.",
  "redacted_text": "My name is <PERSON>, call me at <PHONE_NUMBER>.",
  "detected_language": "en",
  "entities": [
    {
      "type": "PERSON",
      "text": "John Doe",
      "score": 85,
      "start": 11,
      "end": 19
    },
    {
      "type": "PHONE_NUMBER",
      "text": "06 12 34 56 78",
      "score": 95,
      "start": 32,
      "end": 46
    }
  ]
}

🧪 Quality Assurance

Using Makefile

make test

Manual Docker

# Run the test suite
docker compose run api python tests/verify_all.py

📄 License

MIT - Created for secure LLM workflows.

About

Lightweight PII redaction and risk assessment tool for secure LLM workflows. Protects sensitive data using NLP-based detection and expert regex patterns.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors