Inspiration
Picture Emeka, 68, applying for a visa to see his grandson. (Illustrative persona, the same one as in our demo video.) The form says "Means of subsistence available for the stay", "Current occupational status", "Have you ever been refused…?". He writes his pension in the salary box. He swaps two dates. He leaves the refusal details empty. A third-party site has pre-ticked a USD 149 "priority handling" add-on.
None of these are lies. All of them can delay or sink an application. In 2025, Schengen consulates received about 11.9 million short-stay visa applications, and the refusal rate was 14.8%, about one in seven (European Commission, May 2026). In the US alone, more than 25 million people have limited English proficiency (Migration Policy Institute), and the forms that decide their visas, benefits, taxes and medical care are written in legal English.
The people who most need help with these forms are also the people who should be most careful about pasting a passport number into a chatbot. That tension is the whole project: help that never needs your personal data to work.
What it does
Three ideas, one engine, four surfaces.
Understand
- Plain words. One switch rewrites every question on the form, in place: the printed question gets an ink line through it and a plain sentence is written underneath, in the user's language. Each line carries a mark showing where it was written (● on this device, ☁ cloud with masked text, ◆ built-in guide).
- Explain any question: what it means, why it matters, the common mistake, what document to check. Read aloud. Ask follow-up questions by text or voice.
- Explain my declaration: what you are promising when you tick the box, in plain words.
Protect
- Deterministic PII firewall. Code, not a model, decides what is sensitive: passport and ID numbers, card numbers (Luhn), IBANs (mod-97), SSNs, emails, phones, dates, plus every field whose label is sensitive. The model only sees the one question it is helping with, with the answer reduced to its shape ("date", "number") or
[PROTECTED]. A final gate compares every outbound prompt against the raw answers on the page and blocks the request if anything matches. - "What left this device" log. Every AI request shows the mode we asked Firebase AI Logic for, the source that actually answered, and the exact text that was sent.
- Strict privacy switch: cloud refused entirely; on-device model or rules only.
- Personal facts vault: answers you confirm are saved AES-GCM-encrypted with a non-extractable key on this device; matching them to new forms is on-device only.
Verify
- Contradiction radar: departure before arrival, passport expiring under 6 months after arrival, "Yes" to a refusal with no details, "retired" with a salary, a tourist visa with a business host, funds too low for the trip.
- Submission check before Submit: required answers, consistency, fees against the official schedule (the USD 149 add-on is flagged), the site against the official host list (a look-alike domain is blocked), privacy totals. Downloadable masked report.
- Family review: share a masked copy with someone you trust (Google sign-in, one verified reviewer email); they comment on questions; protected fields are hidden from them.
Surfaces
- Web app + demo portal (fictional Republic of Examplia eVisa, with sample answers that contain the mistakes above).
- Chrome extension (MV3 side panel) that works on any page with a form.
- iPhone and Mac app (SwiftUI): photograph or scan a paper form, Apple Vision reads it on the device, then the same Plain words, explanations, checks and privacy log.
How we built it: Firebase AI Logic hybrid inference
Web and extension (Gemini Nano in Chrome): src/engine/ai.js calls getGenerativeModel(ai, { mode, inCloudParams, onDeviceParams }) and reads response.inferenceSource back into the privacy log. Routing policy:
| Situation | Mode we request | Why |
|---|---|---|
| English, Spanish, French, German, Japanese | PREFER_ON_DEVICE |
Nano handles these languages |
| Arabic, Hindi, Chinese, Vietnamese… | ONLY_IN_CLOUD (masked prompt) |
not supported on-device yet; user sees the reason |
| Vault matching (private task) | ONLY_ON_DEVICE |
never cloud; no model → rules |
| Strict privacy switch | ONLY_ON_DEVICE |
user refused cloud |
On-device we pass a JSON responseConstraint so Nano returns structured output; in the cloud, responseMimeType: application/json.
iOS and macOS (Apple Foundation Models): apple/Fieldguide/AIRouter.swift builds a GenerativeModelSession with .hybridModel(primary: FirebaseAI.SystemLanguageModel.default, secondary: ai.geminiModel(name: "gemini-3.5-flash-lite")), checks SystemLanguageModel.default.availability, and reads response.rawResponse.modelVersion to log whether Apple's model or Gemini answered. In testing, Apple's on-device safety filter occasionally declined a prompt and Firebase AI Logic fell back to Gemini automatically, which the log shows.
One engine everywhere. The firewall (pii.js), the rules (checks.js) and the prompt builders (explain.js) are plain JavaScript. The web app and the extension import them; the Apple app runs the same file inside JavaScriptCore (apple/Fieldguide/Resources/engine.js). Privacy and checks cannot drift between platforms, and all four send byte-identical prompts.
Other Firebase products
- App Check: reCAPTCHA Enterprise on the web, debug provider for the extension and Apple debug builds, App Attest for Apple release builds.
- Remote Config: per-portal guides (official fees, official hosts, validity rules, field notes). A fee change needs no release.
- Firestore: masked family-review snapshots and comments, with rules that allow only the owner and one verified reviewer email.
- Authentication: anonymous for the applicant, Google sign-in for the reviewer.
Design. Paper and ink: a warm paper palette, serif headings, ink strike-throughs and stamps. The landing page uses motion built from my own library of rebuilt site effects (paper flutter, sticker notes, ink-dissolve reveal, keyhole transition). The same palette and type carry into the extension panel and the SwiftUI app so it reads as one product.
Proof, not claims
npm run evalbuilds every prompt Fieldguide would send for 500 synthetic applicants: 4,500 prompts, 0 raw answers leaked, 100% of identifiers typed into questions removed (docs/EVAL.md).npm test: unit tests for the detectors and every contradiction rule.- The privacy log shows the exact payload of every cloud call. On a Mac with Apple Intelligence, a full Plain-words pass over the sample form ran 18 of 18 requests on the device, 0 personal answers sent.
Challenges
- Small models need small prompts. Gemini Nano and Apple's model work best on short context, so Fieldguide sends one masked question at a time. That turned out to be the privacy design too.
- Language support differs by device. We made the route a visible, explained choice instead of a silent fallback.
- One engine on three runtimes (browser, extension service context, JavaScriptCore) without Node or DOM assumptions in the core.
- App Check everywhere: reCAPTCHA Enterprise on the web, debug providers for the extension and Simulator.
What we learned
Hybrid inference is not just "cheaper when local". For sensitive tasks it changes what you are allowed to build: when the default is on-device, and the cloud only ever sees masked text, you can help people with the documents they would never paste into a chatbot.
What's next
- More deep verticals through Remote Config guides: US benefits, tax forms, insurance claims, medical intake.
- Android app with Gemini Nano.
- Multi-page paper forms and handwriting on iOS.
- Partner with legal-aid clinics and libraries that already help people fill forms.
Built during the hackathon
Everything in the repository was built during the submission period: engine, web app, demo portal, Chrome extension, Apple app, evaluation harness and landing page.
Fieldguide explains a form's own text. It is not legal, tax or immigration advice. The Republic of Examplia is fictional.
Built With
- apple-foundation-models
- chrome
- chrome-built-in-ai
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-remote-config
- firestore
- gemini
- gemini-nano
- javascript
- swift
- swiftui
- vite