Redact spans with your own service
Call a detection service you run when TypeScript spans are exported.
![The update_shipping_contact span, marked Redacted by your app, with [REDACTED] in place of an email and a phone number in the input message.](/changelog/2026-10-30-redact-with-your-service/span-redacted.png)
You can now pass an async redact function to the TypeScript SDK. It can call a detection service running in your own infrastructure, and it runs when spans are exported.
Upgrade to @traceroot-ai/traceroot 0.8.0 and pass the function to TraceRoot.initialize. The trace marks each span it touched as Redacted by your app and shows the text your function returned.