Inspiration
People paste real things into AI assistants. An email with a customer's name and phone number. A config file with a password in it. A note about someone's health. All of it goes to a server.
The usual answers are "do not paste that" or "trust us". I wanted a third one: let the laptop read the message first, hide what is private, and show me the proof of what was sent.
What it does
You paste a prompt. AegisHybrid works in four steps.
- Rules on your laptop catch things with a fixed shape: API keys, tokens, passwords inside URLs, emails, phone numbers, IBANs, card numbers, CNICs and common health terms.
- Gemini Nano, running inside Chrome, reads the message for what rules cannot see: names, addresses, employers and health details.
- Each private value is swapped for a placeholder like
[PERSON_1]. You see this "wire copy" before anything is sent. You can untick a value or mask more text by hand. - Only the wire copy goes to the cloud model. When the answer comes back, the real values are put back on your laptop.
If you are offline, Gemini Nano writes the answer on the laptop and nothing is sent.
The Inspector lists every request the page makes, with the raw body. After each send it searches that body for the values it masked and shows the count.
How I built it
Every model call goes through the Firebase AI Logic web SDK. I set up three models, each with one job.
- The finder uses
ONLY_ON_DEVICEwith a JSON schema, so Gemini Nano returns a list of private values. I choseONLY_ON_DEVICEon purpose. If Gemini Nano is missing the call fails. It can never fall back to the cloud with the unmasked text. - The reasoner uses
ONLY_IN_CLOUDwith gemini-3.5-flash-lite. It only ever gets the masked copy. - The offline writer uses
ONLY_ON_DEVICEand answers when there is no connection or the cloud call fails.
The page reads response.inferenceSource and shows where each answer was written.
App Check protects the cloud model with reCAPTCHA Enterprise. The site is on Firebase Hosting. There is no server of my own and no build step. The Inspector is a small wrapper around the page's own fetch.
I built it with help from Claude Code, and the repository shows that in the commit.
What I built during the submission period
Everything. The repository was created on 15 Nov 2026 and has no code from before the hackathon. In two days I built the rules, the three Firebase AI Logic models, the page, the Inspector, the test pages and both test sets, and deployed it to Firebase Hosting. I used Claude Code as an AI coding assistant. The fonts are open source (SIL Open Font License). There is no other pre-existing code.
Challenges
- Gemini Nano is slow to start. The first call took over 20 seconds. I moved that cost to page load with one small warm-up call. After that a check takes about 3 to 6 seconds.
- Gemini Nano flags ordinary words. In my first test it masked "Thursday", "Python" and "12 percent". I added a small filter that drops words like these, and tick boxes so you can unmask a value.
- It also misses things, and not the same things each time. My first version let "type 2 diabetes" go to the cloud. So I stopped trusting the model alone for health details and added plain rules for them.
- Testing on the same messages I tuned on would have fooled me. I wrote 18 new messages and committed them before changing anything. The second version still missed one secret there, which showed me a gap in a rule.
- GitHub refused my first push because a made-up test key looked like a real Stripe key. I renamed the fake value.
What I measured
All test messages are made up. Each line is one run on the live site on 16 Nov 2026, with nobody reviewing the masked copy before sending.
- First version, 12 messages: 20 of 21 private details found, 1 reached the cloud, 8 false alarms.
- Second version, 18 new messages it had never seen: 27 of 28 found, 1 reached the cloud, 6 false alarms.
- Current version, the same 18 messages: 28 of 28 found, 0 reached the cloud, 5 false alarms. I fixed one rule after seeing the miss above, so this is not a blind test.
- Current version, the first 12 messages: 21 of 21 found, 0 reached the cloud, 0 false alarms. It was tuned on these, so this number flatters it.
- Median Gemini Nano check 3.7 s, median cloud answer 1.9 s.
Thirty messages is a small test and I wrote both the messages and the rules. The files are in eval/runs/. Anyone can repeat the runs at /eval/live.html and /eval/live.html?set=holdout on the site.
What I learned
A small model on the device is good enough to be a first reader, but not good enough to be trusted alone. The useful design is rules for what has a fixed shape, the model for what needs meaning, and a person looking at the result before it leaves.
I also learned that "private" claims are easy to make and hard to show. Logging the page's own requests made the claim checkable.
What's next
- A larger test set with more kinds of text, and more than one run.
- A faster check by keeping one Gemini Nano session open.
- A Chrome extension so it works inside the chat sites people already use.
- Languages other than English.
How to test it
- Open https://aegishybrid-c24d8.web.app in Chrome on a desktop or laptop. No login is needed.
- Wait until the top bar says "Gemini Nano: ready on this laptop". The first load takes about 20 seconds. If Chrome has not downloaded Gemini Nano yet, press "Download model". If the machine cannot run Gemini Nano, the rules still work and the button reads "Check with rules only".
- Pick a message from "Synthetic samples", or type your own.
- Press "Check on this laptop". The wire copy on the right shows what would be sent.
- Press "Send wire copy". Read the stamp, the answer, and the "Wire log" tab with the raw request body.
- Tick "Work offline" and send again. Gemini Nano answers and nothing appears in the wire log. All sample data is made up. The repository holds no secrets: the Firebase web config and reCAPTCHA site key are public identifiers, and App Check protects the cloud model.