
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
Vercel AI introduces a unified API for agent harnesses like Claude Code, Codex, and Pi, allowing seamless model switching without code changes. 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.
Article Excerpt
From source RSS / original summaryintroduces, 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.
The AI SDK normalizes access to those capabilities through a unified harness abstraction. Initial harness adapters for this experimental release include Claude Code, Codex, and Pi, with more coming soon. Swap for or and keep the same flow. Every harness runs the agent in a sandboxed workspace, keeping the host environment safe. claudeCodecodexpiHarnessAgentBoth and return AI SDK-compatible results. If your app already uses or related AI SDK tooling, you can swap in without changing your user interface code.
HarnessAgent. generate()HarnessAgent. stream()useChatHarnessAgent is available on the AI SDK canary release. Read the to get started. HarnessAgentAI SDK harness documentationRead more
Reader Mode unavailable (could not extract clean content).
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
Opus 4.8 on AI Gateway
Claude Opus 4.8, now available on Vercel AI Gateway, excels in long-horizon agentic execution and complex coding tasks, producing clearer prose for knowledge work. Users can access it via the .anthropic/claude-opus-4.8 model in the AI SDK, benefiting from a unified API with no markup on provider pricing.
