Skip to main content
traceroot spans can contain application data. Review the defaults before tracing workloads that process personal data, credentials, or confidential content.

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

These flags apply only to the span created by that 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

Requires traceroot 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:
How it works:
  • 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: observe input, 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.
If the function raises or returns anything other than a dict (Python) or object (TypeScript), metadata is dropped and every value except numbers and booleans is sent as [redaction failed]. A TypeScript promise that rejects or does not settle within 5 seconds fails the same way. The SDK logs a warning. In TypeScript, pass logLevel: 'warn' to initialize() to see it.
Eval results are redacted too. Datasets and scorer definitions are not, so keep personal data out of them. A regex will not catch names or addresses. For those, call a detection service you run, for example a small one in front of Presidio. This example sends each string to a service that takes and returns { 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.
The trace view marks every span the function ran on as Redacted by your app.
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]

Span details: the Redacted by your app label and the redacted input

Redact Pi content before export

The TypeScript Pi instrumentation accepts a captureContent callback. It runs before content is attached to a span and can return replacement text or undefined to omit that item.
The callback form is available in the TypeScript Pi instrumentation. For other integrations and for Python, use redact above.

Disable tracing entirely

Set TRACEROOT_ENABLED before the SDK initializes:
The accepted values differ by SDK: 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 redact to 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.