Expand description
Pure-Rust core for maskprompt. Detects common PII patterns plus
caller-supplied keywords and replaces them via one of four strategies.
- Built-in rules. A small fixed set of regex patterns. Credit-card matches are validated through Luhn before redaction so unrelated 13–19 digit strings (order numbers, etc.) are not flagged.
- Custom keywords. An Aho-Corasick automaton over the union of all user-supplied needles, so a list with thousands of entries (customer names, internal project codes) still matches in linear time.
- Strategies.
Tag,Hash,Fixed,Remove. TheHashstrategy uses blake3 truncated to 8 hex chars to give stable cross-run redaction without recovering the source.
Match resolution: when two rules overlap, the one that started earlier wins; ties go to the longer match.
Structs§
- Mask
Match - One match found by
Masker::mask. - Mask
Result - Output of
Masker::mask. - Masker
- Compiled detector set. Build with
Masker::builder. - Masker
Builder - Builder for
Masker.
Enums§
- Builtin
Rule - Built-in detector identifiers.
- Masker
Error - All errors surfaced by
maskprompt-core. - Strategy
- How matches are replaced in the masked string.
Type Aliases§
- Result
- Crate-wide result alias.