Observe, evaluate, and improve your Vercel AI SDK agents
Capture every Vercel AI SDK run through its own telemetry integration interface — the same lifecycle hooks the SDK uses for its own instrumentation, not a bolted-on tracer.
What Prefactor records from Vercel AI SDK
Vercel AI SDK + Prefactor
Observe for Vercel AI SDK
Prefactor observes your Vercel AI SDK agents in real time — every LLM call, tool invocation, and custom span captured as
Open → EvaluateEvaluate for Vercel AI SDK
Prefactor evaluates your Vercel AI SDK agents — score outcome quality against the captured spans, track drift by compari
Open → ObserveAct for Vercel AI SDK
Prefactor acts on your Vercel AI SDK agents at runtime — block, throttle, sandbox, or escalate a tool call or data acces
Open →How the Vercel AI SDK integration works
- Registers as a Telemetry integration — via registerTelemetry() globally, or passed per-call through the telemetry option (the current name for what generateText/streamText still accept as the deprecated experimental_telemetry alias).
- The SDK's own executeTool and executeLanguageModelCall wrappers are the real enforcement point: each wrapper receives the actual tool or model call as a function before it runs, and decides whether to call it, throttle it, or block it — the same mechanism the SDK uses internally to compose multiple integrations, not a side channel.
- Beyond the auto-captured lifecycle events, use withSpan to record any custom step you define — an API call, a quality check, a business action.
Vercel AI SDK integration FAQ
Do I need a dedicated package for Vercel AI SDK?
Vercel AI SDK has a native package (@prefactor/ai) that registers as a Telemetry integration; you can also instrument it today with the framework-agnostic prefactor-core SDK.
What does Prefactor capture from Vercel AI SDK?
Prefactor hooks the SDK's own telemetry lifecycle — onStart/onEnd, onStepStart/onStepEnd, onLanguageModelCallStart/End, and onToolExecutionStart/End — as structured, timestamped spans, so every Vercel AI SDK run is captured as trace data you can reconstruct, search and export end to end.
Does Prefactor add latency or change how Vercel AI SDK runs?
No. Observability capture is designed to stay off your agent's critical path, so it doesn't alter your Vercel AI SDK logic or your users' responses. The only part that acts inline is the optional runtime guardrails you enable per agent — by design, so a high-risk or low-confidence action can be held for human approval before it executes.
Can I evaluate agents built with Vercel AI SDK and catch regressions?
Yes. Once runs are captured, eval suites score quality and groundedness on real traffic, drift detection flags behaviour changes after deployment, and versioned eval history catches regressions before they ship — the observe → evaluate → improve loop applied to your Vercel AI SDK agents.
Related guides
See it on your Vercel AI SDK agents
Book a 15-minute setup and our team gets you tracing in production.