Inspiration
Online work has a trust problem. When you hire someone, one side has to trust first: if the buyer pays first, the work might never arrive; if the worker delivers first, the money might never come. Today a person sits in the middle to check the work and settle disputes, which is slow, expensive and often unfair.
And it's getting harder. More and more code and websites are written with AI help, delivered faster than anyone can review them. Buyers need a referee that never sleeps, never takes sides, and can explain every decision with real evidence: the test results, the changed files, the screenshot.
So we asked: what if the payment itself waited for proof? PayPal can already hold money without charging it. We built Veriflow to decide, from evidence, when that money should move.
What it does
Veriflow is pay-on-proof escrow on PayPal.
- Agree. The buyer describes the job in plain English. AI turns it into a checklist of objective, checkable items. The buyer edits and approves it, and the checklist becomes the contract.
- Hold. The buyer approves the payment with PayPal. The money is authorized (held), not charged.
- Prove. The worker submits a GitHub pull request (code jobs) or a live website (website jobs). Checkers gather real evidence for every item:
- GitHub Actions test results and which files the PR changed
- a real browser (Playwright) loading pages, finding text and elements
- AI that uses the site like a person: fills forms, clicks buttons, then judges what happened
- AI vision judging desktop and mobile screenshots
- Google Lighthouse / PageSpeed scores
- Release. A fixed, auditable rule decides the payout, and PayPal captures or voids the hold.
The AI never moves money. It only reports a result and a confidence per item. The decision is plain code:
- Any item unsure, or confidence below \(0.7\) → a human decides; the money stays held.
- Every item passes → full payment.
- Something fails on the first try → the worker gets one chance to fix and resubmit.
- Anything still fails on the second try → the hold is voided; the buyer pays nothing.
- The worker edits files they were told not to touch (e.g. the buyer's tests) → voided immediately, no second chance.
Every step, from checklist to check results to PayPal calls, is written to an audit log and shown live on the job page and in an AG Grid dashboard.
How we built it
- Frontend: React 19 + Vite, PayPal JS SDK for the approval popup, AG Grid for the dashboard of jobs, check results and audit events.
- Backend: Node.js + Express 5 + MongoDB Atlas (Mongoose).
- Payments: PayPal Orders API v2 in the sandbox with
intent: AUTHORIZE: authorize to hold, capture to pay, void to refund. Every capture and void carries aPayPal-Request-Id, so a retry can never pay twice. - AI: Google Gemini for checklist writing, screenshot judging and interaction planning, with a fallback chain across models and Groq as a text backup when quotas run out.
- Checkers: GitHub REST API, Playwright (Chromium), PageSpeed Insights.
- Hosting: Render. The frontend is deployed as an interactive web application, and the API runs as a Docker web service using the official Playwright image.
The checker is a background loop inside the API: it atomically claims one submitted job at a time, runs the checkers, saves evidence, applies the rule, and calls PayPal. Jobs abandoned by a crashed or redeployed server are found and re-queued automatically.
Challenges we ran into
- Cheating and loopholes. Our first payout rule paid partially for whatever passed. Then we realised a worker could open a PR with an empty commit and collect money for the items that "pass" by default, or edit the buyer's tests until they "pass". We added an automatic test-protection item to every code job, and moved to all-or-nothing payouts with an instant void for tampering.
- A server restart could cost the worker their try. Tries were counted when checking started, so a restart mid-check turned the first try into the second one and settled the money. We moved the count to the moment the worker submits.
- Making the AI use a website reliably. Single-page apps don't trigger normal "page loaded" events after a click, so we track network requests and wait for the page text to stop changing. Styled radio cards hide their real inputs, so the agent clicks the label like a person would.
- Running a real browser on a free 512 MB server. One browser per job, one job at a time, and every check has a hard time limit.
- Free AI quotas. We built a model fallback chain and turn raw API errors into readable messages, so a busy model sends the item to human review instead of crashing.
- PayPal sandbox details. Payees must be sandbox business accounts, and an app can only void holds whose payee is its own business account. We designed around that and protected the payout with idempotency keys.
Accomplishments that we're proud of
- A complete, deployed loop: AI contract → PayPal hold → automatic verification → PayPal capture or void, with no human needed unless the AI isn't sure.
- An AI that doesn't just look at a screenshot but actually uses the site (types, clicks, submits) and judges the result.
- A payout rule simple enough to explain in one breath, and an audit trail that shows why every cent moved.
- Catching cheating on screen: a PR that rewrites the tests to "pass" gets caught and pays $0.
What we learned
- Never let the AI hold the money. AI is great at gathering and judging evidence. The decision should be boring, deterministic code, with a human whenever confidence is low.
- Authorize, then capture is a natural escrow primitive in PayPal's Orders API, and idempotency keys matter more than you think.
- Adversarial thinking changes the design. Every rule we wrote, we tried to break as a dishonest worker and as a dishonest buyer.
- Building for flaky reality (sleeping servers, quota limits, restarts, slow CI) takes as long as the happy path.
What's next for Veriflow
- Source code delivery for website jobs: the site's code arrives as a pull request in the buyer's own repo, and the exact checked commit is saved, so the buyer owns the work, not just a link.
- A hybrid payout rule: "required" items that must all pass, plus "work" items paid by share, with protection against buyers adding impossible checks.
- Agent API and MCP server so AI agents can post jobs, submit work and get paid on their own.
- Real accounts and live mode: workers connect their own PayPal accounts via partner onboarding.
- Milestones: one job split into several held payments, each released on its own proof.
Built With
- ag-grid
- chrominum
- css
- express.js
- javascript
- mongodb
- mongoose
- node.js
- playwright
- react