-
-
This image is currently processing. Please be patient...
Inspiration
A supplier payment should be checked against the job before the money moves, not after.
I run a small tour company in Northern Vietnam. Every week we pay guides, drivers and homestays, and the requests arrive as an invoice photo, a job sheet, or a chat message saying "can you pay Phuong today, he needs it for fuel". Someone checks each one against a contract, pays from a PayPal tab, then types it into the books. Amounts drift, job sheets get paid twice, and the person approving has none of the context. A check rail is the short rail laid beside the main track that keeps wheels from leaving it. Checkrail Pay is that rail for supplier payments.
What it does
Checkrail Pay checks every supplier payment before money moves. It checks each request against the job it is for, pays the clean ones over PayPal inside limits you set, and stops the rest with a one-line reason. US bill-pay tools assume a purchase order. Checkrail works from job sheets, bookings and rate cards, and it never holds your money.
A purchase-order tool would pass Phuong's USD 960 invoice, because there is no purchase order to fail against. Checkrail blocks it because the trip sheet says 4 days at USD 200.
Every request travels one line through five stations: read, verified, routed, paid, reconciled.
- AI reads. Claude, on the live product, reads the request and attached documents, resolves the vendor, extracts the amount and reference, and checks PayPal's own transaction and invoice history with three read-only REST calls. It returns a structured reading, a confidence score and concerns.
- PayPal's own records decide. Before every decision that can move money, the app itself (deterministic code, not the model) reads PayPal Transaction Search. When PayPal already paid this job to this payee, the request is blocked with the PayPal transaction id.
- Policy decides. A deterministic policy engine (a pure function, named rules, no model) checks the vendor, the evidence, the amount against the rate card, duplicate jobs, changed payout details and the agent's concerns. Outcome: block, hold, require approval or pay.
- You choose how much the agent does. Review everything, Assist, or Autopilot (clean payments inside your caps are sent after a cancel window). Policy runs again at the moment of release.
- You sign off. The Daily close is one page to read before signing out, with an audited sign-off.
- Reconciled from PayPal. The Books page pulls the statement from Transaction Search and ties a returned payout to its original.
- Agents ask first. Checkrail is an MCP server: before any agent pays a supplier through any tool, it calls check_payment and gets pay, hold or block, the rule that decided, and PayPal's transaction id when PayPal already paid the job. With request_payment the agent hands Checkrail the payment, and Autopilot sends it only inside the owner's caps. The agent transacts; it never holds the keys.
- Your first weeks. Onboarding ends in an AG Studio dashboard that answers one question: is Checkrail ready to do more on its own? It has two custom widgets, a Checkrail theme, no-code layout editing, and an assistant running on Claude that explains the numbers and cannot change a rule or pay anyone.
It never holds funds: money goes from the business's own PayPal, Wise or bank account. The model has no tool that moves money.
How we built it
A fixed pipeline with a pure policy function at its centre, so the model can advise but never decide. TypeScript throughout: Next.js 15 and React 19, server actions for every write, Drizzle ORM on SQLite so it runs from one folder. The agent is Claude (claude-sonnet-5-5) through the Anthropic SDK with a small tool set, and its output is clamped and validated, so its concerns can only tighten a decision. The agent guard is a dependency-free JSON-RPC handler shared by two MCP transports (streamable HTTP and stdio). Autopilot is a timer over policy, not the model deciding to pay.
Money-path safety: an idempotency key on every attempt, compare-and-swap state changes inside one transaction, the payout destination pinned at approval, an ambiguous rail answer treated as unknown and never retried under a new key, and live mode that fails closed instead of falling back to mocks. 1,345 tests in 113 files pass, plus tests on the Soroban spend-policy contract. No human security audit has been done yet.
Challenges we ran into
The hard part was not reading the request, it was deciding which record proves who is owed. The first live Claude run flagged harmless details as concerns, and every concern holds a payment, so nothing auto-paid. We split the agent's output into concerns that hold and notes that never reach policy, and wrote a test that proves notes cannot change a decision. Reviewers found that a single shared word could bind a trip sheet to the wrong payee, so now only the full name binds. The first live PayPal run failed with insufficient funds and showed the demo seed was sending its history through the real sandbox, so history is now always simulated.
Accomplishments that we're proud of
No path exists from the model to a payment, even on Autopilot. A real PayPal sandbox payout settled end to end with Claude reading the request (batch RGS5PUZPH4CNY). The demo catches two real classes of error, an inflated amount and a duplicate job, and handles an unclaimed payout without paying twice.
What we learned
Deterministic policy plus an advisory model is easier to trust, audit and explain than an agent that decides. Asking a person to approve after the AI did all the work gives them no context; a good summary after the fact plus hard limits before it works better.
What's next
Get requests in where suppliers already send them (a Zalo Official Account and a forward-to-email address), run a pilot with a small Vietnamese tour operator in Review mode, add a MISA export next to the Xero file, and run the Stellar rail through an on-chain spend-policy contract so the caps hold even if the server is compromised.
Try it
The hosted demo runs on simulated rails with the rule-based reader and shows Claude's readings recorded from a live run; the video shows a recorded Claude reading and a real PayPal sandbox payout screen (batch RGS5PUZPH4CNY, 12 Oct 2026). Judges can test free until 15 Dec 2026. Each browser gets its own private copy of the demo, so judges do not affect each other. The login is in the testing instructions. The project was started on 3 Oct 2026, after the submission period opened.
Built With
- ag-grid
- ag-studio
- claude
- drizzle
- mcp
- nextjs
- paypal-payouts
- paypal-transaction-search
- pyusd
- react
- render
- sqlite
- stellar
- tailwindcss
- typescript
- vitest
