Inspiration
Every day, millions of people paste sensitive medical lab panels, confidential NDA agreements, and private financial statements into cloud AI because they need high-order reasoning. But HIPAA forbids it, enterprise security policies ban it, and privacy-conscious users are left behind.
Traditional AI forces a false dilemma: either trust the cloud with your most intimate secrets, or settle for small on-device models that lack complex multi-step reasoning.
I built Veil to shatter this compromise. My core insight is that hybrid inference is not merely plumbing to offload compute—hybrid inference IS the privacy architecture. By decoupling sensitive entity possession from semantic reasoning, Veil delivers state-of-the-art cloud intelligence with zero-trust local privacy.
What it does
Veil is a client-side zero-trust privacy engine and border authority for hybrid AI. It allows users to run deep cloud reasoning over confidential records without direct personal identifiers (PII) ever crossing the device boundary.
The 5-Stage Privacy Pipeline:
- The Vault (100% On-Device): Chrome built-in Gemini Nano (
window.ai) and deterministic rules scan intake documents in under 1ms, swapping sensitive entities (patient names, MRNs, dates, accounts, physicians) with typed codenames (PERSON_A,DATE_1,ORG_B). The secret dictionary is quarantined exclusively in client volatile memory. - The Customs Gate (Independent Egress Auditor): An independent leak auditor inspects all outbound bytes before network dispatch. If an obscure or unshielded entity is detected, the Gate locks the release mechanism (
LOCKED REVIEW), alerts the user, and forces human-in-the-loop review. One click on🛡️ Shieldvaults the leak. - The Golden Wax Stamp (Hold-to-Release): Nothing ever leaves the device automatically. The user physically holds the circular golden wax stamp (or double-clicks) to cryptographically authorize egress.
- The Oracle (Cloud Gemini 2.5 Flash): Cloud Gemini receives only the anonymized structural graph via Firebase AI Logic. It performs high-order medical interpretation, legal risk analysis, or executive memo synthesis over the codenames without ever knowing who the patient or company is.
- Local Unsealing & Border Receipt: When the cloud response lands back on the user's laptop, the local engine unseals the codenames back into real names in client memory. Veil generates an immutable Border Receipt proving the exact compute split (On-Device Nano vs Rules vs Cloud).
How I built it
- On-Device Engine: Chrome Built-in AI (
window.ai/ Gemini Nano) and deterministic regex/dictionary scanners for sub-millisecond local entity masking and client-side unsealing. - Cloud Oracle: Cloud Gemini 2.5 Flash orchestrated through Firebase AI Logic for deep analytical reasoning.
- Security & Attestation:
- Firebase App Check (with reCAPTCHA Enterprise & custom debug tokens) guaranteeing only legitimate, untampered client instances can invoke backend services.
- Firebase Remote Config providing dynamic policy thresholds (Strict / Balanced / Open) and an instant cloud kill-switch.
- Cloud Firestore for zero-PII audit logging (persisting only timestamps, cryptographic receipt hashes, and compute ratios—strictly zero raw text).
- Frontend & UX: Built with TypeScript, Vite, and Tailwind CSS in a responsive Cyber-Slate/Noir theme featuring real-time Brain Split telemetry meters and tactile authorization controls.
Challenges I ran into
- Preserving Graph Topology: Cloud models still need to understand relationships between entities (e.g. knowing that
PERSON_AvisitedORG_Band is treated byPERSON_C). If codenames are inconsistent, the cloud LLM hallucinates. I engineered a deterministic typed-graph codename generator that maintains strict referential integrity across the entire document. - Sub-Millisecond Border Interception: Designing the Customs Gate auditor to inspect every outbound character against the vault without perceptible UI latency.
- Airtight Client-Side Isolation: Ensuring that unsealing happens strictly in client memory after the cloud transmission completes, backed by 27 automated property and boundary tests in GitHub Actions CI.
Accomplishments that I'm proud of
- Zero PII Egress Verified: In all test scenarios (medical lab panels, NDA agreements, financial memos), zero direct identifiers ever reach the network, as verified by network traces and immutable Border Receipts.
- Interactive Leak Interception: The Customs Gate successfully catches deliberate edge-case leaks and prevents outbound dispatch until human approval is granted.
- Judge Diagnostics Suite: An interactive in-app diagnostics modal allowing hackathon judges to test App Check tokens, simulate offline modes, toggle Remote Config kill switches, and inspect the local ledger archive.
What I learned
- How to leverage Chrome's built-in Gemini Nano for instantaneous, offline-capable privacy preprocessing.
- The vital role of physical user intentionality: replacing silent background API calls with tactile authorization (the Hold-to-Release Wax Stamp) dramatically elevates user confidence.
- How Firebase AI Logic, App Check, and Remote Config work harmoniously to build enterprise-grade hybrid AI perimeters.
What's next for Veil: The Cloud Thinks. Your Device Keeps The Secrets.
- Browser Extension & Desktop Agent: Bringing Veil's Customs Gate to any browser to automatically shield text pasted into commercial cloud chatbots and search tools.
- Multimodal Masking: Expanding on-device pseudonymization to medical DICOM imaging, PDF forms, and audio waveforms using local vision models.
- Enterprise Team Policies: Centralized Remote Config policies allowing enterprise compliance teams to distribute organization-wide privacy dials while employees retain local zero-knowledge execution.
Built With
- app-check
- chrome-built-in-ai
- firebase
- firebase-hosting
- firestore
- gemini-api
- gemini-nano
- github-actions
- google-cloud
- hipaa
- hybrid-ai
- javascript
- node.js
- privacy
- recaptcha-enterprise
- remote-config
- security
- tailwind
- typescript
- vertex-ai
- vite
- vitest
- web
- zero-trust