Vercel AI SDK Audit Logs: Turn Telemetry Into a Release Evidence Map
Vercel AI SDK v7 emits OpenTelemetry events for supported model operations after telemetry is registered, with inputs and outputs recorded by default. An audit-ready deployment must map those spans to caller identity, route policy, tool authorization, content-retention choices, and an independent request-boundary decision.

Vercel AI SDK v7 can emit OpenTelemetry events for supported model operations after an application registers the telemetry integration. Inputs and outputs are recorded by default, while options can suppress either side before data reaches the integration. Those spans show what the SDK called and returned. A regulated audit record must establish who initiated the operation and which policy approved it. It must also show where the evidence lives after an exporter fails.
I would block a release that labels an enabled telemetry switch as an audit trail.
TL;DR
- Vercel AI SDK v7 emits OpenTelemetry data for supported generation and embedding operations after registration. It also covers reranking and speech operations, along with transcription.
- Audit evidence needs caller identity and model route. It also needs the policy version and tool decision. The record must preserve content-recording state and retention, then correlate them with an independent request-boundary record.
- DeepInspect can govern authenticated LLM HTTP traffic routed through it.
- Application callbacks, tool execution, telemetry export, and direct provider calls keep separate owners.
AI SDK v7 emits operational telemetry
The AI SDK telemetry documentation says the SDK uses OpenTelemetry and requires the @ai-sdk/otel package for collection. Once the integration is registered, supported calls emit telemetry events by default. The documented operations include text and object generation, plus embeddings and reranking. They also cover speech generation. Transcription is covered in streaming and non-streaming forms.
Applications can attach a functionId and metadata to a call, grouping spans by feature or workflow. The field becomes useful evidence only when the value is stable and controlled, then joined to the authenticated request that started the operation.
A trace named claims-summary identifies application intent. It still needs a caller and tenant. The route and policy decision must also be present before a reviewer can answer who was allowed to send the underlying prompt.
Inputs and outputs are a custody decision
AI SDK telemetry records inputs and outputs by default. The documentation provides recordInputs and recordOutputs switches for privacy and transfer needs. They can also address performance needs. When either setting disables recording, the SDK filters content before lifecycle events reach telemetry integrations and Node.js telemetry subscribers. Raw provider bodies and provider metadata are also omitted. Tracing span results receive the same treatment because they may carry the same content.
That behavior should appear in the release evidence. Record the deployed value for both switches and the application version that set them. Record the destination receiving the spans separately. Then send a synthetic prompt containing TRACE-CASE-731 and a fake secret pattern, open the exported trace, and inspect the stored fields.
The marker proves correlation, while the fake secret tests the redaction decision. A screenshot of the configuration proves only what someone intended to deploy.
The evidence map has five sources
A Vercel AI SDK deployment can produce several records that answer different questions:
- Application request log: which route handler received the request and which local session it attached.
- AI SDK telemetry: which model operation ran, its timing, usage, provider metadata, and recorded content according to the active privacy switches.
- Lifecycle callback: which application code observed the operation and what it did with the result.
- Tool record: which tool was proposed, approved, executed, and returned to the model loop.
- Request-boundary decision: which authenticated caller was permitted to send this prompt to this model under a named policy version.
The text-generation documentation lists result fields for multi-step runs, including content, tool calls, tool results, and usage. Other fields cover warnings and step details. The final step is also included. These fields help reconstruct application behavior. They acquire audit weight when their identifiers connect to an independently governed authorization decision.
This is the same separation used in AI agent observability: diagnostic traces explain execution, while policy evidence proves permission.
Caller identity must enter before generation
The AI SDK can execute in a server route after a web session or API credential has already been validated. A workload identity can supply the same prerequisite. The model operation needs a correlation value derived from that authenticated context rather than a user-supplied label.
Create a synthetic identity such as benefits-review-service-9. Permit one model route and one read-only tool. Attach a generated correlation identifier to the application log and telemetry metadata. Carry the same identifier in the model request and tool decision. The audit record must carry it too. Keep the human-readable identity in controlled fields. Use a digest where the telemetry destination should avoid direct identifiers.
Then repeat the request with a forbidden model. The span may record an attempted operation, but the request-boundary record should show a denial before provider inference. If the provider returns a model response, the route test failed. A complete trace does not rescue it.
The pattern appears in OpenAI Agents SDK audit logs, though the framework-specific fields differ.
Tool approvals need their own record
The AI SDK agent documentation describes a tool loop that can call tools over multiple steps and supports approval policies. Runtime context can carry shared state. Tool context can carry server-side values such as scoped permissions and credentials.
A telemetry span can show that a tool call occurred. The evidence record should show the requested tool and arguments digest. It should identify the authorizing identity and approval rule. The result and target-side effect belong in the same record. That distinction becomes concrete when a read-only claims lookup and a payment update sit in the same agent.
Use one permitted lookup and one denied write in the release test. The approved case should produce linked model, approval, execution, and result records. The denied case should preserve the proposed call and denial without changing the target system.
Vercel AI SDK prompt-injection controls address step-level policy. The audit map preserves proof that the policy fired.
Export failure must have a defined outcome
OpenTelemetry delivery can fail when a collector is unavailable or credentials expire. An exporter queue can also reach capacity. The application needs a documented behavior for each condition. Diagnostic spans may fail open if the business accepts the evidence gap. An independent authorization decision for regulated LLM traffic should retain stronger write guarantees.
Stop the collector during a release test and send one permitted request. Record exporter retry behavior, queue limits, dropped-event counters, and the alert path. Then verify the request-boundary decision remains available under its own custody controls.
Repeat the test with input and output recording disabled. Confirm that sensitive content stays out of telemetry. Identity and route must remain in the audit chain. The policy and decision must remain too. Preserve the timestamp and correlation fields as well. This proves privacy controls and evidence controls can coexist instead of trading one blind spot for another.
Release evidence names the deployed version
Bind the record to AI SDK v7 and the ai and @ai-sdk/otel package versions. Include the telemetry registration code and provider package version. Add the route configuration and policy version. Record the exporter destination too. The telemetry page notes that some provider-specific secret redaction depends on provider versions, so package identity changes the claim a reviewer can make.
For release ai-sdk-2026-11-13.2, retain the four acceptance cases: approved route, forbidden model, denied tool, and collector outage. Each case should have one correlation identifier. Write its pass condition before execution.
A release packet built this way survives a later question about what the application actually recorded. It also shows where the evidence stops.
DeepInspect
DeepInspect can evaluate authenticated HTTP requests sent by a Vercel AI SDK application to an LLM endpoint when that traffic is deliberately routed through the proxy. It can bind caller context to model and data policy, then record the decision. The application correlation identifier can also pass into a per-decision audit record.
Application callbacks and local or hosted tool execution remain outside that record. Telemetry export and provider-internal processing also keep separate owners. The same applies to direct calls that bypass the proxy. The evidence map links those owners without claiming one span can prove the entire agent run.
Book a technical deep dive at deepinspect.ai.