Skip to main content
A chat agent’s run trace records conversation content by default: the user’s message and the clientData your frontend sends. When AI SDK telemetry is on, it also records the prompts and responses of each model call. This page covers the three controls that change that, and what they don’t cover.

What the run trace records

Stop recording chat content

Set telemetry on the agent to stop the chat runtime recording the user’s message and clientData on its spans. Both default to true.
/trigger/support-agent.ts
The spans still appear in the trace with their timings and token usage. The turn spans have no preview text.

Stop the AI SDK recording prompts and responses

AI SDK model call spans appear when AI SDK telemetry is on: chat.prompt.set() turns it on for you, or you pass experimental_telemetry yourself. Those spans include prompts and responses unless you turn that off with recordInputs and recordOutputs:
/trigger/support-agent.ts
If you use chat.prompt.set(), your experimental_telemetry replaces the one it adds, including the metadata that links each generation to its prompt version. To keep that link, redact with a span processor instead.

Redact instead of dropping

To keep the content but strip sensitive values from it, add a span processor in trigger.config.ts. It runs on every span before export, so one processor covers the chat runtime’s spans, the AI SDK spans and your own.
trigger.config.ts
Scrubbing every string value, rather than matching attribute names, also catches the turn preview text. See Span processors for when each hook runs and which attributes are kept.

What spans don’t cover

These controls change the run trace only. Conversation content also reaches the platform in two other places:
  • Session streams. Each message your frontend sends is written to the session’s session.in stream, and the agent’s output to session.out. They hold message content for their retention window, and the session view in the dashboard reads from them. See transcript storage limits.
  • The run payload. A chat agent run’s payload includes clientData as metadata, and every session.in record carries it too. Send an id in clientData and look up the rest in onPreload or run instead of sending the values themselves.
To keep a value off the platform entirely, redact or tokenize it in your frontend or backend before it’s sent. The model then sees the redacted value too, unless your tools resolve the tokens.

Verify it

Send a message containing a marker value (an email address, for example), then open the run in the dashboard. Select the chat turn 1 span and check its properties: the marker is gone, or shows as [email] with the span processor above. The span list shows the same redacted preview.