The fx adapter now runs the harness on the host
By Steven Van ·
The AI SDK's experimental fx adapter keeps model credentials on the host and adds tool filtering, mid-turn steering, structured output and resumable sessions.
The Vercel AI SDK's fx adapter for HarnessAgent now runs the harness and model requests in the same process as the application, according to the fx harness documentation. Built-in filesystem and shell operations stay isolated in the sandbox. The adapter is built on libfx, the TypeScript library for fx.
What changes in the sandbox
The adapter no longer installs fx inside the sandbox, runs a sandbox bridge, or exposes a sandbox port. Model credentials stay on the host and are not forwarded into the sandbox. The sandbox does not need network access for model requests, but the host needs network access for AI Gateway and any configured MCP servers.
New in the rewrite
- Built-in tool filtering: choose which built-in tools the agent can use, through activeTools and inactiveTools.
- Mid-turn steering: send new instructions while a turn is running.
- Structured output: generate responses that match a schema.
- Image tool results: return images to the model through toModelOutput().
- Resumable sessions: sessions can be saved and resumed in a new host process.
Setup and limits
Update @ai-sdk/harness-fx to the latest version to use the new adapter. Authentication works with Vercel AI Gateway (VERCEL_OIDC_TOKEN or AI_GATEWAY_API_KEY) or with Codex or Grok subscriptions. The sandbox must provide Bash and GNU command-line utilities such as find, grep, realpath and base64.
The harness packages are marked experimental, so breaking changes between releases are expected. Manual compaction is not supported and throws HarnessCapabilityUnsupportedError.