Add Custom Redaction Rules (Block Words, Dates, Regex Patterns)#16
Merged
karant-dev merged 5 commits intomainfrom Dec 12, 2025
Merged
Add Custom Redaction Rules (Block Words, Dates, Regex Patterns)#16karant-dev merged 5 commits intomainfrom
karant-dev merged 5 commits intomainfrom
Conversation
Co-authored-by: karant-dev <22682299+karant-dev@users.noreply.github.com>
Deploying autoredact with
|
| Latest commit: |
dca4867
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7aee0d47.autoredact.pages.dev |
| Branch Preview URL: | https://copilot-add-custom-redaction.autoredact.pages.dev |
…ate validation Co-authored-by: karant-dev <22682299+karant-dev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add custom redaction rules for project names and invoice IDs
Add Custom Redaction Rules (Block Words, Dates, Regex Patterns)
Dec 12, 2025
karant-dev
requested changes
Dec 12, 2025
…tive text Co-authored-by: karant-dev <22682299+karant-dev@users.noreply.github.com>
Contributor
Author
Fixed in f7d639e. The overlap detection now requires text-based validation - a word is only redacted if it actually contains the matched text (or vice versa for multi-word matches). This prevents over-redaction when OCR groups text together like |
Co-authored-by: karant-dev <22682299+karant-dev@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


blockWords(string[]),customRegex(CustomRegexRule[]), andcustomDates(string[]) toDetectionSettingsdatePatterns.ts) to generate multiple date format regex patterns from a date stringuseDetectionSettingshook: Add functions to manage block words, custom regex patterns, and custom dates with validationocr.tsanduseOCR.tsto include block words, dates, and custom regexSettingsDropdown.tsxwith Block Words, Custom Dates, and Custom Regex fields with validationhasValidOverlaphelper function to reduce code duplicationBug Fix
Fixed issue where custom rules (block words, dates, regex) would redact entire lines instead of just the matching text. The fix adds text-based validation on top of positional overlap detection - now a word is only redacted if it actually contains the matched text or vice versa.
Before:
DATE:12-12-25*TIME:06:22*would be entirely redacted when matching date12-12-25After: Only the specific date portion is redacted
Screenshots
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.