LangGraph executes tools through ToolNode. Paybond hooks that boundary with awrapToolCall — spend verify before side-effecting tools execute, then auto-evidence after success. Model inference stays on your provider client.
Adapter reference: /docs/kit/langgraph.
awrapToolCall before ToolNode
Harbor authorize runs before side-effecting tools execute in your StateGraph.
Auto-evidence
Hooks finalize spend and submit signed evidence after paid tool success.
Policy budgets
Versioned YAML caps per-call and intent spend for long-lived graphs.
TypeScript and Python
Same langgraph adapter on npm and pip (paybond-kit[langgraph]).
Why Paybond (not just LangGraph checks)?
LangGraph tool nodes and host approvals do not enforce a spend limit, a per-operation permission check (capability token), or a signed completion receipt tied to a spend agreement (intent).
Model / input guardrails
- LangGraph alone
- Yes — SDK or host checks and approvals
- With Paybond
- Yes — plus Harbor authorize at the tool boundary
Spend boundary
- LangGraph alone
- No per-tool Harbor budget or capability token
- With Paybond
- Per-call and intent budgets enforced before invoke
Signed evidence
- LangGraph alone
- SDK traces / logs only
- With Paybond
- Signed completion digests bound to the intent
Intent binding
- LangGraph alone
- No Harbor intent or settlement receipt
- With Paybond
- Capability token + intentId from authenticated bind
Paid tool deny / HITL
- LangGraph alone
- Host or SDK approvals only
- With Paybond
- spend verify, deny, or HITL hold before side effects
| Capability | LangGraph alone | With Paybond |
|---|---|---|
| Model / input guardrails | Yes — SDK or host checks and approvals | Yes — plus Harbor authorize at the tool boundary |
| Spend boundary | No per-tool Harbor budget or capability token | Per-call and intent budgets enforced before invoke |
| Signed evidence | SDK traces / logs only | Signed completion digests bound to the intent |
| Intent binding | No Harbor intent or settlement receipt | Capability token + intentId from authenticated bind |
| Paid tool deny / HITL | Host or SDK approvals only | spend verify, deny, or HITL hold before side effects |
How it works
Adapter flow
ToolNode
LangGraph invokes a side-effecting tool
Paybond awrapToolCall
Harbor authorize before your tool runs
- Verify spend and operation
- Deny or HITL hold
- Issue / check capability
Tool runs
Your tool body performs the paid work
Evidence
Hook finalizes spend + auto-evidence
Paybond hooks ToolNode via awrapToolCall: Harbor authorize before the tool runs, then auto-evidence after success.
3-minute quickstart
Smoke the langgraph adapter sandbox contract:
terminal
paybond login
paybond agent demo langgraph smoke \
--operation paid-tool \
--requested-spend-cents 100 \
--evidence-preset cost_and_completion \
--format tableWhen the smoke succeeds you should see:
- ✓ Spend approved
- ✓ Tool completed
- ✓ Evidence verified (
cost_and_completion)
What success looks like
What success looks like
Authorized tool call · illustrative
- Operation
- paid-tool
- Status
- Approved
- Requested
- $1.00
- Evidence
- Verified
- Preset
- cost_and_completion
Scaffold
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-interactiveWire middleware
Recommended wiring
paybond.agent with framework langgraph returns awrapToolCall and createToolNode for your StateGraph.
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:
paybond_session.py
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))paybond-session.ts
import { paybondAwrapToolCall, paybondToolNode } from "@paybond/kit/langgraph";
const node = paybondToolNode(tools, run);Approval holds: when Paybond 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.
Production checklist
Production checklist
- Scaffold middleware with paybond init agent-middleware --framework langgraph
- Init a policy preset (e.g. travel) and validate tools
- Wire paybond.agent({ framework: "langgraph", tools })
- Bind intentId and capabilityToken per session in production
- Smoke with paybond agent demo langgraph smoke before ship
Works with
Works with
- LangGraph
- OpenAI
- Anthropic
- MCP
Ready to test?
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 and LangGraph
Developer reference: /docs/kit/langgraph.