Inspiration

I have always been interested in how technology can solve real problems, particularly in cybersecurity. As I explored the growing capabilities of AI, one question kept coming back to me: What happens when we start trusting AI with decisions that require evidence, but the AI gets the evidence wrong?

AI can produce convincing explanations, identify patterns and summarize large amounts of information. But sounding confident does not mean being correct. In cybersecurity, a fabricated event, an incorrect interpretation of a login record or an unsupported conclusion can send an investigation in the wrong direction.

This became more than a theoretical concern when I started testing AI against security event records. I found that models could reference event IDs that did not exist in the supplied evidence or describe a successful logon as a denied attempt. The problem was not simply that AI could make mistakes. It was that those mistakes could look convincing.

The 2024 Change Healthcare cyberattack also illustrates why security investigations matter. The incident involved compromised credentials being used to access a remote-access portal without multi-factor authentication. It demonstrated how weaknesses in identity and access security can have consequences far beyond an individual system.

I did not build AEMAS to claim that it could have prevented that incident. Instead, the case study helped frame a question I wanted to address: when analysts investigate security events, how can AI assist them without becoming another source of unverified claims?

That question became AEMAS.

What it does

AEMAS (AI Event Matching and Analysis System) is a hybrid AI security investigation tool that helps analysts examine authentication event records.

Its central principle is simple:

AI proposes. Code verifies. Humans decide.

An analyst loads a case containing authentication events, either from a JSON file or the built-in simulated sample. AI examines the records and proposes findings, with references to the events supporting each claim.

A deterministic verification engine then checks those claims against the original records and assigns one of four verdicts:

  • Verified: The cited events exist and the relevant details match the original records.
  • Rejected: One or more verification checks fail.
  • Contradicted: The cited records contain information that conflicts with the finding.
  • Unchecked: The finding cannot currently be evaluated by an available verification rule.

Analysts can inspect the original evidence alongside the findings, understand why a claim passed or failed, and export a self-contained HTML report and JSON investigation record.

AEMAS also supports hybrid inference:

  • On-device: Chrome’s built-in Gemini Nano processes evidence locally through Firebase AI Logic.
  • Cloud: Gemini 3.5 Flash Lite can be used after the analyst explicitly consents to sending the case data.

The application records where inference occurred and the SDK mode used.

AEMAS analyses records supplied by an analyst. It does not monitor infrastructure, generate live security alerts or take autonomous action. A verified finding confirms that a specific claim matches the cited records; it does not independently prove that an attack occurred.

How we built it

AEMAS was built as a web application using TypeScript, React and Vite.

The architecture separates AI-generated proposals from deterministic verification. This is important because the model should never be responsible for deciding whether its own claims are correct.

The main components include:

  • Frontend: React, TypeScript and Vite provide the investigation workspace, evidence viewer, analysis interface and reporting experience.
  • AI integration: Firebase AI Logic provides the unified interface for on-device and cloud inference.
  • On-device inference: Chrome’s built-in Gemini Nano is accessed through the Prompt API using Firebase AI Logic’s on-device configuration.
  • Cloud inference: Gemini 3.5 Flash Lite is available through Firebase AI Logic after explicit user consent.
  • Verification engine: Deterministic TypeScript rules validate event references, event types, outcomes, timestamps, accounts and computer names against the original records.
  • Reporting: Investigation results can be exported as HTML reports and JSON run records.
  • Security: Firebase App Check with reCAPTCHA Enterprise protects the cloud-facing application path.
  • Deployment: Firebase Hosting serves the production application at project.phang.store.

We use the same system instruction and structured JSON response schema for both inference paths. The application also records the inference source so an analyst can distinguish on-device processing from cloud processing.

The guiding architectural decision was to keep verification independent of the AI model. Even if the model changes, the evidence-checking rules remain deterministic and inspectable.

Challenges we ran into

One of our biggest challenges was separating a convincing AI explanation from a factually supported finding.

During testing, models sometimes referenced event IDs that were absent from the evidence or interpreted event outcomes incorrectly. A normal AI-generated summary might still look reasonable, but that is not good enough for a security investigation.

We addressed this by building a verification layer that checks the model’s claims against the original records. We also had to distinguish between findings that passed verification, findings that failed, findings contradicted by the evidence and findings that could not be checked.

