Inspiration

Freelancers and small agencies sign contracts full of payment terms: milestones, net-30 deadlines, late fees, revenue shares with subcontractors. Then almost none of it gets enforced. Invoices go out late, late fees are never charged, and subcontractors wait. At the same time, everyone wants AI agents that can actually move money, but nobody wants to hand an agent an open checkbook.

We realised the answer to both problems was already sitting in the PDF. The contract itself can be the policy that governs what an agent is allowed to pay or charge.

What it does

Clause-to-Cash turns a signed contract into enforced PayPal money movement:

  1. Upload a contract. An extraction agent pulls out parties, milestones, amounts, payment terms, late-fee and revenue-share clauses, and cites the exact page and quote for every field.
  2. Verify. A separate checker agent sees only one field and its cited page, and flags anything unsupported. You review the flags and approve. The approved terms become a Mandate.
  3. Deliver and get paid. When a milestone is delivered, an acceptance agent checks the evidence against the contract's acceptance criteria. A PayPal invoice is then created for exactly the contracted amount, with the clause cited in the invoice notes.
  4. Split automatically. When the client pays (PayPal webhook), subcontractors receive their contracted share via PayPal Payouts.
  5. Collect. Overdue invoices get reminders, then a late-fee invoice computed exactly as the contract specifies.
  6. Defend. If the client opens a dispute, the dispute agent builds an evidence pack from the contract clauses, acceptance records and payment timeline.
  7. Guard. Every money action passes through a deterministic Guard (10 rules). If you tell the copilot "invoice them an extra $5,000", the Guard blocks it and shows which rules it violated.

The LLM proposes. The Guard disposes. No amount, payee or date that moves money ever comes straight from model output.

How we built it

  • Backend: Python, FastAPI, PostgreSQL, SQLAlchemy and Alembic, with APScheduler for overdue scans.
  • AI: Claude for extraction, checking, acceptance review, collections messages, dispute evidence and the copilot. All outputs are structured through tool use with pydantic schemas.
  • PayPal (sandbox): Invoicing v2 (create, send, remind), Payouts v1 (revenue-share batches), Webhooks (signature verification and idempotent processing of invoice-paid, payout and dispute events) and the Disputes API (evidence submission).
  • Guard: pure, typed Python rules, plus deterministic money math using Decimal. Every decision is logged with rule IDs.
  • Frontend: React, TypeScript and Vite. AG Grid for the payment ledger and guard log, and a Bryntum Gantt for the milestone timeline.
  • Hosting: Render (web service, static site and Postgres).
  • Quality: an evaluation set of [8] contracts with hand-labelled gold answers. Extraction field accuracy: [X]%.

Challenges we ran into

  • [Example: getting LLM citations to match the PDF text verbatim, solved with fuzzy quote verification against the cited page]
  • [Example: idempotent webhook handling when sandbox events arrived late or twice]
  • [Example: triggering disputes in the sandbox]

Accomplishments that we're proud of

  • An agent that can move real (sandbox) money but provably cannot step outside the contract
  • Every extracted number is traceable to a clause and page
  • [Extraction accuracy / end-to-end flow in under N minutes]

What we learned

[2–3 honest lines, e.g. designing guardrails as deterministic code rather than prompts; PayPal Invoicing and Payouts lifecycles; context-starved checker agents catch more errors than self-review]

What's next

  • Multiparty onboarding so platforms can run this for many freelancers
  • Contract templates in more currencies and languages
  • Live GitHub and Jira delivery signals for automatic milestone acceptance
  • Publishing the guarded tools as an MCP server, so any agent gets contract-bounded PayPal access

Built With

Share this project:

Updates

Submission history