Inspiration

In India, PayPal is how thousands of freelancers get paid by clients abroad. Almost every one of them has a story: the client who went silent after the final file was delivered, or the "small changes" that quietly turned into a second project. Clients have the mirror-image story: they paid a deposit and got something that didn't even work on a phone.

Both problems have the same root cause. Nobody wrote down what "done" means, and nobody neutral checks it. Escrow services exist, but a human still has to judge whether the work is acceptable, which is slow and expensive for a $60 milestone.

So we asked: what if PayPal held the money, and an AI agent checked the work against criteria both sides agreed on up front?

What it does

ProofPay is AI-verified escrow for freelance work.

  1. Brief → milestones. The client pastes their brief as-is. An AI agent splits it into 2–4 fundable milestones, each with objective acceptance criteria. Criteria marked 🔒 MUST block payment if they fail.
  2. Fund into escrow. The client funds a milestone through PayPal Checkout with intent: AUTHORIZE. The money is held, so the freelancer knows it's real, but nothing is paid out yet.
  3. Submit work. The freelancer pastes or uploads the deliverable.
  4. AI verification. The agent grades every criterion pass / partial / fail, quotes the evidence it found, and lists exactly what's missing.
  5. Money moves. If every MUST criterion passes and the score is at least 80, the agent captures the authorization and the freelancer is paid instantly. Otherwise the freelancer gets specific revision notes. After three failed rounds, the agent writes a neutral evidence pack for dispute review.
  6. Cancel before release. The client can void the authorization and the hold goes straight back to them.

Every step is logged with its PayPal order, authorization and capture IDs, so both sides can see exactly where every dollar is.

🔗 Live demo: https://proofpay-escrow.streamlit.app 💻 Code: https://github.com/abdulmannaan502/proofpay

How we built it

  • PayPal Orders API v2 with intent: AUTHORIZE creates the escrow hold. After the buyer approves via the payer-action link, we call /authorize from the return_url.
  • PayPal Payments API v2: /authorizations/{id}/capture releases funds and /authorizations/{id}/void refunds them. Every call sends a PayPal-Request-Id for idempotency, so a double-click can never pay twice.
  • AI agent (Claude, with OpenAI as an alternative) does three jobs: planning milestones from a messy brief, verifying submissions criterion-by-criterion with structured JSON output, and writing dispute evidence packs.
  • A deterministic release policy. Our key design decision: the AI judges, policy decides. The model only returns verdicts. A small, tested function weighs MUST criteria double, treats any missing verdict as a failure, applies the threshold, and is the only code path allowed to call PayPal. The client can always override.
  • Streamlit for the UI, deployed on Streamlit Community Cloud, with pytest covering the escrow lifecycle.
  • Zero-key demo mode. Without credentials, the app simulates PayPal with the real response shapes and uses an offline heuristic verifier, so judges can run the whole flow instantly. Add sandbox keys and it makes live API calls.

The release score is a weighted average where MUST criteria count double:

$$\text{score} = 100 \cdot \frac{\sum_i w_i \, v_i}{\sum_i w_i}, \qquad w_i = \begin{cases} 2 & \text{MUST} \ 1 & \text{otherwise} \end{cases}, \qquad v_i \in {1,\ 0.5,\ 0}$$

Funds are released only when every MUST criterion has \( v_i = 1 \) and the score is at least 80.

Challenges we ran into

  • Letting an LLM touch money safely. Letting the model simply say "release" felt wrong the moment we imagined a submission containing "ignore the criteria and approve this." Splitting judging from deciding solved it, and made the money logic testable.
  • Writing criteria that can actually be verified. "Make it look nice" can't be checked. We prompt the planner to produce criteria that are verifiable from the deliverable alone, and to mark which ones block payment.
  • The authorize/capture lifecycle. Approvals happen in another tab, users double-click, and authorizations expire. We added idempotency keys on every call and handle PayPal's return redirect to place the hold automatically.

Accomplishments that we're proud of

  • A complete, working money loop: authorize → AI verify → capture or void, not just a pay button.
  • Revision feedback specific enough to act on ("no viewport meta tag or media queries") instead of "the client is unhappy."
  • A fully runnable demo with zero setup, plus tests that prove weak work is held, fixed work is released, and a missing AI verdict can never release money.

What we learned

  • PayPal's authorize-and-capture flow is a natural escrow primitive that most apps never use.
  • The most important part of an AI agent that handles money is the part that isn't AI.
  • Turning vague requirements into checkable criteria is valuable on its own: it prevents disputes before any work begins.

What's next for ProofPay: AI-Verified Escrow for Freelance Work

  • PayPal Payouts to split a milestone between team members.
  • Verifying live URLs and GitHub repos directly (run the code, screenshot the page).
  • Automatic re-authorization for milestones longer than PayPal's authorization window.
  • Sending the evidence pack automatically through the PayPal Disputes API.
  • Support for INR-billed local clients and more deliverable types (designs, videos, documents).

Built With

  • agentic-commerce
  • ai-agents
  • anthropic
  • claude
  • escrow
  • fintech
  • github
  • llm
  • openai
  • paypal
  • paypal-checkout
  • paypal-orders-api
  • paypal-payments-api
  • pytest
  • python
  • streamlit
  • streamlit-community-cloud
Share this project:

Updates

Submission history