AI SDK 7: app agent cần hợp đồng thực thi trước khi thêm tools
Vercel AI SDK 7 thêm reasoning control, scoped context, tool approvals, WorkflowAgent, MCP Apps, sandbox và telemetry.
Execution contract read
Rủi ro: provider vẫn khác nhau. Bot đơn giản không cần hết, nhưng sản phẩm có file, API, approval cần contract rõ.
What happened
AI SDK 7 phát hành ngày 25/6/2026, mở rộng development, runtime, harness integration và observability cho agent.
Why it matters
Thực tế cần tách prompt, runtime context và tool context. Credential và tenant data không nên đi vào prompt.
Community signal
Cộng đồng hỏi nhiều về cost, streaming tool output, BYOK, reasoning traces, Guardrails và workflow multi-agent.
Checklist
Checklist: contextSchema cho từng tool, approval cho hành động rủi ro, durable execution, timeout riêng, MCP Apps sandbox và trace đầy đủ.
Risks
Rủi ro: provider vẫn khác nhau. Bot đơn giản không cần hết, nhưng sản phẩm có file, API, approval cần contract rõ.
Runtime contract map
| Area | AI SDK 7 surface | Operational question |
|---|---|---|
| Context | runtimeContext, toolsContext, contextSchema | Keep tenant state and credentials out of prompt text. |
| Approval | Tool-level policy and human gates | Revalidate risky tool calls before execution continues. |
| Durability | WorkflowAgent or workflow layer | Survive deploys, restarts, and delayed approvals. |
| UI boundary | MCP Apps plus sandboxed iframe | Separate user review surfaces from model-visible tools. |
| Observability | OpenTelemetry, lifecycle events, usage | Trace steps, tool calls, approvals, errors, and cost together. |
Checklist
• Checklist: contextSchema cho từng tool, approval cho hành động rủi ro, durable execution, timeout riêng, MCP Apps sandbox và trace đầy đủ.
Nguồn
- Vercel Blog: AI SDK 7
- Vercel Changelog: AI SDK 7 is now available
- AI SDK Docs: Migrate AI SDK 6.x to 7.0
- Vercel KB: Pass state to AI SDK tools and agents with context
- AI SDK Docs: Model Context Protocol tools
- AI SDK Docs: MCP Apps
- AI SDK Docs: Getting started with coding agents
- Vercel Community: AI SDK topics