Inspiration

Donations and grants often fail at the same point: the money is sent first and the proof comes later, if at all. Donors can't tell whether a well was actually built, and honest workers wait weeks to be paid. We wanted money that moves only when the work is proven.

Tollgate itself began as a guard for AI agents that hold PayPal refund and invoice tools: a policy layer that decides what an agent is allowed to do with money. ProofPay applies that same engine to a real problem, releasing donations only for proven work.

What it does

ProofPay is the product: a donor reserves money on PayPal, and each stage of a project (for example 30% / 40% / 30%) is paid to the worker only when photo evidence proves the work was done.

Tollgate is the guard. It is a small policy engine that every money-moving call must pass through. The AI never touches money. It only gives opinions, and Tollgate is the last gate before PayPal's two money calls (capture a reservation, pay the worker). It is default-deny, which means anything not explicitly allowed is refused:

  • Only known, trusted records can be paid. A capture must reference a reservation the donor actually approved and can never exceed it. A payout can only go to the one worker on the project, and never more than was captured and not yet paid.
  • Untrusted text cannot move money. Anything an uploader controls, including text written inside a photo, is tagged untrusted. Money calls need a verified release decision behind them.
  • A human approval is bound to the exact evidence. If the evidence changes after a hold, the approval is refused.
  • Retries cannot double-pay. Every money call carries a request id, so a dropped connection plus a retry produces one capture, not two.
  • Everything is audited in a hash-chained log. Editing any entry breaks the chain.

How a stage is decided:

  1. Evidence checks (plain code, no AI): one-time code in the frame, photo location and time against the job site and stage window, duplicate or near-copy of any earlier photo, and screen-photo detection.
  2. Two independent Claude vision reviewers judge whether the photo shows the stage's work. Their output is an opinion in a fixed shape, validated before use.
  3. The release gate (code) combines both and returns RELEASE, RESUBMIT (worker retries), HOLD (a human verifier decides) or BLOCK.
  4. Tollgate then guards the PayPal calls themselves: a partial capture from each donor, then a payout to the worker.

The principle: the model proposes, code decides. In the demo, $10.00 is reserved, captured over three stages and paid out ($10 reserved, $10 paid, $0 left).

How we built it

Node.js backend with a PayPal integration: Orders v2 (AUTHORIZE) to reserve funds, Payments v2 partial capture per stage, and Payouts v1 to pay the worker. Photo checks use EXIF data and perceptual hashing (dHash). Two independent AI Agent vision reviewers (different prompts) assess each photo, and Tollgate, our policy engine, guards every capture and payout. The front end uses AG Grid and AG Charts for the ledger and funds chart, and Bryntum Gantt for the stage timeline. The API is described in an OpenAPI spec, and the docs portal at /docs/ was generated with APIMatic, including TypeScript and Python SDKs and an llms.txt. We run 100 automated tests, and there is a Postman collection and Slack webhook notifications. Zapier (and Slack) webhook notifications that alert the human verifier when a case is held or a payment fails.

Challenges we ran into

  • PayPal sandbox payouts failed with USER_BUSINESS_ERROR until we switched to separate sandbox personal accounts.
  • Keeping AI from becoming the decision-maker: every AI output is treated as untrusted evidence that code weighs, and Tollgate refuses any money call without a verified release decision.
  • Cheating cases: reused photos, unrelated photos, and photos of a screen all had to be caught and shown.

Accomplishments that we're proud of

  • Real sandbox money moved through all three stages, with the audit chain verifying cleanly.
  • Failure cases are first-class: blocked, sent back, and rejected submissions are shown, not hidden.
  • Full API docs and SDKs generated from the spec.

What we learned

Trust comes from the structure around the AI: default-deny rules, evidence-bound approvals, and a tamper-evident log matter more than the model's score.

What's next for ProofPay, guarded by Tollgate

Live PayPal production onboarding, more evidence types (video, sensor data), multi-verifier approval for large releases, and a donor-facing impact feed.

Note: the hosted demo uses a mock PayPal and a fixed one-time code for demonstration; the sandbox run used the real PayPal API.

Built With

Share this project:

Updates

Submission history