Inspiration
Every small freelance deal has the same standoff: the client won't pay before seeing the work, and the freelancer won't work without knowing the money exists. People fill the gap with deposits, unpaid invoices and awkward follow-ups. AI agents are starting to hire other agents too, with the same trust problem and no human watching. We wanted a contract anyone can write in one sentence, that holds real money on rails people already trust, and that can actually check whether the work was done.
What it does
You type the deal the way you'd text it: "Pay Maya $600 for a bakery logo: $200 when she shows 3 distinct concepts, $400 when the final logo is delivered as SVG and PNG files by Dec 20. If late, 10% off per day, up to 50%."
- AI compiles it into milestones with checkable conditions, deadlines and a capped penalty, plus a plain-English version both parties sign and a list of questions worth settling first.
- The client funds it with PayPal using an order with
intent=AUTHORIZE: the money is held, not sent. - The freelancer uploads proof: images, PDFs, files, links or a GitHub pull request.
- AI verifies each condition. It looks at images, reads PDFs, checks live links and GitHub merge status, and relies on facts Covenant measures itself (real file type from the bytes, image size, PDF page count) rather than the freelancer's claims. Every condition gets reasoning and a confidence score.
- Verified milestones pay out on their own. Covenant captures that milestone from the authorization and sends it to the freelancer with PayPal Payouts. Late penalties are calculated in code and never captured; unearned money is released back to the client.
- Disputes go to an AI arbiter that weighs the signed terms, the evidence and both statements, and its split executes on PayPal immediately.
- A Money dashboard (AG Grid) shows everything held, paid and returned across all contracts, with a Bryntum timeline, an AG Studio report builder, and Ask: type "which milestones are late?" and the AI answers and reconfigures the grid to show the rows behind the answer.
- AI agents can use it too. An MCP server lets agents create contracts, deliver work and get paid, while a human approves the PayPal hold.
How we built it
- PayPal (sandbox): Orders v2 with
intent=AUTHORIZE, JS SDK Buttons, multiple partial captures withfinal_capture, authorization voids, Payouts with status polling, and webhook signature verification. Every money-moving call carries aPayPal-Request-Ididempotency key. It runs in the PayPal account's currency (our sandbox demo settles in SGD). - Google Gemini: four roles (compiler, verifier, arbiter, Ask), each a forced function call with a strict JSON schema, so outputs are structured, never scraped from prose. Images and PDFs are sent natively. The same code also runs on Anthropic Claude.
- Deterministic money engine: penalties, splits, rounding and capture amounts are integer-cents code with unit tests. The model interprets; code enforces.
- Production basics: SQLite with a durable job queue, per-contract locks, hashed access keys with one-time invite links, rate limits, CSRF guard, security headers, idempotency keys on every write, health checks and graceful shutdown.
- Evaluation: a 24-case labelled suite covering good work, incomplete work, fakes and prompt-injection attempts, measuring decision accuracy and unsafe payouts.
- App: Node + TypeScript server, server-sent events so both parties see money move live, React 19 front end, MCP stdio server, Postman collection, Render blueprint.
Challenges we ran into
- Escrow from authorizations. The last capture must set
final_captureor the remainder stays held, so the state machine is built around which milestone settles last, so unearned money is always released. - Prompt injection through evidence. The freelancer controls what the verifier reads. Evidence is treated as untrusted data; any flagged milestone goes to a human instead of paying out.
- Trusting AI with judgment but not with money. The model decides whether a condition is met and how confident it is; the release threshold and all arithmetic live in code.
- Real-world reliability. Model overloads are retried with backoff, and a binding dispute ruling is refused (with nothing moving) rather than silently downgraded.
Accomplishments that we're proud of
- One sentence in, a working escrow contract out, with real sandbox money moving through Orders, Captures, Voids and Payouts.
- A verifier that shows its work: every condition gets a tick, a confidence and a sentence explaining which file it relied on.
- A safety rule we can prove: the non-AI fallback never pays on its own.
What we learned
PayPal's authorize-and-capture model is a natural fit for milestone escrow: nothing needs to be refunded if it was never captured. And the most useful thing AI can do in a payment flow isn't moving money; it's producing a verdict a person can audit, with the money logic kept outside the model.
What's next for Covenant
PayPal Multiparty so freelancers are the merchant of record with platform fees; vaulted payment methods for contracts longer than the 29-day authorization window; human mediation for large disputes; and a shareable contract card a freelancer can send instead of an invoice.