Client-Side Threat Intelligence

Intelligence on device.
Privacy by design.

An autonomous, dual-expert neural anti-phishing engine executing entirely inside Google Chrome. Zero cloud telemetry. Complete mathematical confidentiality.

🎓 Final Year Project (FYP): An applied research architecture developed at Universiti Tunku Abdul Rahman (UTAR). Core training datasets and model generation scripts are maintained in a private repository in accordance with project submission guidelines.
UTAR • FYP
> 95%
Spam F1-Score
Adversarial benchmark validation
38 ms
V8 Inference Latency
Zero network roundtrips
162 KB
Tensor Payload Size
Pure JSON weight matrix
< 0.1%
False Positive Rate
Zero workplace disruption
Studio Showcase

Autonomous Zero-Trust Shield.

Operating directly within the V8 JavaScript runtime, MailGuard AI performs deep RFC 5322 MIME authentication parsing, spectral obfuscation forensics, and dual-expert tensor classification in under 38 milliseconds.

🧠 O(74) SHAP Explainable AI 🔬 Dual-Expert (MLP + OCSVM) 🔗 URL & FFT Forensics ⚡ 100% Client-Side V8
🛡️ MailGuard AI Active Protection
92%
Threat
Phishing Detected
From: security@service-account.com
Subject: Immediate Verification Required
🧠 SHAP XAI Attribution Leave-One-Out Δ
DKIM Signature
100%
Urgency Lexical
86%
Hop Latency
74%
⚡ Live Threat Simulator
(Click to test model reaction)
Paradigm Shift

Engineered for absolute confidentiality.

Commercial anti-phishing tools routinely upload private enterprise communications to vendor cloud servers. MailGuard AI establishes a new privacy paradigm: executing 100% of feature extraction, cryptographic header verification, and deep neural inference natively within the local browser sandbox.

🔒
Zero Cloud Telemetry
Email bodies, authentication headers, and personal contacts never leave your device.
Lead Researcher & Author Loi Chiang Hao
Portfolio ↗ LinkedIn ↗ GitHub ↗
Institution Universiti Tunku Abdul Rahman (UTAR)
Faculty & Department FICT • Computer & Comms
Programme BIT (Hons) Comms & Networking
Engineering Maturity

The Evolution: Prototype to Production.

How the architecture transformed from an academic experimental script into an enterprise-grade Chrome Manifest V3 service worker.

FYP1 Prototype
  • •Shallow DOM scraping (single active opened email)
  • •Heuristic-only assumptions with static wordlist
  • •Prone to UI freezing on large inbox scans
  • •Frequent crashes upon Service Worker sleep cycles
  • •Blind black-box verdict with zero human explainability
FYP2 Production Engine
  • •Full raw RFC 5322 MIME & headers via Gmail REST API
  • •Dual-Expert Deep Neural MLP + One-Class SVM anomaly detection
  • •JIT viewport row scanning with scanEpoch token concurrency
  • •Self-healing hibernation recovery with exponential polling
  • •O(74) First-Order SHAP live explainable AI (XAI) attribution
Tensor Space Specification

74-Dimensional Multi-Signal Feature Space.

MailGuard AI models heterogeneous email payloads into a compact 74-dimensional vector across three complementary forensic signal groups:

15D
Identity & Authentication

SPF, DKIM, DMARC validation states, sender identity consistency, domain alignment indicators, and RFC 2369 List-Unsubscribe header evidence.

30D
Routing & Topology

Hop counts, relay timing delta ($\Delta t_i$), inter-MTA latency vectors, routing irregularities, and infrastructure topology extracted from Received: headers.

29D
Content & Spectral Dynamics

Body length, vocabulary density, urgency tokens, combined with Fast Fourier Transform (FFT) harmonic spectral invariants from the raw character stream.

🔗 URL Spoofing & Homoglyphs

Detects Cyrillic vs Latin visual homoglyphs, concealed target hyperlinks where anchor text differs from actual destinations (href mismatch), open redirects, and newly registered high-risk TLDs.

⏰ Odd-Time Anomalies

Analyzes MIME Date headers against historical organizational circadian rhythms. Flags anomalous off-hour transmissions (e.g., 3:00 AM CEO wire transfer requests) combined with server timestamp discrepancies across relay hops.

🚨 Artificial Urgency Exploits

Quantifies cognitive coercion patterns designed to bypass human rational thinking (e.g., "Immediate action required", "Account suspended within 2 hours", "Final legal notice") using localized semantic intensity scoring.

🌐 Header & Routing Spoofing

Inspects the chain of custody in RFC 5322 Received: headers to spot forged envelope senders, MTA latency injection, and SPF/DKIM authentication failures disguised through custom relay proxies.

👁️‍🗨️ Zero-Width Steganography

Uncovers invisible zero-width spaces (U+200B, U+FEFF) and RTL override characters maliciously injected into body text or sender display names to break NLP keyword filters while remaining invisible to the human eye.

📎 Double-Extension Payload Trap

Flags deceptive file attachments leveraging whitespace padding or dual-extension masquerading (e.g., Invoice_Q3.pdf.vbs or Receipt.docx.exe), alongside mismatched MIME content-type headers.

