NLP · Classification

Hermes Triage

A fitted email-triage classifier, not a keyword filter. Tune the auto-close threshold, inspect token-level contributions, and compare the model with a hand-written rule baseline on a labeled synthetic inbox.

  • 1,200 train · 600 test reports
  • Keyword-rule baseline
  • Token explanations
  • POST /api/triage

Personal project on synthetic data · Not an employer system

Architecture

  • Logistic regression
  • Token features
  • Threshold design
  • Error analysis
  1. Synthetic inbox1,200 training and 600 test reports, including hard overlaps
  2. FeaturesBinary token presence plus URL-structure signals
  3. Fitted classifierL2 logistic regression vs a keyword and URL rule baseline
  4. Auto-close thresholdBelow closes as benign; above goes to an analyst
  5. ExplanationToken-level logit contributions for each report

Run it

  1. Pick a sample report
  2. Move the auto-close threshold
  3. See which tokens send it to an analyst

What this showsNLP classification · Precision vs. recall trade-offs · Explainable predictions · Workload reduction

Sample report
35%

POST/api/triageReady

Optional. Leave empty to use the selected sample.

0 / 2,000
Benign auto-closed
97.5%true-negative rate
Phishing caught
99.0%recall
Analyst workload
33.5%66.5% vs reviewing all
Missed phishing
2false negatives

Credential lure

Credential harvest · actual phishing

90.5%champion score
Send to analyst

Unusual activity on your account. Verify your password immediately at http://203.0.113.44/login or we will suspend access.

  • immediately+2.158
  • password-1.079
  • suspend+0.926
  • login+0.692
  • verify+0.547
  • IP URL-0.300
  • account+0.230
  • unusual+0.175
  • activity+0.175

Intercept -1.273 + contributions = logit 2.251

Score distribution

Champion scores by true class

BenignPhishing

Champion vs. keyword rules

Same 600-report test set · rules have a fixed operating point

SystemTNRRecallPrecisionF1Workload
Fitted logistic97.5%99.0%95.0%0.97033.5%
Keyword and URL rules58.2%34.7%28.3%0.31239.5%

The baseline is a hand-written keyword and URL heuristic, not a trained model.

Confusion matrix

Champion at this threshold

Sent to analystAuto-closed
Actual phishing191caught2missed
Actual benign10false alarm397auto-closed

Synthetic data. 1,200 training and 600 test reports generated with a fixed seed.

True-negative rate 97.5%, recall 99.0%, 2 missed phishing. Send to analyst.

Decisions, evidence, and limits

The problem

Security mailboxes fill with user-reported messages. Reviewing every item wastes analyst time, but auto-closing the wrong report misses phishing. A keyword filter fires on legitimate IT reminders and misses wire-request impersonation that contains no link.

How it works

Generate a public-safe inbox from templates, including overlapping cases (IT password reminders and link-free wire requests). Fit an L2-regularized logistic model on binary token presence plus URL structure features, then operate it at a tunable auto-close threshold. Reports below the threshold close as benign; the rest go to an analyst.

Baseline

The baseline is a hand-written keyword and URL heuristic with a fixed operating point. Both systems are scored on the same 600 labeled reports so the comparison is reproducible.

What is measured

True-negative rate (benign auto-closed), phishing recall, analyst workload against reviewing everything, missed-phishing counts, confusion counts, score histograms by class, and per-report logit contributions.

Failure modes

Templates are not a production mailbox. Linear token contributions explain this model’s output and are not causal, and the probabilities are uncalibrated. A threshold that looks efficient here can miss a novel lure that the vocabulary never saw.

Production tradeoffs

Train on reviewed historical reports with a temporal split, add calibration and family-level slice metrics, keep a human review queue for scores near the threshold, and monitor delayed labels.