This is an SDK-side feature. ZeroEval does not rely on backend-side redaction
for this behavior.
Enable redaction
- Python
- TypeScript
redact_inputs,
redact_session_names, sensitive_keys, and custom_patterns. TypeScript uses
the camelCase equivalents redactInputs, redactSessionNames,
sensitiveKeys, and customPatterns.
What gets redacted
By default, the SDKs redact sensitive values found in:- inputs and outputs
- attributes
- error messages and stacks
- session names
- tag values
- email addresses
- phone numbers
- SSN-style identifiers
- PAN / credit card numbers
- bearer tokens, JWTs, and common API key formats
- cookie and authorization header values
- IP addresses
email, phone, password, token, authorization, cookie, and
api_key / apiKey.
What stays intact
Redaction is meant to preserve trace structure. The SDKs keep:- span names
- trace IDs and span IDs
- timing and status fields
- token counts, model/provider metadata, and cost metadata unless the value itself is sensitive
Placeholder behavior
Sensitive values are replaced with stable placeholders inside a single trace:- the same normalized sensitive value in one trace gets the same placeholder
- different values in the same trace get different placeholders
- placeholder assignment resets per trace
- matching is exact after normalization only
- this is not fuzzy identity resolution
Normalization and limitations
| Type | Normalization used for placeholder reuse |
|---|---|
| Trim + lowercase | |
| Phone | Digits only |
| SSN / PAN | Digits only |
| IP | Canonical or lowercase string as implemented by each SDK |
| Secrets | Exact trimmed string |
- there is no reversible backend token vault
- there is no de-anonymization support
- there is no fuzzy entity resolution across semantically related strings
- bypassing SDK capture paths bypasses this protection
Examples
The SDK repositories include runnable examples that match the implemented behavior:- Python
- TypeScript
From
zeroeval-sdk/examples/pii_redaction.py: