paybondpaybond
Sign in

LangGraph spend controls

Guard LangGraph ToolNode calls with Paybond awrapToolCall hooks — Harbor verify before side effects and auto-evidence after paid tool success.

LangGraph executes tools through ToolNode. Paybond hooks that boundary with awrapToolCall — Harbor verify runs before side-effecting tools execute, then auto-evidence fires after success. Model inference stays on your provider client.

TypeScript and Python parity — use the tab matching your kit below.

Try it

terminal

Terminal commandSwipe to inspect long lines
paybond login
paybond agent demo langgraph smoke \
  --operation paid-tool \
  --requested-spend-cents 100 \
  --evidence-preset cost_and_completion \
  --format table

Scaffold

Terminal
Terminal commandSwipe to inspect long lines
paybond init agent-middleware --framework langgraph --out paybond-langgraph.ts
paybond policy init --preset travel --out paybond.policy.yaml

Or the full wizard:

Terminal
Terminal commandSwipe to inspect long lines
paybond init --solution travel --max-spend-usd 500 --framework langgraph --non-interactive

paybond-session.ts

Code exampleSwipe to inspect long lines
import { Paybond } from "@paybond/kit";

const paybond = await Paybond.open({ apiKey: process.env.PAYBOND_API_KEY! });

const { awrapToolCall, createToolNode } = await paybond.agent({
  policy: "travel",
  framework: "langgraph",
  tools: [bookHotelTool, searchWebTool],
});

const node = createToolNode!([bookHotelTool, searchWebTool], { awrapToolCall });
// Add node to your StateGraph

Install extras: pip install "paybond-kit[langgraph]".

Manual hook wiring

When you already bound a PaybondAgentRun:

from langgraph.prebuilt import ToolNode
from paybond_kit.langgraph_hooks import paybond_awrap_tool_call

node = ToolNode(tools, awrap_tool_call=paybond_awrap_tool_call(run))
import { paybondAwrapToolCall, paybondToolNode } from "@paybond/kit/langgraph";

const node = paybondToolNode(tools, run);

LangGraph does not wrap tools in place via wrapTools — use hooks or createToolNode from instrument().

Approval holds

When Harbor returns an approval hold, surface it to operators, approve in the tenant console, then retry with the same operation, amount, metadata, and approvalToken. Hard denials must not execute the tool.

Developer reference: /docs/kit/langgraph.