Inspiration

In 2016, a Georgia woman paid her solar installer $10,000 up front and never got any panels (Fox 5 Atlanta). FTC solar-panel complaints rose from 630 in 2018 to 5,331 from Jan 1 to Sep 19, 2023 (TIME, Aug 2024). Buyers pay on an installer's word. We wanted them to pay on evidence.

What it does

  • PayPal authorizes a $100 hold, split into milestones of $40 and $60. Nothing is captured up front.
  • Each milestone unlocks only when the roof's production data passes a fixed check: a 7-day average of at least 70% of the inverter's usual share of the other inverters, with no day under 30%.
  • Even then, a person taps Release, and only then does PayPal capture.
  • The demo uses a real outage from 2020 at a commercial roof in Maui (NREL PVDAQ). A rule that pays after one good day would have paid on Oct 23. The inverter was back at zero three days later, for 16 of the next 18 days. Our check held until Nov 19. Press Play and both rules run on the same $40.
  • A second contract on the same roof bills a neighbour weekly for measured power: $22.47, $8.61, $0.00 for the outage week, then $9.74. The unused $79.18 is voided.
  • An AG Grid ledger puts both rules side by side for every recorded day, with CSV export.

What the AI does, and why it can't touch money

Claude Sonnet 4.6 on AWS Bedrock does three jobs:

  1. It explains a hold in plain words and drafts a question for the installer.
  2. It splits an installer's excuse ("it was cloudy") into claims. Fixed rules then check those claims against the data. "Ignore your rules" changes nothing.
  3. An agent with four read-only tools reads the verdict, up to 45 days of readings and PayPal's record of the hold, then drafts a message to the installer. It ends by proposing a next step: wait, ask the installer, or release.

The server checks every answer. The agent must read the verdict first. Every number and date it writes must have come back from its tools in that run. It can propose Release only when the verdict is ready and PayPal's record agrees. If an answer fails, the page shows a plain, labelled fallback instead.

The AI modules can't import payment or server code, and a test enforces that. Release is a one-time token issued only while the server's own verdict is ready, and a person still taps it. In six real Bedrock runs, the agent's first draft to the installer was too long four times. The check refused it each time, and the agent rewrote it.

How we built it

  • Node 24 with TypeScript, a vanilla JS front end, and a strict CSP.
  • PayPal Orders and Payments APIs for authorize, partial capture and void. Webhooks with signature verification.
  • The PayPal Agent Toolkit, limited to the read-only get_order tool, reads PayPal's own record back onto the page.
  • Claude Sonnet 4.6 on AWS Bedrock.
  • AG Grid for the ledger.
  • Hosting: AWS App Runner for the live sandbox, and Render for a no-login sample mode.
  • 283 tests, plus a browser check of 128 steps at phone and desktop widths.

Challenges we ran into

  • Keeping the AI useful while making sure it can never move money.
  • Catching model answers that sound right but are wrong: invented numbers, blamed causes, or "pay once they reply".

What we learned

Fixed rules and a human tap carry the trust. The AI's job is to explain and draft, under checks.

What's next

  • Home installs: the check needs 30+ days of history and comparable inverters, so it doesn't work on a brand-new install yet.
  • Amounts set from the installer's contract.
  • Meters for real neighbour billing.

Limits

  • The data comes from a 110 kW commercial roof, not a home.
  • There's no fault log for this site, so these figures aren't accuracy, and the thresholds were chosen after looking at this outage.
  • Amounts are fixed for the demo: $100 a hold, in milestones of $40 and $60.

Data: NREL PVDAQ system 2105, Deline et al. (2021), doi:10.25984/1846021, CC BY 4.0.

Built With

  • ag-grid
  • aws-app-runner
  • aws-bedrock
  • claude
  • node.js
  • paypal-agent-toolkit
  • paypal-orders-api
  • paypal-payments-api
  • paypal-webhooks
  • render
  • typescript
Share this project:

Updates

Submission history