-
-
Describe a freelance deal in your own words, the way you would text it.
-
The AI underlines the words that could start a dispute. Clarity score: 66/100.
-
Each risk comes with a one-line question and ready-to-use wording.
-
Answers become clear terms both sides can verify. Clarity 66 → 100.
-
The AI checks the delivery against every acceptance check and tells the client what to verify.
-
The client funds the milestone through PayPal checkout (JavaScript SDK v6).
-
PayPal authorizes the payment: the money is held, not charged, until the client approves.
-
The client approves and PayPal captures the payment. Milestone paid out.
-
Milestones approved without a hold are billed with a real PayPal invoice.
-
Every milestone settled through PayPal. Agreement completed, with every term both sides agreed on.
Inspiration
As a software engineer, I've always believed technology should do more than make life easier. It should make life a little fairer.
I've worked as a freelancer and as a private tutor. Both taught me that trust is easy to promise and much harder to protect. Most independent work is agreed in a chat message: "a modern website for $900, the last $200 after testing." It sounds clear until the work is done. Then "modern" means something different to each side, nobody agreed who tests, and the last payment never comes.
I've also seen the other side. A client pays up front, and the work arrives late, unfinished, or not what they asked for, and their money is already gone.
In both cases nobody is a bad person. The deal was simply never clear. And most freelancers, tutors and small clients can't afford a lawyer to write a contract.
PayPal already moves money for millions of people every day, so I asked myself: what if AI could make the agreement clear, and PayPal could make the payment fair for both sides? That question became TrustFlow AI.
What it does
TrustFlow AI turns a deal written in everyday words into a clear agreement, and uses PayPal to hold each payment until the work is approved.
It's fair for both sides:
- Freelancers and tutors know the money is really there before they start, and they get paid as soon as the client approves, without chasing anyone for weeks.
- Clients never pay for work they haven't seen. Their money is held, not sent, and it moves only when they approve. If the work isn't right, they ask for changes; if a milestone is cancelled, the hold is voided and they aren't charged.
- Both agree on what "done" means before any work starts, which prevents most disputes in the first place.
How it works:
- I describe the deal in my own words, for example: "I need a modern website for my bakery. $900 total: $300 for the design, $400 for development, and $200 after testing."
- The AI proofreads it. Vague phrases are underlined in my own text, like a proofreader's red pen, and each one comes with a one-line question and suggested wording. A clarity score shows how likely the deal is to end in a dispute.
- Answers become terms. The AI rewrites the milestones with acceptance checks both sides can verify. In my demo, answering a few questions raised the score from 66 to 92.
- Both sides accept, and the terms lock.
- The client funds a milestone with PayPal. The money is authorized and held, not charged.
- The freelancer submits the work. The AI checks the delivery note against every acceptance check and tells the client what has evidence and what still needs a look.
- The client approves, and PayPal releases the payment. Milestones that weren't funded up front can be billed with a PayPal invoice.
A payment agent built on Gemini function calling works for whichever side is using the app. It reads the agreement, checks live status in PayPal, prepares invoices and proposes payment releases. It never moves money on its own: every money movement becomes an approval card that a person approves or declines.
How we built it
PayPal is the heart of TrustFlow. The whole idea of "money held fairly until the work is approved" exists because PayPal's platform makes it possible with standard, trusted building blocks:
- JavaScript SDK v6 (
createInstance,findEligibleMethods,createPayPalOneTimePaymentSession) gives clients a familiar, secure PayPal checkout in a popup, with an automatic redirect fallback. - Orders API v2 with
intent: AUTHORIZEis what turns "pay" into "hold". The client's money is reserved, not charged. - Payments API v2 captures the payment in one call when the client approves, voids the hold when a milestone is cancelled, and reports live authorization status.
- Invoicing API v2 drafts, sends and tracks invoices for milestones paid after delivery.
- Webhooks with signature verification keep every milestone in sync with PayPal.
- Every write call sends a
PayPal-Request-Id, so a retry or a double click never creates a second order or capture. The server only accepts the order it created for a milestone and checks that the authorized amount matches before marking it funded.
Without authorizations, the product would just be a nice contract editor. With them, both sides finally have a reason to trust each other.
AI (Google Gemini):
- Structured JSON output for agreement analysis and delivery checks.
- Function calling for the payment agent, with tools limited by role: the client's agent can propose a release, the freelancer's can prepare an invoice.
- I never trust raw model output: quotes are highlighted only if they really appear in the user's text, amounts are recomputed in integer cents, and the clarity score is plain arithmetic the user can open and read.
The app:
- A dependency-free Node.js server and a vanilla JavaScript interface, deployed on Render.
- Each milestone has two state machines, one for the work and one for the money, and both the buttons and the AI agent go through exactly the same rules.
- An end-to-end test runs the whole flow against PayPal and Gemini mocks, including a check that the agent can never capture money without approval.
Challenges we ran into
How much power should AI have over money? AI is great at finding unclear requirements, but it can't fairly decide whether the client or the freelancer is right. So in TrustFlow the AI explains, prepares and proposes, and every capture, void and invoice waits for a human click.
Speed. My first version took more than 90 seconds to analyze one agreement. Nobody waits that long. I measured each change, lowered the model's reasoning effort, shortened the output and switched to a faster model. The same analysis now takes about 4 seconds.
Being honest about what it is. I wanted a trustworthy payment experience without pretending to be a legal escrow service. TrustFlow uses a standard PayPal authorization and says clearly that it helps people understand each other, not that it gives legal advice.
Simplicity. A tutor shouldn't need to learn financial terms to use it. Every label says what happens in plain words: "On hold in PayPal", "Paid out", "Approve and release $300".
Accomplishments that we're proud of
- It works end to end on the PayPal sandbox: a hold, a capture, a void and a paid invoice, all from one agreement written in plain English.
- The "proofread" view. Seeing your own sentence with red marks under the words that could cost you money makes the problem obvious in a second.
- An AI agent that does the tedious work while people stay in control of every dollar.
- Turning a problem I've lived through, on both sides of the deal, into a product someone could actually use.
What we learned
Automation isn't always the answer. Sometimes technology is most useful when it helps people ask better questions and understand each other.
Financial software needs transparency, clear limits and meaningful approval at every step. I learned to treat model output as a suggestion that code must check, not as the truth.
And I learned how much is already possible with the right platform. PayPal's authorize-and-capture flow solved the hardest part of my idea, holding money fairly, with a few well-designed API calls.
What's next for TrustFlow AI
- Shareable agreement links, so each side uses their own device and account.
- PayPal multiparty payments, so a marketplace version can pay many freelancers at once and take a platform fee.
- Reminders before a hold expires, and re-authorization for longer projects.
- Exporting the agreed terms as a document both sides can keep.
- Reaching people where legal help is hard to find. The AI already works in the user's own language, and PayPal already works in more than 200 markets.
My dream is simple: anyone, anywhere, can agree on work in a chat message and know it will end fairly. People who do honest work deserve to get paid, and people who pay deserve to get what they agreed on. With AI to make deals clear and PayPal to make payments fair, I believe that's within reach.