Control how AI agents spend
Open-source SDK for policy-controlled spending, approvals, and audit logs. Give your agents safe purchasing power in 3 lines of code.
pip install paygraph

x402from paygraph import AgentWalletwallet = AgentWallet()spend_tool = wallet.spend_tool# Pass spend_tool to your LangGraph agentfrom paygraph import AgentWallet, SpendPolicy, StripeCardGatewaywallet = AgentWallet( gateway=StripeCardGateway( api_key="sk_live_..." ), policy=SpendPolicy(max_transaction=100.00),)spend_tool = wallet.spend_toolPolicy engine
Set spending limits, approved merchants, and budget caps. Every transaction gets checked before it goes through.
Payment gateways
Pluggable gateway interface. Ships with Stripe Issuing, bring your own gateway tomorrow. MPP on the roadmap.
Audit trail
Every spend attempt is logged: which agent, what policy was checked, approved or denied, and why.
How it works
Agent calls spend_tool
Your agent hits the spend tool with an amount, merchant, and reason. Just a normal tool call.
Policies get checked
PayGraph runs the request through your policies. Spending limits, approved categories, remaining budget.
Payment goes through
If it passes, the gateway processes it. Everything gets logged either way.
See it in action
Built for
Safe by default
Agents can be manipulated; by scammy websites, crafted invoices, prompt-injected tool responses. Any guardrail that lives inside the LLM context is part of the attack surface.
PayGraph's policy engine runs outside the LLM context. Every spend request is evaluated against hard rules before it reaches the payment gateway. This is a control plane, not a payment wrapper.
Open source
PayGraph is MIT-licensed and built in the open. Contributions, issues, and feedback are welcome.
Star on GitHub →