Built-in redaction policies
Axiom AI SDK provides two built-in redaction policies:
If you don’t specify a redaction policy, Axiom AI SDK applies
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:
initAxiomAI is called in your instrumentation file (/src/instrumentation.ts). For setup instructions, see Instrumentation with Axiom AI SDK.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:
'full' | 'off'
default:"'full'"
Controls whether prompt and response text is included in chat spans.
'full': Include complete message content'off': Exclude all message content
boolean
default:"true"
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:
Related documentation
Axiom AI SDK instrumentation
Learn how to instrument your AI applications with Axiom AI SDK
OpenTelemetry attributes
Understand the OpenTelemetry attributes captured by Axiom AI SDK