Inspiration

Windows Security Event logs contain exactly the data you cannot paste into a cloud chatbot: usernames, hostnames, IP addresses and SIDs. Analysts still need help triaging them quickly, so many teams either skip AI or paste sensitive data where they should not.

What it does

HybridShield is a browser-based SOC assistant that analyzes a security log in four steps:

  1. Redact first. A local privacy guard removes IPs, MACs, SIDs, accounts and paths in the browser, before any model sees the log. The analyst can compare the original and the redacted text side by side (Privacy Proof panel).
  2. Run on the device. Gemini Nano, through the Firebase AI Logic hybrid SDK, produces the threat level, root cause and remediation on the analyst's own machine.
  3. Cloud only with consent. If the analyst ticks "Allow redacted cloud escalation", the SDK can fall back to cloud Gemini, and it only ever receives the redacted text.
  4. Always an answer. If Nano is unavailable and the cloud is off, over quota or offline, a deterministic local rule engine still returns a complete result with a ready-to-use PowerShell response playbook. It is labeled "Local Rule Engine (no AI)" and is never presented as an AI result.

Routine events (for example Event ID 4624) skip the model entirely. A severity floor and consistency checks correct weak model output, and incidents are stored in Firestore as a per-analyst, hash-chained ledger.

How we built it with Firebase AI Logic

  • getAI with the Gemini Developer API backend and getGenerativeModel in hybrid mode: PREFER_ON_DEVICE when the analyst consents to cloud escalation, ONLY_ON_DEVICE when they do not, and ONLY_IN_CLOUD for an anonymized fleet-level report that contains aggregated counts only.
  • initializeDeviceModel() is called from a user click so Gemini Nano is downloaded and ready before the first request.
  • Every result is labeled with where inference really ran. We read inferenceSource from the SDK response and cross-check it with the browser's own network log, so the interface never guesses.

Other Firebase products

  • App Check (reCAPTCHA Enterprise, plus a competition-only debug token on the live demo) protects AI Logic requests.
  • Authentication (anonymous) scopes each analyst's data.
  • Remote Config drives the pre-filter event, the system prompt, routing, and the cloud model chain. When a model returns a quota error it is skipped and the next one is tried, then the local engine.
  • Firestore stores the redacted incident ledger under schema-validated, per-analyst security rules, with a persistent local cache.
  • Hosting serves the app. A service worker and a self-hosted SDK let it work offline after the first load.

Challenges we ran into

  • Handling every Gemini Nano state (flags, model download, unavailable in Incognito) without ever leaving the analyst empty-handed.
  • Staying on the free tier: cloud quotas run out, so the app needed a model chain and a deterministic last resort.
  • Proving where inference ran, not assuming it.
  • Getting App Check attestation right: the reCAPTCHA key type must match the provider registered in the Firebase console, otherwise every AI Logic request is rejected.

Accomplishments that we're proud of

  • A hybrid design where privacy is the default behavior, not a setting.
  • Verified routing labels on every result.
  • The same app works with Nano, with cloud (redacted), with no AI, and offline.

What we learned

On-device models change the design question from "how do we protect the data we send?" to "what truly needs to leave the device?". Building for the unavailable cases first made the whole app more reliable.

Honest limitations

Gemini Nano needs Chrome Desktop with the Prompt API flags and the model downloaded. Free-tier cloud quota is small. Redaction is pattern-based and should be reviewed before use with real production data. This is a hackathon prototype tested with sample Windows Security logs.

What's next

  • A Chrome extension version for in-place triage.
  • Broader log sources and redaction rules.
  • Per-organization policy through Remote Config.

Built With

  • chrome-prompt-api
  • cloud-firestore
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • firebase-remote-config
  • gemini-nano
  • javascript
  • recaptcha
  • service-worker
  • tailwindcss
Share this project:

Updates

Submission history