paybondpaybond
Sign in

Mastra spend controls

Native Mastra adapter is planned — use agent-agnostic paybond.instrument() to guard Mastra tool execute handlers today.

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
Terminal commandSwipe to inspect long lines
paybond login
paybond agent demo generic smoke \
  --operation paid-tool \
  --requested-spend-cents 100 \
  --evidence-preset cost_and_completion \
  --format table

Wire 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.

Developer reference: /docs/kit/mastra (planned adapter).