Inspiration

Before a mortgage, an underwriter reads your last few months of bank statements line by line. A $6,000 mobile deposit nobody can trace, two overdraft fees, a $40 casino charge, a furniture plan paid in instalments that turns out to be a debt. Any of these can mean a question, a delay or a no, and most applicants only find out after they've applied.

None of this is secret. Fannie Mae publishes when a deposit has to be explained (B3-4.2-02), and lenders publish their ratio limits. What's missing is someone to go through your own statements with those rules early enough to fix things. And since bank statements are about as private as files get, I didn't want that someone to be a server.

The numbers back this up. In 2024 HMDA data, debt-to-income was the main reason given for 36% of denied home purchase loans (NerdWallet). The St. Louis Fed looked at more than 30 million purchase applications and found denial rates sitting around 8–10% anywhere between 20% and 50% DTI, then jumping 15 to 17 points right at 50% (St. Louis Fed, June 2026). That 50% line is the one my US rules use. Lenders keep getting faster tools: since October 2026, Plaid's Home Lending Insights gives them a borrower's income, reserves and possible hidden debts like buy-now-pay-later, in under two seconds according to Plaid (Plaid). Applicants get nothing like that about themselves.

What it does

You open your statements in Chrome and the app does what an underwriter would do, on your own computer.

It takes CSV, OFX and PDF files from several accounts at once and matches the transfers between them. Simple keyword rules sort most lines, and Gemini Nano handles the rest, including PDFs with layouts my parser can't read. When a statement prints a running balance, the code checks that each day adds up, so a missing page or a misread amount shows up.

When a line matters and the model isn't sure, the app simply asks you: "MOBILE CHECK DEPOSIT, $6,000 received: what is it?" Your answer then applies to every line with that name.

You then get the report a lender would build, with a green, amber or red light per check, for your country and loan type (US conventional, FHA, VA, bank statement loans for the self-employed, and France). It covers the debt ratio, overdrafts, large and cash deposits, gambling, short-term credit, hidden debts such as instalment plans, buy-now-pay-later or regular payments to a person, and the money you'll need to close.

From there you can:

  • follow a 90-day plan, week by week, with real figures ("cut $141 a month, or aim for housing at $1,709"), try other housing payments with a slider, and scan again at day 30 and day 60;
  • see the documents to gather for each flag and the questions the underwriter will probably ask, and get an explanation letter built from your own answers;
  • ask questions about your statements ("How much did I spend on groceries each month?"). Nano turns the question into a query and the code does the math.

Who it's for

First-time buyers and renters getting ready to apply, and self-employed people, whose income lenders rebuild from 12 months of deposits. A housing counsellor could also go through it with a client without ever collecting the client's statements.

Why it's different

Budgeting apps put your spending into categories. This one reads the same lines with the lender's published rules (Fannie Mae's large-deposit test, FHA, VA residual income, bank statement loans, France's 35% cap) and tells you what the underwriter will ask, which document answers it and what to change over the next 90 days. Lender tools give that view to the bank, and the consumer apps I found want you to link your bank accounts. Underwriter's Eye works from the statements you already have, and they stay on your computer.

One rule I didn't want to bend: a model's guess can never clear a flagged deposit or a possible debt by itself. Only the built-in rules or your own answer can.

How I used Firebase AI Logic

I split the work by data rather than by model. Anything that comes from a real statement goes to Gemini Nano on the device, and the cloud only ever gets a rounded summary made of whole numbers. All calls go through the firebase/ai Web SDK (13.3.0), in src/ai/models.ts.

Task Model Inference mode Why
Classify the lines the rules miss Gemini Nano ONLY_ON_DEVICE (your files) Labels and amounts must never leave the device, even while Nano is downloading
Read PDF pages with an unusual layout Gemini Nano ONLY_ON_DEVICE A returned line is kept only if its amount and words are really on the page
Turn a question into a query Gemini Nano ONLY_ON_DEVICE JSON constrained by a schema, and the code runs the query
Write your explanation paragraph Gemini Nano ONLY_ON_DEVICE It only sees your answers, never the statement lines, and is rejected if it adds a number you didn't give
The same four tasks on the sample files Gemini Nano, with cloud fallback PREFER_ON_DEVICE Judges without Nano can still see the whole flow, and each fallback is logged
Reword the 90-day plan Gemini 3.5 Flash-Lite ONLY_IN_CLOUD It gets step names only; figures are {{placeholders}} filled in on the device
The underwriter's questions Gemini 3.5 Flash-Lite ONLY_IN_CLOUD It gets the rounded summary
Explanation letter template Gemini 3.5 Flash-Lite ONLY_IN_CLOUD A template with blanks; names and amounts are filled in on the device

The models write words and the code writes numbers. Every answer is checked before it's used: the direction of the money has to fit the category, the plan text can't contain digits, and an explanation can't invent a figure or talk as if it were the bank. If a check fails, the app falls back to its own wording or asks you.

