HushBrief — design and architecture
Product
English desktop Chrome app. No login, database, analytics, external fonts or persisted notes. Three stages: working notes, exact redacted notes preview with permission, and an evidence-linked handoff with Markdown download. Original notes live in tab memory. Reload/clear drops the application state; the service worker caches static application code only. Browser/OS crash recovery and extensions are outside the application storage promise.
[[private: …]] spans never reach any model and never appear in the handoff or export. Replace them with [private note withheld] before any device, hybrid, cloud, local-rules or rehearsal processing, including unclosed spans to end of input. Keep a map of original and masked half-open UTF-16 offsets; cloud contact replacements update the masked offsets. Drop actions whose evidence overlaps a private span or any part of its placeholder, or contains the placeholder. Retained quotes must still be verbatim substrings of the submitted masked text. The UI and Markdown header show the number of spans withheld, with singular/plural wording.
Automatic email/phone masking applies to the cloud packet. Device-only and local-rules results retain emails and phones. Names, financial details, uncommon identifiers and every possible PII format are NOT automatically recognized. The preview is always visible. Editing notes revokes permission and invalidates an old export. Data changes during an inference discard the stale response.
The current local fallback extracts TODO/action-like lines and leaves owner/date unassigned. It does not claim semantic summarization. Model output must match a bounded schema and quote source substrings; malformed or unsupported output falls back to local extraction. A valid evidence quote still does not prove every model inference correct, so people review before sharing.
Architecture and actual SDK use
- TypeScript + Vite; exact dependency versions and package-lock.json.
- Official Firebase JS SDK
firebase/ai,firebase/app,firebase/app-check. - App Check reCAPTCHA Enterprise initialized before
getAI. getGenerativeModelbuilds three model instances:ONLY_ON_DEVICE,PREFER_ON_DEVICE,ONLY_IN_CLOUD.- A user click prepares Nano with
initializeDeviceModel; output routing usesresponse.inferenceSource. - Default cloud model is pinned by configuration to
gemini-3.5-flash-lite, the current documented hybrid default. Owner can change it for actual project availability. - Rehearsal fake cloud is a real loopback HTTP server; no external model. Simulated Nano uses deterministic local extraction and is labeled as simulated.
- A generated service worker stores only the application shell and build assets. It does not cache notes, prompts, POST responses or cloud responses.
| Situation | Input allowed | Path |
|---|---|---|
| No cloud permission, Nano ready | Private spans withheld; emails/phones visible | Firebase ONLY_ON_DEVICE; errors → local rules |
| No permission, Nano absent | Private spans withheld; emails/phones visible | Local rules; zero cloud-capable calls |
| Offline | Private spans withheld; emails/phones visible | Device-only if ready, otherwise local rules |
| Permission, Nano ready | Reviewed redacted notes | Firebase PREFER_ON_DEVICE, automatic cloud fallback permitted |
| Permission, Nano unavailable/downloading | Reviewed redacted notes | Firebase ONLY_IN_CLOUD |
| Cloud/model/parser error | Private spans withheld; emails/phones visible | Local rules, no automatic retry |
A model instruction template wraps notes as a JSON string. Notes are data, never instructions. There are no model tools, navigation actions, HTML rendering or message sending. All dynamic output uses textContent. This reduces consequences of prompt injection, but no claim is made that prompting eliminates it.
Permission covers the notes payload shown in the UI plus the fixed handoff instruction template in core.ts. Requests additionally carry normal SDK/service metadata. A cloud-capable call receives no original prompt. All routes exclude explicit private spans. Unmarked sensitive context can remain in output; exports are explicitly downloaded by the user and must be reviewed.
Configuration and release boundary
No private .env* file ships in the public-source allowlist. The owner runs configure --init to generate untracked .env.local, then validates it without printing values. Ordinary builds ignore environment files; explicit dev:live/build:live commands opt in. No server Gemini key belongs in the client. App Check debug mode can only run in Vite development on loopback. A local debug token lives only in the untracked .env.development.local, which Vite never loads for production builds. scripts/check-dist.mjs reads only build output and rejects debug-token assignments, markers, environment-variable names and UUID-shaped literals without opening private configuration. Production uses reCAPTCHA Enterprise and enforced App Check. Operator-only docs/internal/ files are excluded from the public-file allowlist.
Live Firebase verification and remaining limitations are recorded in verification.md.
Scope
12,000-character input cap, six action cards, English text only, no attachments, no medical/legal conclusions, no sending on behalf of users. No unsupported cost, latency or accuracy numbers are advertised. The local-first flow can reduce exposure and avoid a model request when cloud is off, but dollar savings and model performance have not been benchmarked.