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
View on GitHub →
LangGraphCrewAIStripe Issuingx402
quickstart.py
from paygraph import AgentWallet
wallet = AgentWallet()
spend_tool = wallet.spend_tool
# Pass spend_tool to your LangGraph agent
production.py
from paygraph import AgentWallet, SpendPolicy, StripeCardGateway
wallet = AgentWallet(
gateway=StripeCardGateway(
api_key="sk_live_..."
),
policy=SpendPolicy(max_transaction=100.00),
)
spend_tool = wallet.spend_tool

Policy 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

Agentspend_tool()PoliciesGatewayAudit Log

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

AI engineersbuilding agent workflows that touch real money
Startupsthat need controlled spend for autonomous agents
Teamsthat want auditability before going live with card issuance

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.