-
-
ChatLock: real answer, real names back
-
How it's built: trust boundary
-
What left your device: 3 secrets → 3 doubles
-
Extension on ChatGPT: live
-
Not sure → it asks
-
Hidden text: black boxes, white text, hidden columns stay
-
Measured: 81.8%, 94.4%, 52/53, with what each was tested on
-
Extension on Gemini: live, with the list of swaps
-
No internet, still protecting
Inspiration
People paste names, contracts, bank accounts and keys into chatbots every day, and companies answer with a ban. The ban does not stop the pasting. It moves it to phones.
We wanted a third answer between "leak it" and "forbid it". Spaceships already have one: a small room with two doors that are never open together.
What it does
Airlock is a chat (ChatLock) and a security dashboard that sit between you and Gemini.
- Inspect, on the device: rules, labels, tables, six country packs, decoding of disguises, and Gemini Nano for the names no list knows.
- Seal: every private value becomes a realistic twin of the same kind, the same one for the whole conversation.
- Gate: two locks read what is about to leave. If a real value is still there, nothing leaves. A doubt is shown to you.
- Reason: Gemini answers in the cloud, about Nadia, who does not exist.
- Restore, check, receipt, on the device: twins become real again by plain replacement, the answer is checked for changed twins, added links and hidden characters, and a signed receipt says exactly what left.
It reads files the way you do: PDF, Office, OpenDocument, RTF, email, scans and images, in the browser. A name under a black box, white text, a hidden column: if your eye cannot see it, it does not leave. And it works without Gemini Nano, with rules alone.
There are two ways in. ChatLock, our own web chat, is the main one: Gemini answers, through Firebase AI Logic. The second is a Chrome extension, a preview, for people who stay on ChatGPT, Claude or Gemini: you write in Airlock's panel on the site, the site only gets the sealed text, and the answer is restored in the panel. There the cloud AI is the site's own, which is not Firebase; on the device it is the same engine.
How we built it, and how Firebase AI Logic is used
React and TypeScript, no server of ours. Both models are reached through Firebase AI Logic, from one file (src/ai/models.ts), by two doors that never mix:
- Gemini Nano,
InferenceMode.ONLY_ON_DEVICE, reads the raw text. One model per prompt, with a JSON schema (responseConstraint) and an abort signal passed throughonDeviceParams.promptOptions, so a stuck prompt can be stopped. Its own Firebase app without App Check: no network before the first prompt, and it works offline. Images go to Nano too, and only the text it reads is then sealed. - Gemini,
InferenceMode.ONLY_IN_CLOUD, receives sealed text only. App Check with reCAPTCHA Enterprise and one limited-use token per request; a production build without App Check refuses to call the cloud.
We never use the "prefer" modes: they can fall back by themselves, and here a fallback would be the leak.
Nano reads while you type and while a file is attached, one prompt at a time, with messages going before background reading. Everything else (PDF pages drawn and checked for ink, OCR, the vault encrypted with a non-extractable key, signed receipts) runs in the browser.
Hosting is Firebase Hosting with a strict CSP.
Challenges we ran into
- The "on device" mode that calls the cloud. In
@firebase/ai3.1, when the browser has no Prompt API, the SDK builds no on-device adapter and calls the cloud even inONLY_ON_DEVICEmode. We found it by reading the SDK, proved it with a test, and added three locks of our own. (It is also a public issue of the SDK, firebase-js-sdk 10635.) - Stopping Nano. A stuck prompt blocked every later one for minutes. The stop button exists: an abort signal in
promptOptions. - Nano fails quietly. For a while it answered in prose, our parser gave up, and the app fell back to rules without anyone noticing. Now the schema is enforced while it writes, and cut answers keep what was already there.
- A paste that froze the tab for 74 seconds. Every pattern is linear now, and every bomb is a test.
- Protecting too much. Nano once listed the whole question as private, and Gemini received a company name instead of a question.
Accomplishments that we're proud of
- Measured on documents we never tuned on: 81.8 % of private values found by the rules alone on 2,843 held-out documents from five public sets (47.6 % before), and 80.3 % to 94.4 % with Gemini Nano on a held-out sample of 180 documents (one laptop, one Chrome; three runs gave 92.8, 94.4 and 94.9 %).
- 52 of our 53 attacks stopped by the rules alone; the one that passes is shown in the app.
- 30 disguises of the same data: 22 were readable at first, none now.
- 572 tests when the public datasets and real Office files are present, and 33 screen tests that drive the real app in a browser (29 Nov 2026).
- We publish what it misses:
docs/EVAL.md,BENCHMARK.md.
What was built during the submission period, and earlier work
The repository starts on 25 November 2026, inside the submission period CHECK (dates on the official page). The planning document and first screens are from 25 to 27 November; the detection engine, ChatLock, the file readers, the Nano tier, the measures and the tests are from 28 and 29 November. Part of the detection rules was ported from Nassime's own earlier prototype of this same project (github.com/Nassimegha/airlock), written for this hackathon CHECK. Open-source libraries are listed in package.json.
What we learned
A privacy promise cannot rest on somebody else's flag. A graceful fallback can hide a total failure. Realistic twins beat masks, because a model that sees a mask talks about the mask. And the held-out half of a dataset is the only honest mirror.
What's next
The Chrome extension, from preview to a store release; an Android app; a policy console for companies.
For judges without Gemini Nano
Nothing to install. Open ChatLock, send a starter card, click "protected" under your message to see exactly what left. Then attach the three files from the README ("Three files to try"). The rules tier does all of this.
Built With
- firebaseailogic
- firebaseappcheck
- firebasehosting
- gemini
- gemininano
- pdf.js
- playwright
- react
- recaptcha
- tesseract.js
- typescript
- vite
- vitest
- webcrypto