0 Bytes of Patient PII Sent to the Cloud: Building a Zero-Trust Telehealth Scribe with Gemini Nano & Firebase A developer built EchoGuard, a telehealth scribe prototype that runs a local PII redaction layer using Chrome's on-device Gemini Nano via the Firebase AI Logic SDK before any transcript data reaches the cloud. The browser-side shield, paired with a fail-closed deterministic redactor, strips patient names, birthdates, MRNs, insurance IDs and phone numbers, and the UI displays an audit receipt confirming zero bytes of raw PII were sent. Only scrubbed text is passed to Cloud Gemini to generate structured SOAP notes with ICD-10 codes, HL7 FHIR JSON exports, and a two-speaker doctor-and-nurse handoff briefing via Gemini Flash TTS. Cloud AI can turn a messy telehealth transcript into a clean SOAP note in 5 seconds. So why aren’t doctors pasting patient notes straight into a cloud LLM? Because a real clinical transcript has the patient’s full name, date of birth, medical record number MRN , phone number, insurance ID, and even their mother’s name. Send that raw text to a third-party cloud server and you have an immediate privacy breach. I built EchoGuard to stop that before a single byte leaves the browser. Instead of asking clinicians to trust a remote server with raw patient records, EchoGuard enforces a zero-trust boundary locally on the device first—so 0 bytes of raw PII ever cross the network. Before diving into the architecture, let’s be clear about what this prototype does and where its boundaries are: EchoGuard splits the workload across the browser boundary using the Firebase AI Logic SDK firebase/ai : Live Mic / Transcript │ ▼ ┌──────────────────────────────────────────────────────────┐ │ BROWSER Zero-PII Boundary │ │ 1. Local PII Shield │ │ • Gemini Nano InferenceMode.ONLY ON DEVICE │ │ • Fail-closed deterministic local redactor │ └───────┬──────────────────────────────────────────────────┘ │ 0 Bytes of Raw PII Crosses Here ▼ ┌──────────────────────────────────────────────────────────┐ │ FIREBASE App Check + Remote Config │ │ 2. Cloud SOAP Synthesis Cloud Gemini │ │ • Structured SOAP Note + ICD-10 + HL7 FHIR JSON │ │ │ │ 3. Multi-Speaker Shift Handoff Gemini Flash TTS │ │ • Parallel Doctor & Nurse synthesis + 24kHz PCM │ └──────────────────────────────────────────────────────────┘ When a clinician dictates via Live Mic or pastes a transcript, nothing touches the network yet. Chrome’s built-in Gemini Nano InferenceMode.ONLY ON DEVICE pairs with a fail-closed deterministic redactor to scrub patient names, caregiver names mother , father , guardian , spoken and numeric birthdates, MRNs, insurance IDs, and phone numbers inside the browser. The UI renders a live audit receipt showing exactly how many entities were stripped locally—and confirming 0 Bytes PII Sent to Cloud . / Redacts residual PII on-device using Gemini Nano via Firebase AI Logic. / export async function redactPIIViaFirebaseNano rawTranscript: string, onChunk?: partialText: string = void, : Promise