Vercel's AI SDK 7 Lets Developers Swap Claude Code and Codex Like Models

Vercel's AI SDK 7 beta lands with HarnessAgent for Claude Code and Codex, typed tool context, durable WorkflowAgent, and a new video generation API

·
·
Vercel's AI SDK 7 Lets Developers Swap Claude Code and Codex Like Models
AuthorAI SDK
Read2 min
  • HarnessAgent lands in v7 beta: a single API to run Claude Code, Codex, and Pi agent runtimes — swap harnesses like you swap models. Docs
  • WorkflowAgent adds durability: agents that persist state, resume from checkpoints, and support human-in-the-loop approvals across process boundaries.
  • Typed tool context: contextSchema replaces manual type casts in tool callbacks, giving end-to-end TypeScript safety for runtime context like API keys.
  • Video generation added: the unified Core API now covers video generation alongside text, image, speech, and transcription.
  • Breaking changes: OpenTelemetry moved to a separate @ai-sdk/otel package; MCP redirect default changed to 'error' for SSRF protection.
  • Available now as beta: install with pnpm install ai@latest; free and open source, migration guide at ai-sdk.dev.

AI SDK 7 is now in public beta. Vercel's TypeScript toolkit for building AI-powered apps has been the de facto standard for shipping AI features on Next.js for a while now, but version 7 is a meaningful architectural shift, not just a feature bump. The headline addition is HarnessAgent, a new abstraction that lets you plug full coding agent runtimes like Claude Code, Codex, and Pi directly into your app through a unified API.

The problem with agent runtimes today

Provider lock-in, ad-hoc streaming protocols, hand-rolled tool-call shapes, and custom agent loops are maintenance liabilities that the AI SDK has been quietly solving over its lifetime. But until now, that story only covered language model calls. Coding agent runtimes like Claude Code and Codex are a different beast entirely: they own their own session state, sandboxed workspaces, permission flows, and built-in tooling. Integrating them meant writing bespoke glue code for each one.

AI SDK 7 fixes that with a new layer of abstraction sitting above the model provider layer.

HarnessAgent: one API for all coding runtimes

AI SDK 7 introduces HarnessAgent, a single API for running established agent harnesses, including Claude Code, Codex, and Pi. AI SDK has always let you switch models without rewriting your agent. Now you can switch the harness the same way.

A harness (the term used throughout the docs) is a complete agent runtime, not just a model. It owns capabilities that are larger than a model call: workspace access, built-in coding tools, native session state, compaction, permission flows, and runtime-specific configuration. All AI SDK agent harnesses operate in a sandbox, keeping the host environment safe.

The key design decision is that harnesses are decoupled from the model provider abstraction. Providers expose models to AI SDK Core functions such as

Keep reading

Don't miss what's next in AI

Join 300,000+ engineers and researchers who get the signal, not the noise. Create a free account to read the rest of this story.

  • Full access to in-depth AI research breakdowns
  • Be the first to know what's trending before it hits mainstream
  • Daily curated papers, repos, and industry moves