AI SDK 7: แอป agent ต้องมี execution contract ก่อนเพิ่ม tools
Vercel AI SDK 7 เพิ่ม reasoning control, scoped context, tool approvals, WorkflowAgent, MCP Apps, sandbox และ telemetry
Execution contract read
ความเสี่ยง: provider ยังต่างกันอยู่ สำหรับ chatbot ง่ายๆ อาจเกินจำเป็น แต่ product agent ต้องมีขอบเขตชัดเจน
What happened
AI SDK 7 เปิดตัววันที่ 25 มิถุนายน 2026 และขยายการพัฒนา runtime, harness integration และ observability สำหรับ agents
Why it matters
ควรแยก prompt, runtime context และ tool context ข้อมูล tenant และ credentials ไม่ควรอยู่ใน prompt
Community signal
สัญญาณชุมชนพูดถึง cost, streaming tool output, BYOK, reasoning traces, Guardrails และ multi-agent workflows
Checklist
Checklist: ทำ contextSchema ต่อ tool, approval สำหรับ action เสี่ยง, durable execution, timeout หลายชั้น, MCP Apps sandbox และ tracing ครบ
Risks
ความเสี่ยง: provider ยังต่างกันอยู่ สำหรับ chatbot ง่ายๆ อาจเกินจำเป็น แต่ product agent ต้องมีขอบเขตชัดเจน
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 ต่อ tool, approval สำหรับ action เสี่ยง, durable execution, timeout หลายชั้น, MCP Apps sandbox และ tracing ครบ
แหล่งที่มา
- 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