AI SDK 7 ships HarnessAgent, a single API that unifies Claude Code, Codex, and Pi under one interface. Previously, AI SDK let you swap models without rewriting code. Now you can swap the entire agent harness the same way.

Harnesses control everything above the model call: skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents. HarnessAgent normalizes all of it. Swap claudeCode for codex or pi and the HarnessAgent flow stays identical. Both HarnessAgent.generate() and HarnessAgent.stream() return AI SDK-compatible results, meaning existing useChat integrations need zero UI changes. Every harness runs inside a sandboxed workspace.

This is an experimental canary release with three harness adapters available now and more stated to follow. The full harness documentation at ai-sdk.dev/v7 is worth reading for the specifics on how permission flows and sub-agents are normalized across providers, which is where the real complexity lives.

[READ ORIGINAL →]