diff --git a/weave/guides/tracking/redact-pii.mdx b/weave/guides/tracking/redact-pii.mdx index 7d00f20fc0..69949e5b2a 100644 --- a/weave/guides/tracking/redact-pii.mdx +++ b/weave/guides/tracking/redact-pii.mdx @@ -16,6 +16,7 @@ The Sensitive Data Protection feature introduces the following functionality to - A `redact_pii` setting, which can be toggled on or off in the `weave.init` call to enable PII redaction. - Automatic redaction of [common entities](#entities-redacted-by-default) when `redact_pii = True`. - Customizable redaction fields using the configurable `redact_pii_fields` setting. +- Exclude specific entities from redaction using the `redact_pii_exclude_fields` setting. ## Enable PII redaction @@ -43,6 +44,14 @@ To get started with the Sensitive Data Protection feature in Weave, complete the For a full list of the entities that can be detected and redacted, see [PII entities supported by Presidio](https://microsoft.github.io/presidio/supported_entities/). +4. (Optional) Exclude specific entities from redaction using the `redact_pii_exclude_fields` parameter. This is useful when you want to keep the default redaction but preserve certain entity types: + + ```python lines + weave.init("my-project", settings={"redact_pii": True, "redact_pii_exclude_fields":["EMAIL_ADDRESS", "PERSON"]}) + ``` + + In this example, all [default entities](#entities-redacted-by-default) are redacted except for `EMAIL_ADDRESS` and `PERSON`. + ## Entities redacted by default The following entities are automatically redacted when PII redaction is enabled: