NanoShield protects privacy before sensitive prompts or enterprise documents reach third-party LLMs and cloud APIs.
1. Firebase AI Logic Hybrid Inference
NanoShield utilizes Google's official firebase/ai SDK with InferenceMode.PREFER_ON_DEVICE:
- On-Device (Gemini Nano): When running in compatible Chrome desktop browsers with Prompt API enabled, entity detection and redaction execute 100% locally on your machine's NPU/GPU. Sensitive PII never transmits over the network.
- Cloud Fallback (Gemini 3.8 Flash): If Gemini Nano is unavailable or the payload exceeds on-device limits, the SDK transparently routes to Gemini 3.8 Flash through Firebase AI Logic.
2. Firebase App Check Protection
All cloud AI requests are cryptographically attested via Firebase App Check. This guarantees that only genuine NanoShield client sessions can consume backend inference quotas, preventing unauthorized API scraping and quota exhaustion.
3. Firebase Remote Config Policies
Security policies (strictness mode, enabled entity types, confidence thresholds, and hybrid routing rules) are pulled dynamically from Firebase Remote Config, allowing administrators to update compliance posture without redeploying code.
4. Zero-Knowledge Cloud Firestore Audit Log
NanoShield logs redaction session telemetry to Cloud Firestore (users/{uid}/redactions) with offline-first caching via persistentLocalCache. Crucially, no sensitive text or PII is ever written to Firestore — only cryptographic SHA-256 integrity proofs, entity counts, mask styles, and latency metrics are saved.
5. Reversible Token Vault
NanoShield stores an isolated in-memory token map (e.g. [REDACTED_NAME_1] ↔ "John Doe") in your local browser sandbox. Once your external LLM replies, click De-Anonymize to swap real names back into place locally.