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
paybond login
paybond agent demo langgraph smoke \
--operation paid-tool \
--requested-spend-cents 100 \
--evidence-preset cost_and_completion \
--format tableScaffold
terminal
paybond init agent-middleware --framework langgraph --out paybond-langgraph.ts
paybond policy init --preset travel --out paybond.policy.yamlOr the full wizard:
terminal
paybond init --solution travel --max-spend-usd 500 --framework langgraph --non-interactiveRecommended wiring
paybond-session.ts
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 StateGraphInstall 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.
Related guides
- Agent middleware — run binding and policy hot-reload
- Agent policy-as-code — long-lived graphs with GitOps YAML
- Approve AWS spending with agents — aws preset + LangGraph
Developer reference: /docs/kit/langgraph.