Check whether SIEM detection rules fire by running Atomic Red Team tests

A detection engineer built a LangChain agent that reads a Sentinel rule, runs a matching Atomic Red Team test in a lab VM and files a GitHub issue when the rule misses it.

Done withCustom agentinGitHub· Nov 5, 2026

What they did

Kelvin Santos wanted to know whether the detection rules in his detection-as-code repo really catch the ATT&CK techniques they are mapped to. He built a custom agent with LangChain and gpt-4o-mini, connected to the community Atomic Red Team MCP server. Given a rule, the model searches the existing atomic tests and names the one that matches the technique; it is only allowed to query and run existing atomics, never to generate new attack code. The test runs on an isolated Windows VM built with Terraform, with Sysmon logs shipped to Microsoft Sentinel. Code then asks Sentinel two things for the run window: did any process telemetry arrive at all, and did the rule's own query match. The result is detected, gap (data arrived, rule missed it) or blind (no data at all).

How it went

On a PowerShell encoded-command rule, the first run came back as a gap: the agent picked an atomic that passed encoded arguments with -Command, Sysmon logged it, and the rule stayed quiet because it only looks for -EncodedCommand style flags. A second run picked a different atomic that used -EncodedCommand, and the rule fired, with the scheduled Sentinel rule later raising a real incident. On a gap or blind result the agent opens an issue in the rules repo with the rule, technique, test, time window and query, labelled by type, and skips duplicates by title.

Worth knowing

Each run samples one atomic, so one result says little about the whole technique; the same rule flipped between gap and detected. Techniques without an atomic test cannot be checked this way. The atomics do real and sometimes destructive things, so keep the VM isolated and disposable. The author keeps the decision about what a gap means with a person. The code is on GitHub.

Try it

With Custom agent· 4 parts to fill in

You validate detection rules in [my detection-as-code repo]. For the rule [rule file], read its ATT&CK technique mapping, search the existing Atomic Red Team tests for that technique and pick the one that best matches what the rule claims to catch. Do not write new attack code. Run it only on [my isolated lab VM]. Then query [my SIEM] for the run window: first check whether any process telemetry arrived from that host, then run the rule's own query over the same window. Report detected, gap or blind with the counts. For a gap or blind result, draft an issue with the rule, technique, test, window and queries, and show it to me before filing it.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related