I built price protection that pays out when AI validators agree on a web page A developer built PriceGuard, a price-protection contract on GenLayer that uses LLM-backed validators to read product pages and agree on a purchase's current price to the cent, triggering automatic refunds from a funded pool without any claim filing. The contract runs a leader function that extracts the price and a validator function that independently re-reads the page, comparing a minimal record of status and price in cents with no tolerance band, and fails closed to no payout on UNAVAILABLE, AMBIGUOUS or UNREADABLE results. Deterministic canonicalization code requires the price to appear on the page with its currency symbol or code, so a model-invented number becomes AMBIGUOUS and pays nothing. Credit cards used to give you money back when something you bought got cheaper a few weeks later. Most issuers quietly killed that perk. The reason wasn't fraud, it was cost: every claim needed a human to open a product page, find the right price, and compare it with a receipt. That "look at a web page and decide" step is exactly what normal smart contracts can't do. So I built PriceGuard on GenLayer https://www.genlayer.com , where contracts are written in Python and can read the web and ask an LLM, with a set of validators who have to agree on the answer. This post walks through how it works, the parts that were harder than I expected, and the code that keeps it honest. An issuer a card program, a fintech, a retailer opens a plan and funds a pool. Purchases get registered: buyer, product page, item, variant, currency, price paid, date. During the protection window, anyone can call check on a purchase. Validators each read the product page, agree on today's price to the cent , and plain Python code refunds the drop from the pool. Nobody files a claim. A product page is messy. The Raspberry Pi 4 page I tested on prints the 4 GB price next to the 8 GB price, plus eight add-on prices and a row of "featured products". My demo lamp page has a struck-through "Was $89.00", a member price, an instalment price and a different finish that costs more. An oracle that scrapes "the first dollar amount" gets this wrong constantly. An LLM can tell which number is the current selling price of this exact variant . GenLayer lets me use that judgement inside the contract , and the validators check each other's work. GenLayer's run nondet unsafe takes two functions. The leader does the non-deterministic work. Every validator runs its own copy and decides whether to accept the leader's answer. php def leader fn - dict: rec, det = read price item, variant, cur, url, fence return {"record": rec, "detail": det} def validator fn leader res - bool: if not isinstance leader res, gl.vm.Return : return False d = leader res.calldata if not isinstance d, dict or not record ok d "record" : return False mine, det = read price item, variant, cur, url, fence return mine == d "record" EXACT: status and price in cents res = gl.vm.run nondet unsafe leader fn, validator fn The record they compare is tiny on purpose: {"status": "PRICED | UNAVAILABLE | AMBIGUOUS | UNREADABLE", "price cents": 12000} No tolerance band. If validators don't land on the same status and the same cents, there's no payout. Out of stock, unclear and unreadable all pay nothing . It fails closed. The model is good at picking the right price, but I don't let its answer through raw. Every validator reduces it with deterministic code against its own copy of the page: php def canonicalize reply: dict, currency: str, text: str - dict: st = reply.get "status" if st == "UNREADABLE": return {"status": "UNREADABLE", "price cents": 0} if st == "UNAVAILABLE": return {"status": "UNAVAILABLE", "price cents": 0} if st = "PRICED": return {"status": "AMBIGUOUS", "price cents": 0} cur = str reply.get "currency", "" .strip .upper cents = price to cents reply.get "price" if cur = currency or cents is None or cents <= 0: return {"status": "AMBIGUOUS", "price cents": 0} if not price on page cents, currency, text : return {"status": "AMBIGUOUS", "price cents": 0} return {"status": "PRICED", "price cents": cents} price on page requires the price to be printed on the page with the currency sign or code right next to it. So $1120.00 can never certify 120.00 , and a bare 120.00 points doesn't count. If the model invents a number, it becomes AMBIGUOUS and pays nothing. A few more cheap guards before the model is even asked: UNREADABLE . Consensus decides one fact : today's price. Everything else is boring code: python def refund cents paid, lowest, coverage bp, min drop, cap : drop = paid - lowest if drop <= 0 or drop < min drop: return 0 return min drop coverage bp // 10 000, cap The contract tracks the lowest price ever seen, so a deeper drop later pays only the extra difference, the same drop never pays twice, and a price that goes back up never claws anything back. My first version tracked refunds in cents. A reviewer-style test exposed a bug: if the pool ran low and paid only part of a refund, a later top-up could pay out more than the purchase was entitled to. The fix was to do the accounting in wei actually paid : entitled wei = cents to wei due, int p.wei per usd owed wei = entitled wei - int c.credited wei if owed wei 0: got = min owed wei, int p.balance ... pay got , add it to c.credited wei There's a regression test for it TestPartialPoolRefill : a 2-cent drop is worth 20 wei; the pool pays 5, gets refilled, and the total stays at 20. If you build anything with partial payouts, test this case. On GenLayer's studionet, against the real Adafruit Raspberry Pi 4 page and a clearly labelled demo store: | Purchase | Validators read | Refund | |---|---|---| | Pi 4, 4 GB, paid $135 | PRICED $120.00 | $15.00 | | Pi 4, 8 GB same page , paid $199 | PRICED $190.00, not the 4 GB price | $9.00 | | Pi 4, 4 GB, paid $120 | PRICED $120.00 | $0, no drop | | Demo lamp, paid $89 | PRICED $69.00, ignoring the "was", member and instalment prices | $20.00 | | Demo headphones, paid $149 | UNAVAILABLE sold out | $0 | Every round reached consensus. The transaction hashes are in the repo's docs/LIVE EVIDENCE.md . You can run the whole flow in your browser in about a minute: open the live app https://yoyoblair333-wq.github.io/priceguard/ , click Create / load test key free faucet , register the demo lamp, click Check price , and withdraw your $20 test refund. If this pattern clicks for you, the fastest way to start is GenLayer Studio zero setup, runs in the browser . GenLayer also runs a builder program on its portal that tracks contributions such as deployed contracts, projects and tutorials. If you want to join, you can sign up through my link: https://portal.genlayer.foundation/?ref=JTR01FHP https://portal.genlayer.foundation/?ref=JTR01FHP . Full disclosure: it's a referral link, so I get credit if you join and ship something. It costs you nothing, and I'm happy to answer questions in the comments. What would you hand to a validator jury next?