Introduction
Community packages for the Vercel AI SDK harnesses, for Docker Sandboxes, microsandbox, Cloud Run sandboxes, Anthropic Sandbox Runtime, plugins, sessions and approvals.
The AI SDK harnesses drive a coding-agent runtime (Claude Code, Codex, OpenCode…) from your application, through a HarnessAgent. This project publishes community packages for it, under the fpasquet npm account, of four kinds:
- Sandboxes: where the agent runs. Every command and file operation of the agent happens there, and the credentials stay outside.
- Plugins: what the agent can do. Tools, skills, rules, slash commands, hooks, subagents and MCP servers, bundled into plugins that apply to every runtime.
- Sessions: the conversations of your users with the agent. Several side by side in one sandbox, suspended when idle, resumed on the next message and after a restart.
- Approvals: a person in the loop. A policy that lets the agent's harmless commands run, refuses what you forbid and asks about the rest, with "always allow" for a conversation.
Getting started
Install a sandbox package and run a first Claude Code turn in a Docker Sandbox.
Adding plugins
Give the agent a hook, a slash command, a skill and an MCP server, in code or JSON, then let it pick from a marketplace.
Managing sessions
Run many conversations in one sandbox, suspend them when idle, resume them after a restart, and wait for approvals.
Approving tool calls
Let a policy allow, refuse or ask about the agent's commands and edits, and answer its questions from a form.
Securing credentials
Keep the API keys and subscription tokens of the harnesses safe, in your application and at rest.
Next.js chat
A useChat page talking to Claude Code, Codex and every other AI SDK harness in a sandbox, with plugins and a slash-completing prompt.
Sandboxes
A sandbox package gives HarnessAgent.createSession({ sandboxSession }) what it expects, a HarnessV1NetworkSandboxSession: switching from one to the other is a matter of which function creates it.
| Package | Where the agent runs | Status |
|---|---|---|
ai-sdk-sandbox-sbx | A Docker Sandbox microVM (sbx), on your machine or in Docker Sandboxes Cloud | Preview, 0.x (cloud mode experimental) |
ai-sdk-sandbox-microsandbox | A microsandbox microVM, booted from any OCI image on your machine | Preview, 0.x |
ai-sdk-sandbox-cloud-run | A Cloud Run sandbox on Google Cloud, scaled to zero between turns | Preview, 0.x |
ai-sdk-sandbox-gce | A Compute Engine virtual machine per sandbox on Google Cloud, Docker included | Preview, 0.x |
ai-sdk-sandbox-runtime | Anthropic Sandbox Runtime (srt) on this host: bubblewrap or sandbox-exec | Preview, 0.x (srt is a research preview) |
Plugins
ai-sdk-harness-plugins (Preview, 0.x) works with any sandbox and any runtime. A plugin is written in code with definePlugin(), read from a Claude Code plugin directory with loadClaudeCodePlugin(), or written as JSON: plugins are configuration, wherever they are kept. A catalog gathers them for a marketplace, where each agent picks whole plugins or single tools, skills, rules, commands, hooks, subagents and MCP servers, with what they require; withPlugins() applies what it picked.
| A plugin's… | What it is | Claude Code | Codex |
|---|---|---|---|
| tools | AI SDK tools run on your server, or commands run in the sandbox | ✅ | ✅ |
| skills | Instructions the agent loads when it judges them relevant | ✅ | ✅ |
| rules | Instructions the agent follows, for every file or some | ✅ | ✅ |
| commands | /<name> prompts, expanded on your server | ✅ | ✅ |
| hooks | Commands the runtime runs at a moment of the session, in the sandbox | ✅ | ✅ |
| subagents | Specialists the agent delegates to | ✅ | ✅ |
| MCP servers | Connected by your server, or run by the runtime in the sandbox | ✅ | ✅ |

A hook at work in the Next.js starter: written in JSON with its script, it runs in the sandbox before each read or shell command of Claude Code. It blocked the reading of .env, and told the agent why.
Sessions
ai-sdk-harness-sessions (Preview, 0.x) runs the sessions of a HarnessAgent for you, whatever the runtime and the sandbox: one turn at a time per session, several sessions side by side in one sandbox (each in a view of it, fork()), a session suspended when nobody writes to it and resumed on the next message, a turn paused until the user approves a command, and every session suspended when your server stops, to be resumed after it starts again.

Workspaces
ai-sdk-harness-workspace (Preview, 0.x) puts your repository in the sandbox: each session works in a checkout of its own, a Git worktree on a branch of its own, so several agents work side by side on one repository, and what each one changed comes back as a patch your server applies. The code comes from a Git server, its token brokered rather than handed to the sandbox, from your server as Git bundles, or from the sandbox itself.

Approvals
ai-sdk-harness-approval (Preview, 0.x) keeps a person in the loop, the same way for every harness: an approval policy allows the agent's commands and edits you trust, refuses those you forbid with a reason the agent reads, and leaves the rest to the user, who can allow them for the rest of the conversation. With ai-sdk-harness-sessions, the policy answers within the turn. Its components, ToolApproval and QuestionsForm, install from this site's shadcn registry.

Network
ai-sdk-harness-network (Preview, 0.x) closes the sandbox's network to all but what the agent needs: the hosts of the forges, package registries, toolchains and container registries of the whole ecosystem, those each harness and model provider calls, and those your workspace and plugins name, checked and merged into a network policy every sandbox package takes.
Versioning
Every package is released on its own with Changesets, and is in its 0.x series: its API settles with the feedback of the people trying it, before a 1.0.0. The public API is what a package exports from its entry point. Until 1.0.0, a minor release (0.1 → 0.2) may break it, and its changelog says how with a BREAKING: note; a patch release (0.1.0 → 0.1.1) never does. The caret range npm installs by default, ^0.1.0, therefore stays on 0.1.x. The AI SDK harnesses are themselves experimental: when their HarnessV1 interfaces break, the packages follow in their next minor.
From 1.0.0 on, the packages will follow Semantic Versioning: breaking changes in a major only, except a feature documented as experimental, such as the cloud mode of ai-sdk-sandbox-sbx, which may change in a minor release and says so.
Feedback is what gets the packages to 1.0.0: open an issue for what works, what does not, and what is missing.