Skip to main content
Keep real user data out of your traces. Your traces carry messages, prompts, and responses — anything sensitive in them follows into Arize AX. Use masking to hide entire categories (all inputs, all outputs, embedding vectors) and redaction to remove specific patterns (emails, SSNs, credit cards) before spans leave your application.

Mask Span Attributes

The OpenInference specification defines environment variables to control what data is captured. You can also set them in code via TraceConfig. Precedence order: TraceConfig in code > environment variables > defaults.
Masking hides entire attribute categories. For finer control — scrubbing specific patterns like emails or SSNs while keeping useful context — write a custom span processor:

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
Regex works for well-structured patterns like emails, SSNs, or credit cards. For less predictable entities — names, locations, organizations — use NLP-based detection:

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 like PERSON, EMAIL_ADDRESS, PHONE_NUMBER, US_SSN, CREDIT_CARD, IP_ADDRESS, LOCATION, US_PASSPORT, and more.

Next step

Deploy at scale with OTEL Collector patterns, async tracing, and custom sampling:

Next: Advanced Tracing Patterns