"[REDACTED]" — the key is preserved so you can still see which field contained sensitive data, but the value never reaches Zespan servers.
PII redaction applies to
tags, metadata, and stored prompt and completion text. Prompt storage is on by default — set storePrompts: false to disable it.Default redacted keys
The SDK ships with a default list of keys that are always redacted, regardless of configuration:redactKeys explicitly.
Adding custom keys
Pass additional key names in theredactKeys array at initialization. These are merged with the default list.
- TypeScript
- Python
tags: { email: "user@example.com" }, the SDK will transmit tags: { email: "[REDACTED]" } instead.
How matching works
Matching is case-insensitive and checks both exact key names and common nested-key patterns:"password"matchespassword,Password,PASSWORD"api_key"matchesapi_key,apiKey,API_KEY
tags and metadata objects. Nested objects are flattened one level deep before matching.
Replacing the default key list
To use only your own list — completely replacing the defaults — setreplaceDefaultRedactKeys: true:
- TypeScript
- Python
Example: verifying redaction
The following example shows how redaction behaves at runtime. Theemail and phone fields are replaced; feature and plan pass through unchanged.
Redaction and storePrompts
PII redaction applies to both structured fields and stored prompt text:
| Setting | What is protected |
|---|---|
redactKeys | Values in tags, metadata, and stored prompt/completion text |
storePrompts: true (default) | Prompt and completion text stored — PII redaction applied before transmission |
storePrompts: false | Prompt and completion text never sent at all |
redactKeys patterns against prompt and completion content before transmitting. Matched values are replaced with [REDACTED].

