Mask Span Attributes
The OpenInference specification defines environment variables to control what data is captured. You can also set them in code viaTraceConfig.
OPENINFERENCE_HIDE_INPUTS / OPENINFERENCE_HIDE_OUTPUTS also hide span-level input.images, input.documents, output.images, and output.documents. There is no separate hide-documents flag. For the full multimodal attribute shapes, see Multimodal tracing.
Precedence order: TraceConfig in code > environment variables > defaults.
- Python
- JS/TS
Redact PII with Custom Span Processors
For finer-grained control, create a custom span processor that detects and redacts PII patterns before spans are exported. This runs in your application — sensitive data never leaves your infrastructure.Regex-Based Redaction
This processor supports: email addresses, phone numbers, SSNs, credit card numbers, IP addresses, and dates of birth. Add your own patterns as needed.Wire It Up
![Arize AX trace showing PII redaction — user input with [REDACTED_EMAIL] and [REDACTED_PHONE] in place of real values](https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/instrument/redcated_data.png)
Microsoft Presidio Integration
For teams that need NLP-based PII detection (beyond regex), use Microsoft Presidio as a drop-in replacement for the regex patterns. Presidio supports entity types likePERSON, EMAIL_ADDRESS, PHONE_NUMBER, US_SSN, CREDIT_CARD, IP_ADDRESS, LOCATION, US_PASSPORT, and more.
Presidio span processor example
Presidio span processor example