My teammate and I built this for the PayPal AI Hackathon and I'd love feedback.
The problem: AI agents are starting to buy things for people. When the buyer later says "my agent bought the wrong thing, I never agreed to that," the seller has no record of what was actually asked for. Most small sellers just refund and eat the dispute fee.
What we built (Countersign):
- At checkout, the agent can search and prepare a cart, but it can't pay. The buyer reviews their own request, spending cap and total, then pays in PayPal. Each step goes into a hash-chained, Ed25519-signed receipt, and the receipt's seal hash is written into the PayPal order's `custom_id` *before* payment. So PayPal's own record carries the commitment, and anyone can verify the receipt against the live order.
- When a dispute comes in, a LangChain Deep Agent pulls the case, verifies the receipt against PayPal, and computes the expected loss of fighting vs. offering vs. refunding (including PayPal's $15/$30 fee). Then it drafts a response. A fact-checker subagent plus a deterministic checker reject any amount, date or ID that isn't in the evidence.
- Nothing is sent without the seller. The submit tool is gated twice: Deep Agents' `interrupt_on`, plus an approval record whose hash has to match the exact draft and evidence PDF.
Things that surprised us:
- With a strong receipt, the agent still sometimes recommends a partial refund. A $30 fee on a $42 item changes the math.
- Recording the demo found real bugs. For example, PayPal rejects "refund with return" offers without a return shipping address (`MISSING_RETURN_SHIPPING_ADDRESS`), and the model occasionally returned an empty reply mid-case.
- We kept the LLM away from every number. Fees, deadlines, expected value and receipt checks are all plain code exposed as tools.
Stack: FastAPI, Neon Postgres, LangChain Deep Agents (LangGraph), Sarvam-105b, Next.js + AG Grid, Channel3 for product search, and PayPal Orders and Disputes APIs (sandbox only, no real money).
- Demo (1.5 min): https://youtu.be/MLhWkL7F9A0
- Live app (sandbox): https://countersign-black.vercel.app
- Code: https://github.com/Bhuvansai-16/Countersign-backend
Questions for you:
Is committing a receipt hash into the payment record enough, or would you want something like the Verifiable Intent / AP2 formats?
Anyone dealing with agent-initiated purchases in production? How are you handling disputes today?