
Program Claude Code, Codex, Pi and other agent harnesses with AI SDK
Quick Answer
Vercel AI introduces a unified API for agent harnesses like Claude Code, Codex, and Pi, allowing seamless model switching without code changes.
Quick Take
The AI SDK 7 enables developers to manage components such as skills and sessions through a single abstraction, enhancing safety with sandboxed environments.
Key Points
- AI SDK 7 allows model and harness switching without rewriting agent code.
- Initial harness adapters include Claude Code, Codex, and Pi, with more to come.
- Harnesses manage skills, sessions, and runtime configurations in a sandboxed environment.
- Compatible results can be returned by both Claude Code and Codex harnesses.
- Developers can use HarnessAgent methods for streamlined integration.
Source Excerpt
introduces, 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. AI SDK 7HarnessAgentWrite the agent once. Use the best harness available. Today. In 3 months. A year from now. Harnesses manage the components above a model call, including skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents. …
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.

