Skip to content

Back to the catalog

A Detection Engineer's Guide for Delegating Work to AI
huntress.comarticle

A Detection Engineer's Guide for Delegating Work to AI

A Huntress detection engineer describes using an LLM to analyze a Microsoft 365 account-takeover case: the model flagged an app identifier as malicious, but it turned out to be the legitimate Outlook desktop client (present in 17%+ of customer orgs) — a scoping error caused by comparing against the wrong denominator. Rescoping the same query correctly surfaced the actual malicious tooling (an identifier seen in only three orgs, rewriting inbox rules), which shipped as a live detection rule with true positives and no false positives so far. The piece generalizes this into a framework for delegating detection-engineering work to AI: only hand over tasks you can cheaply and reliably verify, and invest in building fast, repeatable checks (coverage checks, alert-volume checks, known-good/known-bad tests) rather than trusting raw LLM output.

TL;DR A Huntress detection engineer explains, via a real Microsoft 365 misdetection case, why AI-assisted detection engineering only works when paired with fast, repeatable verification checks.
Document

What it is

A Huntress detection-engineering essay built around one M365 incident, arguing a general rule: you can safely delegate work to AI only to the extent you can cheaply check its output. The existing summary covers the misfire (Outlook desktop client's app ID flagged malicious via wrong denominator). This adds the resolution and a concrete delegation framework.

How it works

The model's data was correct — the identifier appeared in a known-compromised mailbox and was rare in that org. The error was scoping: measured against the wrong denominator. Scored against the full customer base, the Outlook client appears in over 17% of customer organizations, so a rule on it fires on legitimate activity everywhere. The same query, scoped correctly, surfaced the actual malicious tooling.

What to do

The real malicious indicator, now a live rule with two true positives and no false positives so far, had this signature:

  • Appeared in only three organizations
  • Was in no Microsoft catalog
  • Did nothing but rewrite inbox rules

The delegation test — for any AI-generated detection — is three manually-defined checks AI can then run as bounded passes:

  • Is this already covered by existing rules? (In their run, most suggested detectors already existed at lower priority → one list expansion, three experimental rules.)
  • Does it detect the activity it was meant to?
  • How many alerts will it generate in a month?

Key operational principle: a check must be able to fail — one that always passes is not a check. When you find yourself correcting a model on the same drift repeatedly, encode the correction as a hook so it runs itself, and move attention up a layer.

Caveats

The two-questions those three checks don't answer, per the author: whether the rule is safe to ship, and whether it creates false positives at scale. The checks buy more review passes in the same time — they do not certify correctness. Risk tolerance is separate and sometimes imposed, not chosen.

Organisations named here

  • Andrej Karpathy
  • Brian Concannon
  • Dan Shipper
  • Kieran Klaassen

Technologies named here

  • Microsoft 365
  • Microsoft Outlook desktop client
  • Huntress

Techniques named here

  • Account takeover via stolen Microsoft 365 session
  • Malicious inbox rule manipulation