Legal Redaction Tool
On-device redaction for contracts and case files
Lawyers and compliance teams redact contracts and case files without uploading them anywhere.
The problem
Legal teams want AI help with document review, but client files cannot leave the firm. Pattern-matching tools miss context, such as a party referred to only as "the buyer", and cloud LLMs are not allowed.
What we built
- A Tauri desktop app with a Rust backend for file handling, PDF text extraction, OCR with progress updates, and caching.
- A Rust rule engine for Chinese legal documents: names, parties, ID numbers, bank cards, phone numbers, email addresses, contract numbers and titles.
- A local Qwen3-4B model on Apple Silicon (MLX) that catches context-dependent details the rules miss.
- A side-by-side editor (original, redacted, compare) with per-paragraph navigation, labels, manual replacements and wildcard rules.
- A local SQLite library for files, custom entities, ignore lists and OCR results.
Decisions that mattered
The model cannot invent text
Every model suggestion must match the source text exactly and belong to an allowed entity type, or it is discarded.
No network path for documents
If the local model is missing or fails validation, the app falls back to its Rust rules. It never sends a document out.
Long documents in overlapping chunks
Text is processed in segments of up to 14,000 characters with a 1,000-character overlap, then results are merged.