Mastra agents expose tools with execute handlers — the same boundary Paybond guards in the agent-agnostic path. A dedicated createPaybondMastraConfig runner helper is planned; Paybond does not ship a @paybond/kit/mastra subpath yet.
Adapter planned — integrate today
Use agent-agnostic spend controls: wrap Mastra tool handlers with paybond.instrument({ tools }) and register the returned tools on your Mastra agent. For MCP-first hosts, see MCP agent spend controls.
Try it
Validate authorization and evidence without a Mastra runtime:
terminal
paybond login
paybond agent demo generic smoke \
--operation paid-tool \
--requested-spend-cents 100 \
--evidence-preset cost_and_completion \
--format tableWire Mastra tools today
import { Paybond } from "@paybond/kit";
const paybond = await Paybond.open({ apiKey: process.env.PAYBOND_API_KEY! });
const { tools } = await paybond.instrument({
policy: "./paybond.policy.yaml",
tools: {
"travel.book_hotel": bookHotel,
searchWeb: searchWeb,
},
});
// Register `tools` with your Mastra agent/tool definitions.
Production: await instrumented.bind({ intentId, capabilityToken }) per session — see Agent middleware.
Request a Mastra adapter
If Mastra is your primary stack, request a Mastra adapter and mention Mastra in your message. We prioritize native adapters by production demand and community signal.
Related guides
- Agent-agnostic spend controls — recommended path until the Mastra adapter ships
- Express and Fastify agent routes — HTTP servers wrapping
instrument() - MCP agent spend controls — stdio MCP for external hosts
Developer reference: /docs/kit/mastra (planned adapter).