This is a submission for the Sanity Challenge, Path One: Ship an Agent That Queries Real Content
What I Built
Gate Check answers a question people get wrong at the gate every day: can this power bank come with me, and what am I allowed to do with it on board?
The rules changed fast. On 27 March 2026 ICAO limited power banks to two per passenger and banned recharging them on board. Hong Kong applied that the next day, Korea from 20 April, Japan from 24 April. Emirates already allowed only one power bank and banned using it. Lufthansa Group, EVA Air, Singapore Airlines and Qantas each picked their own dates and wording. IATA's 2026 guidance lists power banks of 100–160 Wh as forbidden, while ICAO's addendum still allows them with the airline's approval. And the copies go stale: a 2025 Korean government page still says you may bring five, and Incheon Airport's 2025 press release converts 100 Wh to 20,000 mAh at 5 V, while the ministry and the airlines use 3.7 V (about 27,000 mAh).
So "can I bring my 27,000 mAh power bank?" is not a search problem. You have to:
- convert mAh to watt-hours,
- find every rule that applies to this trip: each airline, each departure country, and the worldwide baseline,
- place the battery in each rule's watt-hour bands and count limits, and
- let the strictest rule decide, while keeping track of which page says what.
Gate Check does steps 1 to 4 in code over structured content in Sanity, and an agent uses a Sanity Knowledge Base to explain the result and the disagreements behind it.
- Two 27,000 mAh power banks, Korean Air then Emirates, leaving Korea: not allowed. Emirates allows one, and Gate Check quotes both Emirates pages that say so.
- One 30,000 mAh power bank (111 Wh) on Asiana from Seoul: needs airline approval, because it is over 100 Wh and up to 160 Wh.
- Two 20,000 mAh power banks on Korean Air from Seoul, asked in plain English: you can carry them, but not use them. The agent explains that Korean Air and Korea's transport ministry ban using power banks in flight, while ICAO only says they "should not" be used.
Demo
Live: https://gate-check.mikey9220.workers.dev (no login)
- Quick check runs the rule engine alone, with no AI: capacity, count, airlines and departure countries in; one card per rule out, strictest first, with the exact wording behind each finding and a link to the page it came from.
- Ask the agent takes a question in plain language. Under the answer it lists every page the answer rests on, and "What the agent did" lists every tool call.
Code
mikey92
/
gate-check
Can this power bank fly? Airline and regulator power bank rules as structured content in Sanity, evaluated in code, served through Sanity Context MCP.
Gate Check
Can this power bank fly? An agent that answers from airline, regulator and IATA rules kept as structured content in Sanity, evaluates them in code, and shows the exact wording behind every verdict, including where the sources disagree.
Try it: https://gate-check.mikey9220.workers.dev
Power bank rules changed fast in 2025 and 2026. ICAO limited power banks to two per passenger and banned recharging them on board from 27 March 2026; Korea, Japan and Hong Kong followed with their own dates; Emirates allows one and bans using it; IATA's 2026 guidance lists 100–160 Wh power banks as forbidden while ICAO still allows them with the airline's approval. News articles, airport pages and travel blogs restate all of this and go out of date. A traveller holding a "27,000 mAh" battery has to convert it to watt-hours, find every rule that applies to every leg, and pick the strictest.
Gate Check does…
How I Used Sanity
The content model
Three document types:
-
authority: an airline, regulator, airport operator or industry body, with its country and codes (Asiana isOZ,Asianaand아시아나). There are 32. -
source: a captured copy of one page: URL, kind (official, news or third-party copy), language, capture time, an excerpt, and the statements quoted from it. There are 60, in English, Korean, Japanese and Chinese. -
batteryRule: what one authority says, in fields code can evaluate. There are 30.-
scope: an airline's own rule, a departure country's rule, domestic flights, the worldwide baseline, or advisory guidance -
limits:freeMaxWh,approvalMaxWh,maxWh,freeMaxCount,approvalMaxCount,totalMaxCount -
onboard: checked baggage, using it in flight, recharging it, the overhead bin, keeping it visible, terminal protection, a readable label, a certification mark, each with a value such asforbidden,discouragedorrequired -
status(confirmed, disputed or unverified) and anotethat explains a disagreement -
quotes[]: for each field, the exact wording and a reference to the source it came from (211 in all)
-
A rule may only state what a source says. The build script copies every quote's text from the captured page, so it is never typed twice, checks every reference, and fails if a rule sets a limit or an on-board condition without a quote. That check found 28 gaps in my own data. It also fails if two documents share a title, because the Knowledge Base cites documents by title.
Two Context MCP endpoints
-
gate-check-data, GROQ mode, over the whole dataset. The rule engine fetches every rule that applies to a trip in one GROQ query (airline rules matched by name or code, departure-country rules by country, worldwide rules always), with each rule's quotes and their sources. User input only reaches GROQ as JSON-escaped string literals. -
gate-check-rules, Knowledge Base mode. The Knowledge Base reads the same dataset through a custom GROQ projection: 30 rules and 60 pages, 90 documents within the 150 budget. The projection flattens Portable Text withpt::text(body)and keeps provenance (kind, language, capture date, authority) next to the text, so entries can tell an official page from a news report or a copy.
The Knowledge Base
Sanity Context organised the 90 documents into 20 entries: airlines by region, each regulator, the ICAO baseline, IATA's guidance, airport screening, terminal protection and certification marks, and an entry for conflicting and superseded rules.
Each build files the conflicts it finds as issues, with both claims and their sources side by side. Working through them was the most useful part of the project:
- Real errors became standing instructions. An entry spelled Air Canada's banned Anker model A1682; the page says A1681. Another said ICAO bans power banks from overhead bins; the addendum says nothing about overhead bins, and the claim had come from a travel blog. Korea's 2025 limit of five power banks lost to the 2026 limit of two.
- Differences between authorities were dismissed. ICAO's "should not use" and an airline's ban are both right, each for its own flights. The FAA's "no quantity limit" and an airline's cap of two are both right too.
- Facts the entries kept getting wrong became manual instructions. EASA has not banned using power banks: its bulletin is information only, and its press release says "not forbidden but strongly discouraged". In Japan, five of the seven rules in the ministry's leaflet carry penalties, and "don't use it to charge devices" is not one of them.
- The purpose carries the policy for everything else. Rules are never merged; every limit is attributed to its authority and dated; superseded rules are labelled as previous rules; and for 100–160 Wh power banks, both ICAO's and IATA's positions are reported.
No issue is left pending: each one was resolved or dismissed, and every future build keeps those decisions.
The agent
A Cloudflare Worker runs a tool-calling loop on Workers AI (Gemma 4 26B). Its tools:
-
check_power_bank: the rule engine. It converts mAh to Wh, evaluates every applicable rule and returns the verdicts. The model is told never to convert units or compare limits itself. -
find_rules: one authority's rules with every quote, from the GROQ endpoint. -
search_entriesandread_entries: the Knowledge Base, throughknowledge_base_searchandknowledge_base_read, with the outline frominitial_contextin the system prompt. -
run_groq: read-only GROQ, as a last resort.
The model never writes a URL. Knowledge Base entries cite the documents they were written from by title, so the Worker maps those titles, and the sources of every rule it evaluated, to their pages and returns them with the answer. The quick check calls the same check_power_bank function with no model at all, so a verdict never depends on the model.
Sanity Project Details
- Project ID:
nkpgzr3t - Dataset:
production(public) - Every rule with its quotes, as a public GROQ query
- Context MCP endpoints:
gate-check-rules(Knowledge Base mode) andgate-check-data(GROQ mode)
Rules are a snapshot from 2 October 2026. Always check with your airline before you fly.



Top comments (0)