Skip to main content

Configuration

Worka PII separates detection policy from anonymization policy.

PolicyConfig

PolicyConfig controls how recognizers are scored and how overlaps are resolved. It is designed to be explicit and stable across releases. When you need strict thresholds or custom resolution rules, start here.

AnonymizeConfig

AnonymizeConfig maps entity types to operators. Operators include:

  • Redact for full removal.
  • Mask for partial masking.
  • Replace for fixed or templated values.
  • Hash for deterministic hashing.

Operators can be assigned per entity type so Email and Phone can be handled differently.

let mut config = AnonymizeConfig::default();
config.per_entity.insert(
"Email".to_string(),
Operator::Replace { with: "<EMAIL>".into() },
);