Before any cloud call, assertSafeForCloud() refuses a payload with an unknown key, free text or a statement label. The "What left this device" panel shows each model request that can reach the cloud, what it sent, and the inferenceSource Firebase reported.

I also use App Check with reCAPTCHA Enterprise (limited-use tokens, and the debug token only on my local dev server), Remote Config for the cloud model name, a switch that turns off every cloud feature and the number of clarifying questions, and Firebase Hosting, with offline support after the first visit. The API key is restricted to the app's domains, AI monitoring is on, and a failed Gemini call is retried once.

How I built it

TypeScript and Vite, no framework and no backend. The lender rules are plain code with unit tests, one rule pack per country, and each threshold notes where it comes from and when I checked it. pdf.js reads the PDFs in the browser. I tested on Chrome 157 on Windows with Gemini Nano, and used Playwright and axe-core for the interface (no WCAG 2.2 AA violations found).

To know whether Nano really helps, I built a test page (/eval.html) that runs labelled lines through the rules alone, then through the rules plus Nano, in the same mode as real statements. Nano doesn't answer the same way twice, so I report every run:

Set Rules only Rules + Gemini Nano Bytes sent to the cloud
Main set, 198 lines 64.1% 80.3% to 81.8% (2 runs) 0
Held-out set, 42 lines never used for tuning 47.6% 81.0% to 85.7% (4 runs) 0

Nano also read all 50 lines of a PDF with an unusual layout in 37 seconds, and it writes the explanation paragraph in about 5.

Challenges I ran into

The worst one came early. On real hardware, Nano read Maya's $6,000 mobile deposit as salary and her furniture plan as housing. Both warnings disappeared, and the report looked better than it should have. Since then, a large deposit that a model has labelled stays a deposit to explain, and it becomes the first question for the user.

Nano's context is about 4k tokens, so PDF pages and statement lines go in small batches, and every line it sends back is checked against the page.

My first explanation paragraphs were written from the bank's point of view ("your mother sent you..."). When I gave Nano every flagged line, it also wrote about all of them and made up connections ("this deposit resolved the overdraft"). Now it only rewrites what the applicant answered, and the code rejects any number the user didn't give.

At one point a Vite config pattern copied every VITE_ variable into the bundle, including the App Check debug token. The token now lives on the dev server only, and the build fails if it shows up in the output.

The "Reword the plan" button kept failing with HTTP 500 "high demand" while the other cloud calls were fine. Replaying the exact request showed that Gemini's JSON mode failed on that prompt every time, while plain text worked every time. So the plan now asks for plain text and the code parses and checks the JSON. Cloud calls also retry once, and each error message tells you what still works.

Last one: my first PDF reader kept each line's amount but threw away the running balance printed next to it, so a missing page went unnoticed. That column is read now, each day's balance is checked against the lines, and the review warns you when the statements stop before the latest month.

Accomplishments that I'm proud of

  • Your statements never leave the device, and you can check in the app every request that could reach the cloud.
  • The rules cover four US loan programs and France, bank statement loans for the self-employed included.
  • Nano adds 16 to 18 points of accuracy on the main set and 33 to 38 on wording it had never seen, without sending a byte.
  • It works with a screen reader, on a 320 px screen, and offline.

What I learned

Going hybrid turned out to be about where data is allowed to go more than about which model to pick. Most of the work was deciding what each model may see and checking its answers in code; the prompts mattered less. I also learned to test on the real device: about half of my fixes came from what Nano actually answered, not from what I expected it to say.

What's next for Underwriter's Eye

  • Android, with Gemini Nano through Firebase AI Logic, reusing the same rules and privacy design.
  • More countries. A rule pack is a single file.
  • An opt-in shared dictionary of merchant names, designed so that no single answer says anything about the person who gave it.
  • The paid Gemini tier before any public launch in Europe, as the Gemini API terms require there.

Built during the submission period

Everything was built during the submission period. The first commit is from 12 Nov 2026, the day after the contest opened (11 Nov, 1:30 PM PT), and it isn't based on an existing app.

Open source work I used, under its licenses: the Firebase JS SDK (firebase/ai, App Check, Remote Config); pdf.js to read PDFs and pdf-lib to generate the sample PDFs; the Atkinson Hyperlegible Next and Mono typefaces (SIL Open Font License); Vite, TypeScript, Vitest, Playwright and axe-core.

I wrote the code with Claude, an AI coding assistant. The lender thresholds come from public sources listed in src/core/rules/. Every person, bank, employer and merchant in the sample files is made up.

Built With

  • axe-core
  • chrome-prompt-api
  • firebase-ai-logic
  • firebase-app-check
  • firebase-hosting
  • firebase-remote-config
  • gemini-api
  • gemini-nano
  • pdf-lib
  • pdf.js
  • playwright
  • recaptcha-enterprise
  • typescript
  • vite
  • vitest
Share this project:

Updates

Submission history