
AI SDK 7
Quick Answer
Vercel's AI SDK 7, with over 16 million weekly downloads, enhances agent development by standardizing model reasoning, introducing typed tool contexts, and optimizing file handling for improved performance.
Quick Take
It supports durable workflows, tool approvals, and offers a terminal UI for rapid testing.
Key Points
- AI SDK 7 standardizes model reasoning for easier integration across providers.
- Introduces typed tool contexts to enhance third-party tool interactions.
- Optimizes file handling by allowing single uploads and lightweight references.
- Supports durable agent execution with resumable workflows and tool approvals.
- Includes a terminal UI for quick agent testing with minimal code.
Article Content
From source RSS / original summaryAI SDK, with over 16 million weekly downloads, is the TypeScript SDK for building AI applications, features, frameworks, and agents across any model provider. It's the same layer, Vercel's open-source agent framework, is built on. eveAI SDK 7 adds production depth for agent work across five areas:Building well-behaved agents requires fine-grained control over model reasoning, tool context, and file handling. Most frontier models support configurable reasoning, but every provider API exposes it differently.
AI SDK 7 standardizes this with a option for and. It maps to provider-native reasoning settings, letting you control reasoning effort in a single line. You can also still fall back to provider options when you need more detailed provider-specific reasoning configuration. reasoninggenerateTextstreamTextLearn more in the. reasoning documentationTools are increasingly developed independently of specific agents or applications. For example, third-party companies offer tools that enable agents to use their APIs.
Therefore, tools require additional inputs that are not generated by , such as API keys or configuration settings. AI SDK 7 adds a fully typed tool context that can be specified for each tool via a schema. The context is limited to the tool to prevent 3rd-party tools from accessing context they do not need. Learn more about Tool ContextFor more complex agentic loops, you often need variables that you can access and modify in to adjust prompts, model selection, and more.
prepareStepAI SDK 7 introduces a typed runtime context available during step preparation and tool approval functions, with optional telemetry support. This enables you to encapsulate more logic in and share those agents with that internal logic. ToolLoopAgentLearn more about. Runtime ContextMany agent workflows require handling large inputs, such as PDFs, images, datasets, or other artifacts.
Sending those files inline is slow and wasteful, especially for stateless inference, where they get sent over and over again. AI SDK 7 adds a top-level API that lets you upload a file once and then pass a lightweight reference into subsequent model calls. This avoids re-uploading the same bytes repeatedly, making inference faster and saving bandwidth during repeated or multi-step runs. uploadFile can be used with any providers that offer a file uploading endpoint.
The function returns a provider reference object that is portable across providers. uploadFileLearn more about Provider File UploadsSending skills inline on every request to provider-managed container environments has the same overhead problem as sending files inline. AI SDK 7 adds a top-level API that lets you upload a skill once and then use a reference to it in subsequent inference calls. Similar to, the function returns a provider reference object. uploadSkilluploadFileLearn more about.
Provider Skill UploadsMCP has become a common way to connect agents to tools and resources. But not every tool should be model-visible, and some servers need to expose specialized UI alongside their tools. AI SDK 7 adds support for MCP Apps. MCP servers can now separate model-visible tools from app-only tools, preserve app metadata, and render app UIs inside sandboxed iframes. A JSON-RPC bridge connects tools, resources, and display interactions.
This lets you build richer agent experiences where the model can use the tools it needs, while the user sees an app-specific interface for review, configuration, or interaction. Start building your first today. MCP App with AI SDKWhen developing agents, you need to be able to quickly test them without writing a full app. AI SDK 7 adds a terminal UI (TUI) package that lets you run agents with just a few lines of code:The TUI is interactive, supports reasoning and tools, and renders markdown as formatted text.
Learn more about. creating your own terminal agentAs agents become more autonomous and longer running, the need for approvals, durability, sandboxing, and robustness increases. AI SDK 7 supports agent-level tool approvals that can be automatic or involve a human in the loop, with these approval types:Tool approvals are defined on,, and, because the usage scenario of a particular tool drives the need for approvals.
ToolLoopAgentgenerateTextstreamTextFor higher-risk workflows, AI SDK 7 introduces opt-in HMAC-signed tool approvals to prevent forged approvals. The SDK also hardens replay behavior by revalidating tool inputs and policies before continuing execution. See. how tool approvals workWhen an agent run spans multiple steps or waits for a human approval, a process restart or deployment in the middle of that run means starting over.
AI SDK 7 introduces and for durable, resumable agent execution that survives process restarts, deploys, interruptions, and delayed approvals. @ai-sdk/workflowWorkflowAgent supports workflow-based streaming, tools, approvals, callbacks,, and provider model serialization across workflow step boundaries. It also supports typed runtime context for shared agent state and stable telemetry.
WorkflowAgentprepareCallCallbacks now include richer execution data such as step numbers, previous results, duration, and success or failure information. Invalid tool calls are preserved without executing invalid tools, and tool conversion can preserve raw outputs for UI and callbacks. toModelOutputLearn how to.
build an agent with WorkflowAgentAgents can stall in more ways than a simple request can: a provider can open a stream and stop sending chunks, a tool can hang, or a multi-step run can exceed its total budget. AI SDK 7 adds first-class timeout configuration across text generation and agent APIs, including total, per-step, per-chunk, and per-tool limits. Timeout aborts use, and abort reasons propagate through stream and UI protocols. TimeoutErrorLearn more about.
timeoutsAgents that run shell commands, read and write files, or execute generated code need a consistent execution environment, but the underlying sandbox often changes across local dev, CI, and production. AI SDK 7 adds a first-class abstraction for portable command execution in tools and agents. Tools can be developed independently of any particular sandbox, and you can use any sandbox-aware tool with any sandbox provider. SandboxSessionSandboxed environments, such as, are ideal for this purpose.
Vercel SandboxAgent runtimes are moving beyond a single application server. Teams want to run the same agent logic inside coding environments, hosted sandboxes, local sessions, and third-party harnesses. AI SDK 7 introduces experimental harness abstractions and: one API to run fully configured, established agent harnesses such as Claude Code, Codex, and Pi. Harnesses are configurable with a sandbox to operate in, custom instructions, skills, and tools.
Run established harnesses through a consistent interface, configure each one independently, and swap one out without changing your integration layer. HarnessAgentUnder the hood, the abstraction consists of a v1 adapter spec, bridge support, and expanded sandbox session primitives for creating and resuming sessions. Harness sessions can be parked and resumed, and even individual turns can be interrupted and resumed mid-flight.
implements AI SDK's interface, so its and return values are fully compatible with existing AI SDK integrations, and and the new TUI work without any additional wiring. HarnessAgentAgentgeneratestreamuseChat()Learn more about. AI SDK HarnessesUnderstanding how your agents behave in production is challenging. AI SDK 7 makes observability a first-class part of building agents. AI SDK 7 revamps telemetry around a single, extensible integration system.
Instead of wiring lifecycle callbacks into every or call, register telemetry once at application startup:generateTextstreamTextThe redesign includes:Observability integrations: Datadog, Langfuse, Braintrust, Raindrop, Sentry, Laminar, Langsmith. Traces now capture the full shape of an AI operation, including the root…
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
The Agent Stack
The Agent Stack by Vercel AI provides essential building blocks for creating production-grade agents, enabling seamless integration across multiple AI models and secure operations. It features components like AI Gateway for model routing, Workflow SDK for durable execution, and Vercel Connect for scoped access, streamlining agent development and deployment across various platforms.

