From cada38bf9e0bc2b1980f0e2abe0a0cf1871ba648 Mon Sep 17 00:00:00 2001 From: Scott Condron Date: Tue, 13 Jan 2026 12:29:09 +0000 Subject: [PATCH] docs(weave): add redact_pii_exclude_fields setting documentation Documents the new redact_pii_exclude_fields setting that allows users to exclude specific PII entity types from redaction. Co-Authored-By: Claude Opus 4.5 --- weave/guides/tracking/redact-pii.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) 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: