Skip to content
AI Primer
release

AI SDK adds HarnessAgent for Claude Code, Codex, and Pi portability

AI SDK canary added HarnessAgent, a unified abstraction that runs Claude Code, Codex, and Pi in sandboxed sessions with AI SDK-compatible streams. One integration can now target multiple agent harnesses without separate model-specific plumbing.

3 min read
AI SDK adds HarnessAgent for Claude Code, Codex, and Pi portability
AI SDK adds HarnessAgent for Claude Code, Codex, and Pi portability

TL;DR

  • Vercel shipped HarnessAgent in the AI SDK 7 canary, and vercel_dev's launch post says one agent can now target Claude Code, Codex, and Pi through a single API.
  • The official changelog post says the abstraction covers the parts above a model call, including sessions, permission flows, compaction, skills, sandboxes, and sub-agents.
  • According to the HarnessAgent docs, the wrapper exposes AI SDK-style generate() and stream() methods, so harness output plugs into the same stream shape the rest of the SDK expects.
  • cramforce's framing and rauchg's launch post both pitch the release as a way out of both harness lock-in and model lock-in, which is the real hook here.
  • The first practical caveat lives in the docs: the HarnessAgent page says Claude Code and Codex need a real networked sandbox, while Pi can also run in a host runtime with @ai-sdk/sandbox-just-bash.

You can read the launch post, skim the HarnessAgent reference, and check the broader harness overview, which is where Vercel spells out that a harness owns workspace access, built-in tools, native session state, compaction, and permission flows. The adapter list is already concrete: the harness adapters page names Claude Code, Codex, and Pi, and a separate community post from hyperbrowser shows people already treating harnesses as something you can test, debug, and wrap with their own tooling.

HarnessAgent

The release is small in API surface and big in implication. HarnessAgent turns a harness into an AI SDK Agent, so the app talks to one interface while the adapter handles the runtime-specific session model underneath.

The official changelog says that runtime layer includes skills, session handling, permission flows, compaction, runtime configuration, and sub-agents. The overview docs add the missing detail: a harness is meant for behaviors larger than a model call, especially coding tools and workspace access.

That makes the portability claim more specific than "multi-model support." Vercel is standardizing the agent runtime boundary, not just the model client.

Sandbox rules

The HarnessAgent docs make the first important distinction in the feature set: not every harness needs the same execution environment.

  • Claude Code and Codex are documented as bridge-backed harnesses, so they require a real network sandbox such as @ai-sdk/sandbox-vercel.
  • Pi is documented as a host-runtime harness, so it can also run with @ai-sdk/sandbox-just-bash because it does not need a sandbox-exposed port.
  • HarnessAgent returns AI SDK-compatible generate() and stream() results, which is how a harness session can slot into existing SDK streaming code without custom response plumbing.

The overview page also says all AI SDK harnesses operate in a sandbox. That is the security boundary Vercel keeps emphasizing in the launch language from cramforce's framing.

Early ecosystem use

The quickest signal that this category is already escaping the lab came from Hyperbrowser two days earlier. Its /harness plugin for Claude Code runs an agent against a project, watches failures, and writes a CLAUDE.md from the breakpoints it hit, according to hyperbrowser's /harness post.

That post is about Claude Code rather than Vercel's SDK, but it shows the adjacent workflow that makes this launch interesting: harnesses are turning into programmable targets with their own debugging, evaluation, and setup layers. Hyperbrowser even published a setup guide and linked a GitHub examples folder for the command.

Further reading

Discussion across the web

Where this story is being discussed, in original context.

On X· 2 threads
TL;DR1 post
Sandbox rules1 post
Share on X