Before an AI SDK feature takes real traffic, pin the version, cap every agent loop, gate risky tools, and register telemetry. A feature can reach users in an afternoon, and teams report that the production work starts after that. The steps also cover how model calls reach providers, how long runs survive restarts, and the provider tests to pass before launch.
When you need this
- A prototype built with streamText and useChat is about to take real users.
- Agents will call tools that change data, send messages, or spend money.
- The team plans to switch or mix model providers after launch.
Evaluation criteria
Pin the line
Which version are you on, and who upgrades it?
Look forPin ai and every @ai-sdk package to exact versions from one minor line. AI SDK 7 needs Node.js 22 or later and ESM; Vercel still publishes patches on the 5 and 6 lines, so a team can finish a launch before taking a major. Name an owner for upgrades.
Choose the model path
Does a model string route through AI Gateway or straight to the provider?
Look forAI Gateway is the default global provider, so a plain string such as anthropic/claude-sonnet-5.5 goes through Vercel with gateway billing. Import a provider package with your own keys when traffic must go direct, or set gateway budgets and data controls first; the AI Gateway guide covers both.
Bound every loop
What stops a tool loop that keeps going?
Look forSet stopWhen explicitly. ToolLoopAgent defaults to 20 steps, while WorkflowAgent has no default limit. Add AI SDK 7 timeouts per run, step, chunk, and tool. Pass the request's abort signal. One developer calls its absence the most common production bug. A 2026 issue showed generateText returning normally after a mid-loop abort.
Gate risky tools
Which tool calls need a person or a policy to approve them?
Look forSet toolApproval on each tool. Require user approval for data changes and use approval functions for policy checks. Enable signed approvals on high-risk tools and test resume. A June 2026 issue broke every signed approval on resume until a fix shipped. On October 23, 2026 Vercel shipped a first-party web fetch tool, @ai-sdk/tool-web-fetch, exported as experimental_createWebFetchTool and requiring Node.js 22.13 or later. Vercel's docs warn that fetched pages are untrusted and can contain prompt injections. Domain limits are opt-in and requireUrlInUserMessage defaults to false, so set allowedDomains or turn on requireUrlInUserMessage, and require approval when the agent can reach private data. The tool blocks private addresses, runs no JavaScript, and rejects PDFs. Before October 22, 2026, toolChoice: 'none' did not stop a tool call the model returned anyway. Versions ai 7.0.149 and 6.0.314 (October 22) and 5.0.281 (October 23) reject such calls before local execution and withhold streamed tool parts. Teams pinned below those versions should upgrade.
Make long runs durable
What happens to a run when the process restarts mid-task?
Look forToolLoopAgent keeps state in memory. For runs that outlast a request or wait for approval, use WorkflowAgent on Workflow DevKit. Another option puts SDK calls inside Temporal workflow steps, as Output.ai does. Check the host's function timeout against the longest expected run.
Throttle the UI
Does the chat stay responsive on long, tool-heavy answers?
Look forSet experimental_throttle on useChat and test long answers with many tool calls on slower machines. Developers report re-render loops when useChat's messages feed a useEffect, and one team left the SDK for a native implementation after slow UI hooks in a production app.
Trace from day one
Can you see each step, tool call, and its cost?
Look forRegister telemetry once at startup with @ai-sdk/otel, which follows the OpenTelemetry GenAI conventions, and send it to your tracing tool. Decide whether spans carry prompt and response content before traces leave your network.
Test each provider
Does every provider you use behave the same through the SDK?
Look forUse the test model helpers in ai/test for unit tests, and run a small eval per provider before switching. Public GitHub issues show failures specific to one provider. These include Anthropic rejecting valid Zod schemas, reasoning blocks lost across tool steps, and a Bedrock structured-output change that moved one team's failures from 0 to about 10 of 20.
Questions to ask vendors
- Which exact version do we run, and who owns the next major upgrade?
- Do model calls go through AI Gateway or straight to providers, and who approved that?
- What stop condition, timeout, and abort handling does every agent loop have?
- Which tools need approval, and have we tested approvals across a resume?
- Which providers have passed our eval since the last upgrade?
Red flags
- Caret ranges on ai or @ai-sdk packages in production.
- Agent loops with no explicit stop condition or timeout.
- Tools that change data with no approval step.
- Switching providers in production without re-running evals.
Products in this piece
Sources
- Official documentation
- 14
- Public source
- 9
- AI SDK docs: Migration guide, AI SDK 7.0
- vercel/ai releases on GitHub
- AI SDK docs: Choosing a provider (AI Gateway as the default global provider)
- AI SDK docs: Loop control
- AI SDK docs: Tools and tool calling
- AI SDK docs: Tools, including the web fetch tool
- vercel/ai release @ai-sdk/tool-web-fetch 1.0.0 (Oct 23, 2026)
- vercel/ai release ai 7.0.149, toolChoice 'none' fix (Oct 22, 2026)
- vercel/ai release ai 6.0.314, toolChoice 'none' fix (Oct 22, 2026)
- vercel/ai release ai 5.0.281, toolChoice 'none' fix (Oct 23, 2026)
- AI SDK docs: WorkflowAgent
- AI SDK docs: Telemetry
- AI SDK docs: Testing
- Vercel blog: AI SDK 7 (Jun 25, 2026)
- Umesh Malik: Vercel AI SDK in production (Jul 21, 2026)
- vercel/ai issue #12878: generateText swallows AbortError in a multi-step tool loop (Feb 26, 2026)
- vercel/ai issue #16334: signed tool approvals fail on resume (Jun 23, 2026)
- Hacker News comment on Output.ai's LLM package, a thin wrapper around the AI SDK with Temporal workflow steps (Apr 9, 2026)
- vercel/ai issue #4741: useChat messages as a useEffect dependency cause infinite re-renders (Feb 6, 2025)
- Hacker News comment on replacing the AI SDK with a native implementation in a production app (Feb 20, 2025)
- vercel/ai issue #14342: Anthropic structured outputs reject valid Zod schemas (Apr 10, 2026)
- vercel/ai issue #11602: Anthropic reasoning blocks lost in multi-step tool calls (Jan 7, 2026)
- vercel/ai issue #17881: Bedrock native structured output degenerates on claude-sonnet-4-6 (Jul 23, 2026)