Built-in redaction policies
Axiom AI SDK provides two built-in redaction policies:| Policy | What gets captured | What gets excluded | When to use | 
|---|---|---|---|
| AxiomDefault | Full data | – | Full observability | 
| OpenTelemetryDefault | Model metadata, token usage, error info | Prompt text, AI responses, tool args and results | Privacy-first | 
AxiomDefault.
To determine which redaction policy fits your needs, see the following comparison:
- AxiomDefault
 - OpenTelemetryDefault
 
AxiomDefault policy
By default, Axiom AI SDK captures all data for maximum observability.What gets captured:- Full prompt text and AI responses in chat spans
 - Complete tool arguments and return values on tool spans
 - All standard OpenTelemetry attributes (model name, token usage, etc.)
 
Capturing full message content increases span size and storage costs.
- You need full visibility into AI interactions
 - Data privacy isn’t a concern
 - Debugging complex AI workflows
 
What gets captured
To determine which redaction policy fits your needs, see the following examples about what gets captured with each defaultpolicy:- AxiomDefault
 - OpenTelemetryDefault
 
- Chat spans
 - Tool spans
 
Global configuration
Set a default redaction policy for your entire application usinginitAxiomAI:
In Quickstart, 
initAxiomAI is called in your instrumentation file (/src/instrumentation.ts).Per-operation override
You can configure different policies for each operation. Axiom resolves redaction policies in the following order (from highest to lowest precedence):- Per-operation policy
 - Global policy
 - Default policy
 
redactionPolicy to withSpan:
Custom redaction policies
Create custom policies by defining anAxiomAIRedactionPolicy object:
AxiomAIRedactionPolicy object has two properties:
Controls whether prompt and response text is included in chat spans.
'full': Include complete message content'off': Exclude all message content
Controls whether tool arguments and results are duplicated on tool spans.
true: Mirror tool data for easier queryingfalse: Only capture tool metadata (name, description)
AxiomAIRedactionPolicy object in the following way:
| Default policy | captureMessageContent | mirrorToolPayloadOnToolSpan | 
|---|---|---|
| AxiomDefault | 'full' | true | 
| OpenTelemetryDefault | 'off' | false |