AI SDK 7 adds unified HarnessAgent API for Claude Code, Codex, and Pi
Vercel's AI SDK 7 introduces `HarnessAgent`, a single unified API for running agent harnesses including Claude Code, Codex, and Pi, letting developers swap harnesses without rewriting agent code.
Score breakdown
`HarnessAgent` extends AI SDK's model-portability abstraction up the stack to the harness layer, meaning developers can switch between Claude Code, Codex, Pi, and future harnesses without rewriting agent or UI code.
- 01AI SDK 7 introduces `HarnessAgent`, a unified API for running agent harnesses.
- 02Initial harness adapters include Claude Code, Codex, and Pi, with more coming soon.
- 03Harnesses manage capabilities above the model call: skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents.
Vercel's AI SDK 7 ships `HarnessAgent`, a new experimental API that normalizes access to agent harnesses — the layer above a raw model call that manages skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents. The release introduces initial adapters for Claude Code, Codex, and Pi, with more planned. The design goal mirrors AI SDK's existing model-portability story: write the agent once, then swap the underlying harness (`claudeCode`, `codex`, or `pi`) without changing the surrounding application logic.
Every harness runs the agent inside a sandboxed workspace, isolating it from the host environment.
Every harness runs the agent inside a sandboxed workspace, isolating it from the host environment. `HarnessAgent.generate()` and `HarnessAgent.stream()` both return AI SDK-compatible results, meaning applications already built on `useChat` or other AI SDK tooling can adopt `HarnessAgent` without modifying their UI code. The feature is currently available on the AI SDK canary release, and Vercel has published dedicated harness documentation to help developers get started.
Key facts
- 01AI SDK 7 introduces `HarnessAgent`, a unified API for running agent harnesses.
- 02Initial harness adapters include Claude Code, Codex, and Pi, with more coming soon.
- 03Harnesses manage capabilities above the model call: skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents.
- 04Every harness runs the agent in a sandboxed workspace to keep the host environment safe.
- 05`HarnessAgent.generate()` and `HarnessAgent.stream()` return AI SDK-compatible results.
- 06Apps using `useChat` or related AI SDK tooling can swap in `HarnessAgent` without changing UI code.
- 07`HarnessAgent` is available on the AI SDK canary release.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 13, 2026 · 08:58 UTC. How this works →