-
-
Ask Gemini, keep who you are. Your device seals names, places and numbers; Gemini answers the sealed version.
-
How it works: your device finds what identifies you, only sealed text reaches Gemini, and real names come back on your device.
-
Rules the code can't break: raw text never leaves, no cloud fallback, 359 tests plus a red-team suite. Apache-2.0.
-
Review shows exactly what leaves your phone: Raj becomes "Person 1 · landlord", the address "Place 1". Tap a chip to change it.
-
Every request gets a receipt: the exact sealed text, a SHA-256 hash chained to the last one, and the gate result.
-
Proof checks suspicious messages. Red flags are found on the device; sealed claims go to Gemini only if you say yes.
-
One last check: the egress gate runs seven checks on the final text. If a real name or number is still there, nothing is sent.
-
One privacy engine everywhere: Gemini Nano in Chrome and on Android, Apple Foundation Models on iPhone and Mac.
-
Gemini's real answer, about Person 1 and Place 1. The phone restored "Raj Patel" and "14 Elm St", underlined.
-
Sealing hides who, not what happened. Gemini says what it can still infer: here, "hospital night-shift worker".
Inspiration
A friend's heater broke in the middle of winter and her landlord stopped replying. She pasted the whole text thread into a chatbot and asked what she could do. The advice was good. It also now had her name, her landlord's name, her address, her phone number and the fact that she has asthma.
That's how most people use AI for the hard stuff in their lives: leases, HR emails, medical bills, a strange "bank" text. The help is real, and so is the oversharing. Deleting names by hand is slow and people miss things. Not asking at all means not getting help.
Phones and browsers now ship small language models that run locally. They aren't smart enough to give the best answer, but they're good enough to read a message and spot who and where it's about. So we asked: what if the small model on your device stood guard, and the big model in the cloud only ever saw the problem, not the person?
What it does
You paste a message and pick what you want: help, a reply, a summary, questions to ask.
- Your device reads it first. The on-device model and a set of rules find names, places, phone numbers, emails, account numbers, addresses and codes. Anyone you've saved in your Vault is always caught.
- It seals them. "Raj" becomes [PERSON_1]. The street becomes [[LOC_1]]. A hospital becomes "a large hospital". A second pass on the device then tries to guess who you are from what's left, and rewrites anything that still gives you away.
- You see exactly what will leave, highlighted, before anything is sent. Tap any detail to send it as written, or protect a word Airlock missed.
- Gemini answers the sealed version. It never sees the real names.
- Your device puts the real details back into the answer. Names come back underlined so you know which ones were filled in locally.
- Every request gets a receipt: the exact text that left, hashed into a chain you can verify. Answers that never needed the cloud say "nothing left this device".
There's also Proof for suspicious messages. Your device flags pressure tactics like urgency, secrecy and requests for codes. It pulls out what the message claims, seals those claims, and only after you confirm does it check them against Google Search. Two smaller features: "what could Gemini still guess?" asks the cloud what it can infer from the sealed text it already saw, and "Scrub & copy" lets you use the sealed version with any other AI.
It runs on the web (Chrome), on iPhone and Mac, and on Android.
How we built it
Everything goes through Firebase AI Logic hybrid inference, and each mode is used for a reason:
- On device only for anything that touches your raw words: finding details, rewriting them, the red-team pass, the scam scan, titles. Raw text has no code path to the cloud.
- Cloud only for answers on sealed text and for the Google Search check in Proof.
- On device first for quick tasks like summaries. If the local model can do it, nothing leaves at all.
The on-device model is Chrome's built-in Gemini Nano on the web, Apple's Foundation Models on iPhone and Mac, and Gemini Nano through ML Kit on Android. The cloud model is Gemini.
The privacy engine exists three times, in TypeScript, Swift and Kotlin. All three are held to the same shared test files, so a name is sealed to the same placeholder, byte for byte, on every platform. The last step before anything leaves is a deterministic check we call the gate. It's the only code allowed to produce sendable text, and it blocks if any known name, alias, phone, email, ID or address is still there. Tool results going back to Gemini pass through the same gate.
Around that: App Check (reCAPTCHA Enterprise on web), Remote Config for model names and thresholds, anonymous Auth, an optional Firestore backup that only ever stores the sealed text, and Firebase Hosting for the web app.
Challenges we ran into
Our own red-team found leaks. Halfway through, we wrote an adversarial test suite against our engine and it broke a lot. A surname on its own ("Ms Chen") went through. So did a name in lower case after it had been caught in title case, a card number typed a second time with dots, a UPI ID, a name in a filename. Proof was sending claims to the web with no review step. We pinned every finding as a failing test, fixed them one by one, and kept them as a regression suite that now runs on all three engines.
Hindi names didn't match at all. Our text matcher stripped accents so "José" would match "Jose". In Devanagari, Bengali and Tamil, the vowel signs are the same kind of character, so stripping them made Indian names unmatchable and made "राम" match "रोम". We now strip only true accents.
The gate only knows what was found. A deterministic check can't catch a name that detection never saw. We can't fix that entirely, so we made it visible instead. If the model's answer can't be used, if the model is unavailable, or if a name looks unchecked, Review says so, and in rules-only mode Send stays locked until you confirm you've read it.
Small models are slow and literal. The on-device model sometimes returned a name with a title attached, with different spacing, or without its accents, and we were silently dropping those. Its rewrites sometimes broke the sentence ("at the an organisation"). We added forgiving matching, shape checks on every rewrite, and fixed phrases where the model kept getting it wrong. Speed is still the weak spot: a first seal in the browser can take over a minute on our machine while Chrome's model warms up. So the app highlights what the rules found instantly, and quick tasks skip sealing entirely when nothing needs to leave.
Keeping three engines identical. Swift's regex engine, Java's and JavaScript's all disagree on things like word boundaries and what counts as a digit. We generate shared test files from the reference engine and make the other two match every case.
Accomplishments that we're proud of
- Hybrid inference is the product, not a fallback. Without the on-device model there's nothing to protect you; without the cloud model there's no great answer.
- The same privacy engine, in three languages, passing the same tests.
- A real review screen. You see exactly what leaves, not a promise.
- Receipts you can verify, for every request that left the device.
- We published our own failures in the repo, along with the tests that now hold them shut.
What we learned
- On-device models are good at spotting things and bad at rewriting them. Use them for judgement, and keep a deterministic check as the last step.
- "Remove the names" is not the same as private. Your situation can identify you too, which is why the red-team pass and the "what could Gemini still guess?" card exist.
- Privacy tools fail quietly. You only find the leaks if you go looking for them on purpose.
What's next for Airlock
- Run our benchmark (AirlockBench) with real models and publish the leak rate, names caught and answer quality, misses included. The app has a screen ready for it.
- Faster sealing: show the review as soon as the rules finish and let the model's findings arrive while you read.
- Test with real people: renters, nurses, older users who get scam texts.
- A version for small clinics, HR teams and legal aid groups, with policies set by an admin.
Built With
- apple-foundation-models
- chrome-built-in-ai
- cloud-functions
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-auth
- firebase-hosting
- firebase-remote-config
- firestore
- gemini
- gemini-nano
- google-search-grounding
- jetpack-compose
- kotlin
- ml-kit
- react
- recaptcha-enterprise
- swift
- swiftui
- typescript
- vite