What is captured by default
Capture settings prevent the selected values from being written to spans. They do not modify what your application passes to an LLM provider or tool.
Disable input and output for one function
- Python
- TypeScript
observe call. Auto-instrumented child calls can still capture their own inputs and outputs according to the integration’s settings.
Redact personal data before export
Requirestraceroot 0.4.0 or later (Python) or @traceroot-ai/traceroot 0.6.0 or later (TypeScript, or 0.8.0 for an async redact).
Pass a redact function to initialize(). It receives each finished span’s attributes and returns what to export, so anything it removes never reaches traceroot. This example blanks email addresses and phone numbers:
- Python
- TypeScript
- It runs in your app on every finished span, including spans from other libraries. In Python, keep it fast, synchronous, and thread-safe. In TypeScript, it runs at export, not during the request, and may be async; each batch gets 5 seconds.
- It receives span content:
observeinput, output, and metadata, LLM prompts, event attributes such as exception messages, and the status message. Structured values arrive as JSON text, so parse them if your detector misses names in JSON. - It does not receive bookkeeping: user and session IDs, model name and token usage, tags, environment, span names, and similar. Those are sent as given, so keep personal data out of them and use an internal user ID, not an email address.
- Return every key you want to keep.
- Only traceroot’s copy changes. Other exporters in your app still get the original span.
{ text }:
From 0.8.0, TypeScript
redact also receives keys derived from Vercel AI SDK attributes (input.value, output.value, llm.*), so if you drop specific ai.* keys, drop these too.![Span details for update_shipping_contact with a Redacted by your app label, and an input message whose email address and phone number show as [REDACTED]](https://mintcdn.com/tracerootai/kqejnfY8AIiTJVnt/images/span_redacted_v1.png?fit=max&auto=format&n=kqejnfY8AIiTJVnt&q=85&s=5e5d33471e6a4855d9a2d4bf1cef845f)
Span details: the Redacted by your app label and the redacted input
Redact Pi content before export
The TypeScript Pi instrumentation accepts acaptureContent callback. It runs before content is attached to a span and can return replacement text or undefined to omit that item.
redact above.
Disable tracing entirely
SetTRACEROOT_ENABLED before the SDK initializes:
You can also pass
enabled=False to Python’s initialize() or enabled: false to TraceRoot.initialize() in TypeScript.
Privacy checklist
- Classify prompts, completions, function arguments, tool I/O, metadata, tags, and source paths before enabling tracing in production.
- Disable capture as close as possible to the function or integration that handles sensitive data.
- Use
redactto strip personal data that has to stay in captured content. - Never attach secrets to metadata or manual span updates.
- Verify a representative exported trace in a non-production project before rollout.
- Apply your organization’s retention, access-control, and data-processing requirements to the traceroot deployment you use.

