Four Recognizer Sources
Built-in Regex Recognizers
These cover structured values with stable formats, such as emails, phone numbers, dates, IBANs, URLs, and credit card numbers. They are fast, local, and usually the default foundation of a Rehydra setup.NER-Based Detection
The optional NER model handles contextual entities that are hard to capture with regex alone, especially:PERSONORGLOCATIONADDRESSDATE_OF_BIRTH
Secrets Recognizers
The opt-in secrets recognizers detect credentials and keys such as API keys, private keys, JWTs, database connection strings, AWS credentials, and secrets embedded in.env files or config files.
They are enabled by setting secrets: { enabled: true } in createAnonymizer().
Custom Recognizers
Custom recognizers let you add business-specific patterns like order IDs, support tickets, claim numbers, or internal account references. They are the right tool when your domain has sensitive identifiers the built-in recognizers do not know about.How Recognizers Work Together
Rehydra can combine multiple sources in one pass:- Regex recognizers detect structured values
- NER detects contextual values if enabled
- Secrets recognizers detect credentials and keys if enabled
- Custom recognizers add product- or company-specific coverage
- Overlapping matches are resolved by policy rules
Registry and Extensibility
The SDK exposes a recognizer registry so you can register or remove recognizers and even supply a custom registry tocreateAnonymizer().
Choosing the Right Recognizer Strategy
Use built-in regex recognizers when:- Formats are predictable
- You want fast local detection
- You do not need model downloads
- You need names, organizations, or locations
- Context matters more than fixed format
- Your text may contain API keys, tokens, or database credentials
- You process
.envfiles or config files with embedded secrets - You want to prevent credential leaks to LLMs or external services
- You need to protect internal identifiers
- Your domain uses proprietary patterns
- You want narrow, high-precision rules for business data
Next Steps
PII Types
See the categories recognizers map into.
Secrets Detection
Enable detection for credentials and keys.
Custom Recognizers
Implement your own recognizers and registry setup.