-
-
Gemini Nano and deterministic rules detect sensitive information locally and replace it with verified placeholders.
-
12/12 production checks, 71/71 Vitest tests, 18/18 mocked E2E tests, and script-based SHA-256 verification passed.
-
Powerful AI. Less disclosure. On-device AI protects, cloud AI creates, and you control disclosure.
-
Real captures of leakage checks, sanitized prompt review, and explicit human approval with SHA-256 binding.
-
Real on-device inference powered by Gemini Nano and Firebase AI Logic, without automatic cloud fallback.
-
Privacy-first hybrid architecture powered by Firebase AI Logic, combining local protection and approved cloud inference.
-
Cloud AI generates responses with placeholders. SecretBridge restores protected values locally in the browser.
-
Metadata-only Privacy Receipt records inference sources, approval binding, leakage checks, and restoration results.
SecretBridge — Powerful AI. Less disclosure.
What if the AI protecting your privacy never needed to leave your device?
SecretBridge introduces a privacy-first approach to hybrid AI, transforming on-device intelligence into a protection layer for cloud AI collaboration.
Try SecretBridge Live | GitHub Repository | Watch the Demo
Inspiration
Generative AI has become an essential tool for business, education, and everyday productivity. However, using cloud AI often means transmitting information that contains personal, financial, or commercially sensitive data.
Users frequently face a difficult choice:
- Use powerful cloud AI and disclose potentially sensitive information.
- Use local AI and accept limitations in reasoning or generation capabilities.
- Manually remove sensitive information before every AI interaction.
We believed there should be a better approach.
Instead of treating on-device AI and cloud AI as competing alternatives, we designed a system in which they collaborate while performing different responsibilities.
On-device AI protects. Cloud AI creates. The user controls disclosure.
This is the philosophy behind SecretBridge.
What it does
SecretBridge is a browser-based, privacy-first hybrid AI application powered by Firebase AI Logic.
It enables users to collaborate with powerful cloud AI while reducing unnecessary disclosure of sensitive information.
1. Protect On-Device
Gemini Nano analyzes private input directly on the user's device.
AI-assisted semantic detection is combined with deterministic rules and optional manual protection to identify sensitive information, including names, organizations, email addresses, financial amounts, and reference identifiers.
Verified sensitive values are replaced with session-specific placeholders. The original values and their mappings remain in application-controlled browser memory.
2. Collaborate Explicitly
Before any cloud inference request, SecretBridge presents the complete sanitized logical prompt for human review.
A pre-send leakage check searches for remaining known sensitive values.
The user must explicitly approve the reviewed prompt. Approval is bound to its SHA-256 digest and is single-use.
Only the approved, sanitized prompt is sent to cloud AI.
3. Restore Locally
The cloud model generates a response using placeholders instead of the original protected values.
SecretBridge reconstructs the response locally using its in-memory mappings.
The user receives a personalized result without requiring the cloud model to receive the original protected values.
4. Verify with a Privacy Receipt
SecretBridge generates a metadata-only Privacy Receipt that records:
- Requested and actual inference sources
- Sensitive information detection counts
- Pre-send leakage check results
- Human approval verification
- SHA-256 approval digest
- Local restoration results
- Processing time and execution status
The receipt excludes raw private input, secret mappings, and restored output.
It also explicitly identifies what cannot be verified by the application.
5. Local-Only Mode
For tasks that do not require cloud intelligence, SecretBridge provides a dedicated Local-Only Mode.
This mode uses on-device inference without initiating cloud AI requests.
How we built it
SecretBridge was built using React, TypeScript, Vite, and Firebase AI Logic.
Firebase AI Logic: The foundation of our architecture
Firebase AI Logic enables SecretBridge to access both on-device and cloud intelligence through its hybrid inference capabilities.
We intentionally assign different responsibilities to each inference environment.
On-device inference:
- Gemini Nano
- InferenceMode.ONLY_ON_DEVICE
- Sensitive information detection
- Local-only text generation
Cloud inference:
- Gemini Cloud
- InferenceMode.ONLY_IN_CLOUD
- Advanced generation using approved, sanitized input
Rather than automatically falling back to cloud AI when local protection fails, SecretBridge implements a controlled handoff.
If local protection cannot complete successfully, the application stops the workflow instead of automatically sending private input to the cloud.
This fail-closed behavior is a core architectural decision.
Privacy protection architecture
The system combines five protection layers:
- S1: Local semantic analysis and deterministic detection
- S2: Verified sensitive spans and session-specific tokenization
- S3: Pre-send known-value leakage checks
- S4: Explicit, single-use, SHA-256-bound human approval
- S5: Local restoration and metadata-only verification
Firebase App Check and Hosting
SecretBridge uses Firebase App Check with reCAPTCHA Enterprise to protect access to cloud AI services.
We separated local and cloud Firebase initialization so that cloud App Check initialization occurs only when an approved cloud request is required.
Firebase Hosting provides the public production environment, with Content Security Policy and additional HTTP security headers.
Challenges we ran into
On-device model availability and performance
On-device inference depends on browser compatibility, model availability, and hardware resources.
We encountered model initialization delays, limited GPU memory, and inference session contention.
We addressed these challenges through explicit readiness indicators, configurable timeouts, cancellation handling, and fail-closed execution.
AI-generated detection is not automatically trustworthy
Local AI can return incomplete or inaccurate sensitive information proposals.
We therefore implemented deterministic span verification. AI-proposed values must correspond to actual source text before they can be used for protection.
Preventing unintended cloud communication
We discovered that privacy protection requires more than controlling the final AI request.
SDK initialization and authentication mechanisms can also introduce network activity.
Our delayed cloud initialization architecture separates local operations from cloud authentication and collaboration.
Making human approval meaningful
A confirmation checkbox alone does not establish that the transmitted prompt matches what the user reviewed.
We implemented SHA-256 binding and single-use approval, then independently compared the actual HTTP request text against the approved digest.
Accomplishments that we're proud of
SecretBridge is a working, publicly deployed application, not merely a conceptual prototype.
During our production verification on November 27, 2026, we achieved:
- 12/12 required production verification checks passed
- 71/71 Vitest tests passed
- 18/18 mocked Playwright end-to-end tests passed
- SHA-256 verification using an independent script passed
- 5 unique synthetic sensitive values protected
- 6 placeholder occurrences restored locally
- 0 unknown or missing placeholders
- 0 known synthetic sensitive values remaining in the verified outbound payload
- 0 observed application network requests during the tested pre-approval and Local-Only execution windows
Measured inference results in our test environment:
- Cloud processing: 3,827 ms
- Local-Only processing: 37,834 ms
- Local-Only first chunk: 19,209 ms
The actual transmitted logical prompt matched the approved SHA-256 digest.
The open-source repository was also verified through an unauthenticated public clone.
These measurements describe specific tests using synthetic data and are not universal performance or security guarantees.
What we learned
Hybrid AI is about more than choosing where inference happens.
It enables applications to assign distinct responsibilities to different intelligence environments.
On-device AI can become a privacy protection layer, while cloud AI contributes advanced generation capabilities.
We also learned that privacy must be designed into the entire application lifecycle, including initialization, data handling, approval, transmission, restoration, and verification.
Human approval becomes more meaningful when the approved content is visible and technically bound to the actual request.
What's next for SecretBridge
We envision SecretBridge evolving from a standalone application into a reusable privacy protection architecture for AI-enabled systems.
Potential future developments include:
- A reusable privacy gateway SDK
- Enterprise-defined sensitive information policies
- Multilingual semantic protection
- Integration with business document workflows
- Support for additional platforms
- More advanced contextual disclosure-risk detection
- Expanded verification and accessibility testing
Our long-term goal is to enable organizations to adopt powerful AI while maintaining greater control over what information they disclose.
Transparency and limitations
SecretBridge is designed to reduce unnecessary disclosure through application-controlled workflows.
It is not a certified data loss prevention product, a guarantee of complete anonymization, or an independently certified security system.
Undetected sensitive information, contextual re-identification risks, browser and operating system integrity, and cloud provider data handling remain outside its verification scope.
We believe transparent limitations are an essential part of building trustworthy AI systems.
Open source and availability
SecretBridge is available as open-source software under the Apache License 2.0.
- Live application: https://secretbridge.web.app
- Source code: https://github.com/DataCosmo-Inc/SecretBridge
- Demo video: https://youtu.be/B_LbwK-BmCg
The current implementation targets compatible desktop Chrome environments with on-device AI support. The initial model download and inference performance depend on the user's environment.
Developed by DataCosmo, Inc.
Fukuoka, Japan
Making the complex, simple.
