Use ACP-compatible harnesses with the AI SDK harness layer
Vercel’s AI SDK harness layer now supports ACP-compatible harnesses via the new @ai-sdk/harness-acp package, expanding integration options beyond direct runtime adapters.
The AI SDK harness layer has introduced support for any Agent Client Protocol (ACP)-compatible harness through the new @ai-sdk/harness-acp package. This package functions as a meta adapter, enabling developers to create adapters for harnesses that provide ACP-compatible packages rather than wrapping a single runtime. The approach abstracts the harness implementation, allowing for broader compatibility without requiring direct integration with specific runtimes. The AI SDK harness layer remains decoupled from ACP to maintain flexibility in harness selection and configuration.
To implement a harness using @ai-sdk/harness-acp, developers pass the ACP-compatible package to the createACP function and configure basic harness mapping. This method simplifies the process of integrating new harnesses that adhere to the ACP standard, reducing the need for custom adapters for each runtime. However, not all harnesses support ACP, and some may experience limitations in exposing internal behaviors when using ACP-based implementations.
For harnesses like Claude Code and Codex, Vercel recommends using the direct adapters @ai-sdk/harness-claude-code and @ai-sdk/harness-codex instead of an ACP-based approach. These direct adapters provide tighter integration and avoid potential limitations imposed by ACP. The ACP-based adapter should be reserved for harnesses without direct support or those that benefit from a protocol-based abstraction.
The new @ai-sdk/harness-acp package is now available for developers to explore. Documentation for ACP harness integration is provided to guide implementation, ensuring developers can leverage the protocol to expand their harness compatibility within the AI SDK ecosystem.