# Program Claude Code, Codex, Pi and other agent harnesses with AI SDK

DevFeed: [Program Claude Code, Codex, Pi and other agent harnesses with AI SDK](<https://devfeed.tech/articles/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk-1046.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/program-agent-harnesses-with-ai-sdk>)

Author: Felix Arntz

Published: 2026-06-12T00:00:00Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [vercel ai sdk](<https://devfeed.tech/topics/vercel-ai-sdk.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Claude](<https://devfeed.tech/topics/claude.md>), [codex](<https://devfeed.tech/topics/codex.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [codex](<https://devfeed.tech/tags/codex.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [sandboxes](<https://devfeed.tech/tags/sandboxes.md>), [sdk](<https://devfeed.tech/tags/sdk.md>)

## AI overview

AI SDK 7 introduces HarnessAgent, a unified API for running established agent harnesses such as Claude Code, Codex, and Pi. It standardizes capabilities including skills, sandboxes, sessions, permissions, runtime configuration, compaction, and sub-agents, while allowing applications to switch harnesses without changing their agent flow or user interface code.

## Source excerpt

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. Write 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 claudeCode for codex or pi and keep the same HarnessAgent flow. Every harness runs the agent in a sandboxed workspace, keeping the host environment safe. Both HarnessAgent.generate() and HarnessAgent.stream() return AI SDK-compatible results. If your app already uses useChat or related AI SDK tooling, you can swap in HarnessAgent without changing your user interface code. HarnessAgent is available on the AI SDK canary release. Read the AI SDK harness documentation to get started. Read more