Their framework + our kernel

You already use Vercel AI SDK 6, Cloudflare codemode, Mastra, the Anthropic Claude Agent SDK, or OpenAI Agents JS — and you want sandboxed code execution without Docker, E2B, or another service. Each recipe below drops an wasmagent kernel into your framework as one tool / one executor / one provider — your existing setup keeps working.

Click try a live patch on any recipe to run the kernel on this deployment; the patch you see is what came back from the worker.

Vercel AI SDK 6

streamText({ tools }) keeps every primitive you have. Replace your sandboxed code-exec tool with one backed by a WasmAgent kernel — no Docker / E2B server.

npm add @wasmagent/aisdk @wasmagent/kernel-quickjs @wasmagent/core
import { streamText } from "ai";
import { sandboxedJsTool } from "@wasmagent/aisdk";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";

const safeJsTool = sandboxedJsTool({
  kernel: new QuickJSKernel(),
  capabilities: { allowedHosts: [], cpuMs: 5000, memoryLimitBytes: 64_000_000 },
});

await streamText({
  model: anthropic("claude-sonnet-4-6"),
  tools: { run_js: safeJsTool /* ...your other tools */ },
  messages,
});
open framework docs ↗

Cloudflare codemode

DynamicWorkerExecutor binds you to Workers. createCodemodeExecutor runs the same codemode shape on Node / Bun / Vercel / Lambda, plus optional Python via PyodideKernel.

npm add @wasmagent/aisdk @wasmagent/kernel-quickjs @wasmagent/core
import { Agent } from "@cloudflare/agents/codemode";
import { createCodemodeExecutor } from "@wasmagent/aisdk";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";

const agent = new Agent({
  tools: { /* your existing codemode tool surface */ },
  executor: createCodemodeExecutor({
    kernel: new QuickJSKernel(),
    capabilities: { allowedHosts: ["api.example.com"], cpuMs: 5000 },
  }),
});
open framework docs ↗

Mastra

Mastra's sandbox provider takes any backend. wasmagent gives you WASM isolation (in-process or remote) without Blaxel / E2B service standoff.

npm add @wasmagent/mastra-sandbox @wasmagent/kernel-quickjs @wasmagent/core
import { Mastra } from "@mastra/core";
import { createMastraSandbox } from "@wasmagent/mastra-sandbox";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";

const mastra = new Mastra({
  sandbox: createMastraSandbox({
    kernel: new QuickJSKernel(),
    capabilities: { allowedHosts: [], cpuMs: 5000 },
  }),
});
open framework docs ↗

Anthropic Claude Agent SDK

Claude Agent SDK takes {name, description, input_schema, handler}. sandboxedJsClaudeTool produces that shape with kernel isolation already wired.

npm add @wasmagent/claude-agent-sdk @wasmagent/kernel-quickjs @wasmagent/core
import Anthropic from "@anthropic-ai/sdk";
import { sandboxedJsClaudeTool } from "@wasmagent/claude-agent-sdk";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";

const tool = sandboxedJsClaudeTool({
  kernel: new QuickJSKernel(),
  capabilities: { allowedHosts: [], cpuMs: 5000 },
});

const client = new Anthropic();
await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 4096,
  tools: [tool],
  messages,
});
open framework docs ↗

OpenAI Agents JS

@openai/agents takes Tool<T> with a Zod parameters schema and execute(). sandboxedJsAgentTool wires that to a WasmAgent kernel.

npm add @wasmagent/openai-agents @wasmagent/kernel-quickjs @wasmagent/core
import { Agent, run } from "@openai/agents";
import { sandboxedJsAgentTool } from "@wasmagent/openai-agents";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";

const agent = new Agent({
  name: "code-runner",
  instructions: "Run the user's JavaScript snippet inside the sandbox.",
  tools: [sandboxedJsAgentTool({
    kernel: new QuickJSKernel(),
    capabilities: { allowedHosts: [], cpuMs: 5000 },
  })],
});

await run(agent, "compute the 20th Fibonacci number");
open framework docs ↗