Another challenge was hybrid inference. We wanted analysts to benefit from on-device processing without accidentally sending sensitive investigation data to a cloud service. We implemented an on-device-first path and an explicit consent step before cloud processing.

Getting consistent structured responses across different inference environments also required careful handling of prompts, response schemas, SDK modes and failure cases.

Evaluation was another difficult part. Our tests did not produce uniformly positive results. In one LANL public authentication-data evaluation, a simple deterministic baseline covered more labelled events than the model’s verified findings. Rather than hide that result, we kept it in our evaluation notes. It reinforced why AEMAS needs verification and why AI output must not be treated as ground truth.

Accomplishments that we’re proud of

We are proud that AEMAS goes beyond displaying AI-generated security summaries. It provides a mechanism for checking individual claims against the evidence that supposedly supports them.

Some of our key accomplishments include:

  • Building a working hybrid AI application using Firebase AI Logic.
  • Demonstrating on-device Gemini Nano inference in desktop Chrome.
  • Implementing explicit consent before cloud inference.
  • Building a deterministic verification engine with four distinct verdicts.
  • Providing traceability between findings and original authentication records.
  • Creating exportable HTML reports and JSON investigation records.
  • Integrating Firebase App Check with reCAPTCHA Enterprise.
  • Deploying a publicly accessible application that judges can test without signing in.
  • Building an evaluation process that reports unsuccessful results instead of presenting model output as proof of accuracy.

Most importantly, we are proud of the principle behind the product: an AI-generated finding should have to earn the right to be trusted.

What we learned

We learned that integrating AI into a real application is not just about selecting a capable model or writing a good prompt. It is also about designing systems around the limitations of those models.

A model can produce a plausible explanation while getting important details wrong. Structured output does not automatically mean accurate output, and confidence does not replace evidence.

We also learned that hybrid AI is not simply about choosing between local and cloud models. It is about giving users meaningful control over where their information is processed.

Our evaluation work taught us the importance of reporting limitations honestly. A verification engine can catch unsupported claims, but it cannot make an inadequate model suddenly understand every event. Verification coverage, model quality and analyst judgement are separate concerns.

Above all, we learned that trustworthy AI systems need boundaries. AI should be useful, but its conclusions should remain open to inspection.

What’s next for AEMAS: AI Event Matching and Analysis System

AEMAS currently focuses on authentication-event investigations. Our next goal is to make it useful across more security workflows without compromising its evidence-first architecture.

Our planned improvements include:

  • More data sources: Browser-side integrations with Microsoft Entra ID and Google Workspace, allowing analysts to bring selected sign-in records into an investigation.
  • SIEM integrations: A future versioned ingestion API for SIEM platforms and other security tools, introduced with proper authentication, tenant isolation, auditing and retention controls.
  • More evidence formats: Support for CSV and NDJSON alongside the existing JSON case format.
  • More investigation types: Extend the verification engine to phishing, endpoint, network and cloud security investigations, with rules appropriate to each evidence type.
  • Stronger evaluation: Expand testing across more datasets and investigation scenarios to measure both model performance and verification coverage.

Our long-term vision is to make AEMAS an evidence-backed investigation layer that works alongside existing security tools.

We do not want to replace security analysts or make AI the final authority in an investigation. We want to give analysts a way to use AI assistance while retaining control over the evidence, the conclusions and the final decision.

AI proposes. Code verifies. Humans decide.

⸻

Built With — Devpost Tags

Select these tags from Devpost’s autocomplete where available:

TypeScript, Python, React, Vite, Generative AI, Gemini Nano, Gemini, Firebase AI Logic, Firebase, Firebase Hosting, Firebase App Check, reCAPTCHA Enterprise, Cybersecurity, Security Operations, Incident Response, Hybrid AI, On-device AI, Vitest, Chrome Prompt API

Built With

  • chrome
  • cybersecurity
  • firebase
  • firebase-ai-logic
  • firebase-app-check
  • firebase-hosting
  • gemini
  • gemini-nano
  • generative-ai
  • hybrid-ai
  • incident-response
  • on-device-ai
  • python
  • react
  • recaptcha-enterprise
  • security-operations
  • typescript
  • vite
  • vitest
Share this project:

Updates

Submission history