AI Briefing
KO

Programming Agent Harnesses like Claude Code, Codex, and Pi Using the AI SDK

·2026.06.12 09:00

Key point

AI SDK 7 introduces HarnessAgent, which lets you run various agent harnesses through a single API.

Details

AI SDK 7 newly introduces HarnessAgent, enabling existing agent harnesses like Claude Code, Codex, and Pi to be run through a single API. Previously, switching models required rewriting agent code, but now even the harness itself can be easily swapped in the same way.

A Harness operates at a layer above model calls, managing skills, sandboxes, sessions, permission flows, runtime configuration, and sub-agents. The AI SDK standardizes access to these capabilities through a unified harness abstraction layer.

Key features include:

  • Flexible swapping: You can swap claudeCode for codex or pi while maintaining the same HarnessAgent flow.
  • Security: Every harness runs the agent in a sandboxed workspace, safely protecting the host environment.
  • Compatibility: HarnessAgent.generate() and HarnessAgent.stream() return results compatible with the AI SDK, so existing useChat users can adopt it immediately without any UI code changes.

This feature is currently in the experimental stage, available in AI SDK canary releases, and the API may change in the future.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.