The Claude Agent SDK registers paid work through in-process MCP tool() definitions. Paybond wraps those handlers so Harbor verifies spend before execution and auto-submits evidence after success. Built-in Claude tools (Read, Bash, etc.) pass through unguarded.
Beta: The Claude Agent SDK is evolving. Treat this adapter as beta until Anthropic stabilizes the SDK.
TypeScript and Python parity — use the tab matching your runtime below.
Try it
Terminal
terminal
Terminal commandSwipe to inspect long lines
paybond login
paybond agent demo claude-agents smoke \
--operation paid-tool \
--requested-spend-cents 100 \
--evidence-preset cost_and_completion \
--format tableScaffold
Terminal
terminal
Terminal commandSwipe to inspect long lines
paybond init agent-middleware --framework claude-agents --out paybond-claude-agents.ts
paybond policy init --preset travel --out paybond.policy.yamlRecommended wiring
paybond-session.ts
Code exampleSwipe to inspect long lines
import { tool, query } from "@anthropic-ai/claude-agent-sdk";
import { z } from "zod";
import { Paybond } from "@paybond/kit";
const paybond = await Paybond.open({ apiKey: process.env.PAYBOND_API_KEY! });
const sdkTools = [
tool(
"travel.book_hotel",
"Book a hotel room",
{ city: z.string(), estimatedPriceCents: z.number() },
async (args) => ({
content: [{ type: "text", text: JSON.stringify(await bookHotel(args)) }],
structuredContent: await bookHotel(args),
}),
),
];
const { claudeAgentsConfig } = await paybond.agent({
policy: "travel",
framework: "claude-agents",
tools: sdkTools,
});
const { mcpServer, allowedTools } = claudeAgentsConfig!;
await query({
prompt: "Book a hotel in Lisbon under budget.",
options: {
mcpServers: { paybond: mcpServer },
allowedTools,
},
});Install extras: pip install "paybond-kit[claude-agents]".
Production bind
Use deferred paybond.instrument() without sandbox: true, then bind per session:
const instrumented = await paybond.instrument({
policy: "./paybond.policy.yaml",
framework: "claude-agents",
tools: sdkTools,
});
const runtime = await instrumented.bind({ intentId, capabilityToken });
// runtime.claudeAgentsConfig → pass to query()
Related guides
- Agent middleware — run binding and tenant isolation
- MCP agent spend controls — stdio MCP hosts
- Agent-agnostic spend controls — Claude tool-use without the Agent SDK
Developer reference: /docs/kit/claude-agents.