Inspiration
People sign leases, loan agreements, insurance policies, employment contracts, and medical bills every day without fully understanding them—and these documents are packed with personal data (SSNs, IBANs, addresses, names). Uploading raw documents to cloud LLMs exposes sensitive PII.
What It Does
Plainly is a privacy-first document explainer that:
- Redacts locally first using a two-layer Local Shield (deterministic regex + Luhn validators merged with an on-device LLM).
- Enforces a Mandatory Review Gate before any cloud call is permitted.
- Routes by sensitivity using Firebase AI Logic's four hybrid modes (
ONLY_ON_DEVICE,PREFER_ON_DEVICE,PREFER_IN_CLOUD,ONLY_IN_CLOUD). - Explains & Audits: Generates Instant Summaries, Deep Review clause risk tables, and Q&A with citations on
RedactedTextonly, rehydrates placeholders locally, and proves"Personal details sent: 0"via an exportable Privacy Ledger.
How We Built It
- Type-Safe Privacy Boundary: Distinct
RawTextandRedactedTexttypes in TypeScript, Kotlin, and Swift. - Firebase AI Logic: Hybrid inference across Web (Gemini Nano), Android (Gemini Nano), and iOS (Apple Foundation Models).
- Firebase Security: App Check, Anonymous Auth, Remote Config kill-switch, and Firestore rules rejecting any raw-text fields.
- Benchmarking: 10-document synthetic corpus with automated precision/recall evaluation (
docs/BENCHMARK.md).
Built With
- firebase
- firebase-ai-logic
- jetpack-compose
- kotlin
- react
- swift
- swiftui
- typescript
- vite

