{"slug": "program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk", "title": "Program Claude Code, Codex, Pi and other agent harnesses with AI SDK", "summary": "AI SDK 7 introduces `HarnessAgent`, a unified API that lets developers run established agent harnesses including Claude Code, Codex, and Pi through a single interface. The new abstraction allows users to switch between different agent harnesses without rewriting code, while maintaining sandboxed workspaces and compatibility with existing AI SDK tooling.", "body_md": "[AI SDK 7](https://ai-sdk.dev/v7/docs/introduction) introduces `HarnessAgent`\n\n, 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.\n\nWrite the agent once. Use the best harness available. Today. In 3 months. A year from now.\n\nHarnesses 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.\n\nInitial harness adapters for this experimental release include Claude Code, Codex, and Pi, with more coming soon.\n\nSwap `claudeCode`\n\nfor `codex`\n\nor `pi`\n\nand keep the same `HarnessAgent`\n\nflow. Every harness runs the agent in a sandboxed workspace, keeping the host environment safe.\n\nBoth `HarnessAgent.generate()`\n\nand `HarnessAgent.stream()`\n\nreturn AI SDK-compatible results. If your app already uses `useChat`\n\nor related AI SDK tooling, you can swap in `HarnessAgent`\n\nwithout changing your user interface code.\n\n`HarnessAgent`\n\nis available on the AI SDK canary release. Read the [AI SDK harness documentation](https://ai-sdk.dev/v7/docs/ai-sdk-harnesses/overview) to get started.", "url": "https://wpnews.pro/news/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk", "canonical_source": "https://vercel.com/changelog/program-agent-harnesses-with-ai-sdk", "published_at": "2026-06-12 00:00:00+00:00", "updated_at": "2026-06-12 14:51:53.233072+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "ai-infrastructure", "large-language-models"], "entities": ["AI SDK", "Claude Code", "Codex", "Pi", "HarnessAgent"], "alternates": {"html": "https://wpnews.pro/news/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk", "markdown": "https://wpnews.pro/news/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk.md", "text": "https://wpnews.pro/news/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk.txt", "jsonld": "https://wpnews.pro/news/program-claude-code-codex-pi-and-other-agent-harnesses-with-ai-sdk.jsonld"}}