Enable organization-level PII redaction
Organization admins can turn on Redact PII in Weave traces in the organization’s privacy settings. When this setting is on, the Weave server redacts the following from new Calls and Agent OTel writes before storing them:- Email addresses
- Phone numbers
- US Social Security numbers
Redact PII with the Python SDK
Client-side PII redaction is only available in Python.
- A
redact_piisetting, which you can enable or disable in theweave.init()call to turn on PII redaction. - Automatic redaction of common entities when
redact_pii = True. - Customizable redaction fields with the configurable
redact_pii_fieldssetting. - Exclusion of specific entities from redaction with the
redact_pii_exclude_fieldssetting.
Enable PII redaction
This section walks you through installing the required dependencies, turning on PII redaction inweave.init(), and optionally tailoring which entities Weave redacts. To get started with the Sensitive Data Protection feature in Weave, complete the following steps:
-
Install the required dependencies:
-
Modify your
weave.init()call to enable redaction. Whenredact_pii=True, Weave redacts common entities by default: -
Optional: Customize redaction fields with the
redact_pii_fieldsparameter:For a full list of the entities that can be detected and redacted, see PII entities supported by Presidio. -
Optional: Exclude specific entities from redaction with the
redact_pii_exclude_fieldsparameter. This is useful when you want to keep the default redaction but preserve certain entity types. The following example shows how to redact all default entities exceptEMAIL_ADDRESSandPERSON:
Entities redacted by default
This section lists the PII entity types that Weave redacts automatically when you enable PII redaction without specifyingredact_pii_fields. Weave automatically redacts the following entities when you enable PII redaction:
CREDIT_CARDCRYPTOEMAIL_ADDRESSES_NIFFI_PERSONAL_IDENTITY_CODEIBAN_CODEIN_AADHAARIN_PANIP_ADDRESSLOCATIONPERSONPHONE_NUMBERUK_NHSUK_NINOUS_BANK_NUMBERUS_DRIVER_LICENSEUS_PASSPORTUS_SSN
Redact sensitive keys with REDACT_KEYS
In addition to PII redaction, the Weave SDK supports redaction of custom keys with REDACT_KEYS. This is useful when you want to protect additional sensitive data that might not fall under the PII category but must remain private. Examples include:
- API keys
- Authentication headers
- Tokens
- Internal IDs
- Config values
Pre-defined REDACT_KEYS
Weave automatically redacts the following sensitive keys by default:
Add your own keys
If your application uses other field names that contain sensitive values, you can extend the defaultREDACT_KEYS list. Add your own custom keys that you want to redact from traces:
client_id and token appear as "REDACTED":
Usage information
- This feature is only available in the Python SDK.
- When you enable redaction, processing time increases because of the Presidio dependency.