🔒 Feature normalizers, hyperparameter distributions, and training dictionaries are retained in a private repository in accordance with university FYP submission guidelines.

Concurrency & Resilience

4-Tier Zero-Latency Caching Hierarchy.

Eliminating Google API rate limitations (HTTP 429) while guaranteeing 60 FPS viewport smoothness:

L1 Hot Memory
In-Memory LRU

Sub-millisecond instant lookup during an active Gmail session.

L2 Persistent
IndexedDB Store

On-disk transactional store. Survives browser restarts and SW sleep.

L3 Active State
Session Storage

Syncs inspect state between content scripts and popup UI.

L4 Trust Engine
Local Storage

Immutable Human-in-the-Loop sender reputation overrides.

Architecture Flow

How MailGuard AI operates.

A multi-tier pipeline engineered for Chrome Manifest V3, eliminating UI thread freezing while handling asynchronous Service Worker lifecycles.

1
Content Script Observer (content.js)

Monitors Gmail viewport mutations using lazy on-demand row detection, injecting non-intrusive threat indicators (flex-shrink: 0) without layout shifting.

2
Sandboxed Service Worker Neural Core (background.js)

Fetches RFC 5322 raw authentication headers (SPF, DKIM, DMARC), extracts the 74-dimensional vector, and executes dual-expert inference via the local V8 engine.

3
Explainable AI Dashboard (popup.js)

Translates complex mathematical tensors into human-readable risk diagnostics, displaying top attack contributors alongside one-click Trust Whitelist controls.

Mathematical Rigor

Scientific foundation.

The four core mathematical formulations powering real-time edge evaluation directly inside the browser V8 JavaScript engine.

Supervised Threat Scoring

1. Deep Neural Forward Pass (MLP)

Maps normalized 74-D input vector $\mathbf{x}$ to non-linear threat probability $p \in [0, 1]$ via a multi-tier feedforward perceptron. Hidden layers utilize ReLU non-linearities, terminating in an output Sigmoid activation $\sigma$.

$$\begin{aligned} \mathbf{h}_1 &= \text{ReLU}(\mathbf{W}_1\mathbf{x} + \mathbf{b}_1) \\ \mathbf{h}_2 &= \text{ReLU}(\mathbf{W}_2\mathbf{h}_1 + \mathbf{b}_2) \\ p &= \sigma(\mathbf{W}_3\mathbf{h}_2 + \mathbf{b}_3) \end{aligned}$$
Hybrid Decision Fusion

2. Composite Threat Score Function

Computes a calibrated convex combination between supervised posterior probability $p$ and OCSVM boundary deviation $S_{\text{OCSVM}}$ using optimal fusion weighting $\alpha$, evaluated against decision boundary threshold $\tau$.

$$S_{\text{composite}} = \alpha p + (1 - \alpha) S_{\text{OCSVM}} \quad (\text{Threshold: } \tau)$$
Explainable AI Diagnostics

3. First-Order SHAP Attribution ($O(74)$)

Approximates Shapley marginal attributions $\phi_i(x)$ on-demand via deterministic sequential leave-one-out feature ablation, collapsing intractable exponential complexity $O(2^{74})$ into a lean $O(74)$ linear pass.

$$\phi_i(x) \approx f(x) - f(x_{\setminus \{i\}})$$
Adversarial Evasion Forensics

4. Discrete Fourier Spectral Analysis (FFT)

Detects non-semantic evasion techniques (e.g., zero-width unicode steganography and homoglyph substitution) by converting ASCII ordinal sequences $x[n]$ into frequency domain harmonic spectrum $X[k]$.

$$X[k] = \sum_{n=0}^{N-1} x[n] \cdot e^{-j \frac{2\pi}{N} k n}$$
Empirical Verification

Measured performance.

Evaluated across adversarial benchmark corpora under client-side V8 production conditions.

Metric Measured Result Engineering Implication
Spam F1-Score > 95% Robust balance between high precision and adversarial recall
Cross-Validation Stability Consistent (~0.95) Multi-fold validation confirming generalization across diverse distributions
False Positive Rate (FPR) < 0.1% Virtually zero disruption to legitimate daily enterprise communication
On-Device V8 Inference 38 ms Native client-side execution with zero external network roundtrips
Tensor Model Size 162 KB Ultra-compact JSON payload stored locally in the extension bundle
Full Inbox Scan (50 rows) 3 – 5 seconds Staggered asynchronous dispatch preventing Google 429 quota limits
Citation

Academic reference.

Developed as a Final Year Project thesis at Universiti Tunku Abdul Rahman (UTAR).

@misc{loi2026mailguard, author = {Loi, Chiang Hao}, title = {MailGuard AI: Autonomous On-Device Phishing and Threat Intelligence Framework}, year = {2026}, howpublished = {Final Year Project Thesis, Universiti Tunku Abdul Rahman (UTAR)}, url = {https://github.com/Hao610/mailguard-ai} }

🔒 The core neural network weights and raw implementation scripts are maintained in a private repository in accordance with academic submission guidelines.