Inspiration
Half of freelancers have trouble getting paid in a given year, and those who go unpaid lose about $5,968 on average, roughly 13% of their income (Freelancers Union survey of 5,358 freelancers). Clients face the opposite risk: paying up front for work that never arrives. Across borders it's worse. A developer in India billing a client in the US has almost no recourse either way.
Today the only fix is a marketplace that holds the money. It also takes a big fee and keeps the freelancer's reputation locked inside its platform. Meanwhile, AI agents are starting to buy services, and nobody wants an agent that pays before the work exists.
We asked one question: what if the money only moved when the work was provably real?
What it does
ProofPay is escrow on PayPal that pays on proof, not on promises.
- Agree. Paste a plain-English scope of work. Claude turns it into milestones with amounts, deadlines and checkable acceptance criteria (PR merged, CI green, site live, page contains text, or AI-reviewed).
- Hold. The client approves a PayPal order with intent
AUTHORIZE. The money is held, not charged. - Prove. The freelancer submits a GitHub PR, a live URL or a document.
- Verify. ProofPay checks every criterion: the GitHub API for merged PRs and CI results, live HTTP checks protected against SSRF, and Claude as a strict judge for subjective work, hardened against prompt injection.
- Score. An explainable ML model predicts the risk of releasing the money and shows the factors behind it.
- Pay. If every check passes with high confidence and the risk is low, ProofPay captures the hold and pays the freelancer via PayPal Payouts automatically. Otherwise a person decides. Cancelling voids the hold, so the client is never charged.
What makes it different:
- Merge to pay. A freelancer can submit a PR before it's merged. When the maintainer merges it, GitHub's webhook triggers verification and PayPal captures the payment.
- Risk-priced payouts. The ML score decides when the freelancer is paid: instantly for low risk, after 2–7 days otherwise. A PayPal dispute opened in that window pauses the payout.
- Proof the freelancer owns. Every released milestone gets an Ed25519-signed attestation. Anyone can verify it in their browser with the public key, without trusting ProofPay. A freelancer shares their whole track record as one link that names no one.
- Automatic chargeback defence. If the buyer later disputes the payment with PayPal, ProofPay answers through the PayPal Disputes API with the verification record and a signed delivery receipt.
- Safe for AI agents. An MCP server lets agents create escrows, request funding and submit work using their own agent keys. But a person approves every PayPal hold, and the server, not a prompt, blocks agents from refunding, overriding holds or resolving disputes.
npm run demo:agentsruns a full job between a buyer agent and a seller agent. - Fair to both sides. Once work is submitted, the client can't quietly cancel; they must request changes or open a dispute. The freelancer can always give the money back.
How we built it
- PayPal: Orders v2 (
AUTHORIZE), Payments v2 (authorize, capture, void, reauthorize), Payouts v1, Disputes API (provide evidence), webhook signature verification, andPayPal-Request-Ididempotency on every write. It respects PayPal's 29-day authorization limit and warns before a hold expires. - AI (Claude): forced tool calls for structured output, used for plan extraction, deliverable verdicts and neutral dispute briefs. Evidence is fenced as untrusted input, and confidence is capped when prompt injection is detected. Every AI path has a deterministic fallback.
- Machine learning: a logistic-regression release-risk model (scikit-learn, AUC 0.785), exported to JSON and scored natively in the API: $$p_{\text{risk}} = \sigma\left(b + \sum_i w_i x_i\right)$$ Each factor's contribution \( w_i x_i \) is shown to the user. We chose it over gradient boosting (AUC 0.780) because money decisions must be explainable.
- Cryptography: Ed25519 compact JWS with a public JWKS, browser-side verification with WebCrypto, and salted email hashes for privacy.
- APIMatic: the whole API is one OpenAPI 3 spec, used by APIMatic for SDKs and a developer portal. A test fails if the spec and the server drift apart.
- AG Grid: a reviewer risk desk across all escrows (risk bars, days left on each PayPal hold, dispute highlighting) and an audit ledger of every money movement.
- Bryntum Gantt: a timeline of each milestone's working time against its 29-day PayPal hold window.
- Render: a one-click Free-plan Blueprint with a health check and a generated reviewer key.
- Also: an MCP server (HTTP + stdio), a Postman collection, signed Zapier webhooks, and GitHub webhooks.
- Stack: TypeScript, Node.js, Express, Zod, SQLite, vanilla JS. 36 automated tests, 33 browser checks and 10 live LLM evals.
Challenges we ran into
- Money can never move twice. We designed a state machine where a hold can't be captured twice, captured after a void, or released by the wrong person, even when PayPal webhooks and browser redirects race each other.
- Making AI safe enough to move money. We needed confidence thresholds, structured output, untrusted-evidence fencing and prompt-injection detection, and every uncertain case goes to a human.
- No public escrow data. We trained v1 on a documented synthetic process and built outcome logging so the model can be retrained on real results.
- Portable proof without exposing people. Attestations carry hashes, not emails. Identity is only confirmed when the freelancer chooses to share it.
- Working within PayPal's real limits: the 29-day authorization window, the 3-day honor period, and sandbox versus live behaviour.
Accomplishments that we're proud of
- A complete loop from a plain-English scope to a real PayPal capture and payout in one flow.
- Guardrails for agentic payments that live in the server, not in a prompt.
- Proof that outlives the platform. A freelancer's record stays verifiable with nothing but a public key.
- Every automated decision is explained: which checks passed, how confident the verifier was, and what drove the risk score.
- Six sponsor tools working together in one product: PayPal, Claude, APIMatic, AG Grid, Bryntum and Render.
What we learned
PayPal authorizations are the right building block for escrow: they make "held, not charged" real for the client, and a void gives a clean cancel. We also learned that for AI touching money, the real question isn't "can the model decide?" but "when must it hand off to a human?" Designing those handoffs mattered more than the model itself.
What's next for ProofPay: AI Escrow That Pays on Verified Work
- PayPal Multiparty with delayed disbursement, so funds sit in the freelancer's own PayPal account until release.
- Log in with PayPal for user accounts.
- Attestations in the W3C Verifiable Credentials format, so freelancers can carry their record into any wallet.
- More verifiers: Figma files, app store builds, design reviews.
- Retraining the risk model on real outcomes. The export and retraining pipeline is already built.
Built With
- ag-grid
- anthropic
- apimatic
- bryntum
- claude
- ed25519
- express-js
- github-api
- machine-learning
- model-context-protocol
- node.js
- paypal
- paypal-disputes-api
- paypal-orders-api
- paypal-payouts-api
- postman
- render
- scikit-learn
- sqlite
- typescript
- webcrypto
- zapier