AI Detection Engineering: How AI Tunes and Writes Detection Rules
Key takeaways
- AI detection engineering is the use of AI agents to tune detection rules and write new ones, and the term also covers writing detections for AI systems themselves. With the AI Detection Engineering Agent, a rule stays a candidate until a human approves it. The one exception is a rule written because a pentest proved an attack that raised no alert, which deploys automatically or after approval, as the customer chooses.
- Tuning and authoring fix different failures. Tuning narrows an existing rule to cut false positives, which cost precision. Authoring writes a new rule to close a detection gap, which costs recall. An exclusion written in a hurry can turn the first problem into the second.
- Test a rule two ways before approval. A backtest over your own SIEM history shows how often it would have fired, and a simulated attack or replayed pentest logs show that it fires on the technique. Zero hits in a backtest says the rule is quiet, and says nothing about whether it works.
- Detection coverage only counts once it is tested. A technique counts as covered when an attack was run, an alert fired, and the alert was triaged correctly. Fix gaps in dependency order: missing telemetry, then misconfigured controls, then missing rules.
- AI does not replace detection engineers. It takes on the repetitive reading, backtesting, and drafting. People keep approval, decide which gaps matter, and get missing log sources turned on.
On this page
AI Detection Engineering Basics
What is AI detection engineering?
AI detection engineering is the use of AI agents to tune existing detection rules so they throw fewer false positives and to write new rules for attacks that currently raise no alert.
What is agentic detection engineering?
Agentic detection engineering is detection engineering in which an AI agent plans and carries out the steps of tuning and writing detection rules itself, and a person reviews the result.
Is detection engineering the same as threat detection?
No. Detection engineering, which job postings also call threat detection engineering, is the work of building and maintaining detection rules, and threat detection is what those rules do once they are running in production.
What is detection coverage?
Detection coverage is the share of attacker techniques an organization could face that its detection rules would actually alert on.
What is detection gap analysis?
Detection gap analysis is the process of finding the attacker techniques an organization cannot currently detect and working out why.
What is the difference between false positives and detection gaps?
A false positive is an alert that fired on harmless activity, and a detection gap is an attack technique that would raise no alert at all.
What is detection tuning?
Detection tuning is the practice of adjusting an existing detection rule so it fires less on benign activity and keeps firing on the attack it was written for.
What is the difference between visibility and detection coverage in ATT&CK?
MITRE ATT&CK coverage has two layers: visibility means the logs needed to see a technique are being collected, and detection coverage means a rule exists that fires on that technique.
Detection Rule Tuning and Testing
How do you prioritize which detections to build next?
Prioritize which detections to build next by working in dependency order: missing telemetry first, misconfigured controls second, and missing rules last.
How are detection teams validating rules against recent production telemetry before deployment?
Most detection rule validation before deployment is a backtest: the team runs the candidate query over a recent window of logs already stored in the SIEM (security information and event management) system and reads what the rule would have matched.
Does a backtest replace testing with simulated attacks?
No. Detection backtesting measures how often a rule would have fired on your real log history, and a simulated attack proves the rule fires when the technique is run.
How often should detection rules be tuned?
Rule tuning should run on a cadence each team sets from its alert volume, from a review pass every few hours in a SOC (security operations center) with a heavy queue to a weekly pass in a team with a light one.
How should organizations decide whether to tune or disable a detection?
Organizations should tune a detection when the behavior it looks for still matters in their environment and rule tuning can remove the noise without removing the true positives, and disable it when the rule can no longer do its job.
How can security teams reduce false positives without missing real threats?
To get false positive reduction without missing real threats, narrow one detection rule at a time and test each change against past logs in the SIEM (security information and event management) system before it goes live.
What do teams get wrong when they move detections from testing into production?
The most common mistake when moving detections from testing into production is treating the move as a copy-paste, with no approval step, no record of what changed, and no quick way back.
What happens to detections during a SIEM migration?
During a SIEM migration, detections don't carry over: each rule has to be rewritten in the new SIEM (security information and event management) system's query language and mapped to its field names, and any rule left behind stops running at cutover.
How long should it take my SOC to have a detection in production after a new attack technique goes public?
No single figure fits every SOC (security operations center): the time from a new attack technique going public to a detection in production is the sum of five steps, and the telemetry and adaptation steps usually take longest.
Which ATT&CK techniques can I not detect because of the logs I am not collecting?
To find the ATT&CK techniques you can't detect, check log source coverage: list the data each technique needs, then compare that list with what your SIEM (security information and event management) system receives.
AI in Detection Engineering
How do you make detection rule repos consumable by AI agents?
Detection rule repos become consumable by AI agents when each rule file carries its own context, meaning structured metadata and a stated reason for every change.
Should AI agents tune detections without human review?
No. In most environments AI agents should not tune detections without human review.
What are the signs that AI-assisted tuning is failing?
AI-assisted tuning is failing when alert volume keeps dropping and nobody can show that the true positives survived.
What are the risks of using AI-generated detection rules in production?
The main risks of using AI-generated detection rules in production are rules that look correct but never fire, rules that flood the alert queue, and rules nobody on the team can explain later.
Where should AI help in detection engineering?
In detection engineering, AI should help with tuning noisy rules first and drafting new rules second, and that is the safer order for a team starting out with AI detection engineering.
How should security teams govern AI agents that write detections and hunt across tenants?
Security teams that run AI agents across tenants should govern them one tenant at a time: each tenant has its own rules, its own approver, and its own audit trail, and only aggregated results cross the boundary.
How can you tell in system logs when an AI agent is trying to break rules, rather than a human hacker?
In system logs, an AI agent differs from a human attacker mainly in how the session authenticates and how it paces its requests.
What is automated detection engineering?
Automated detection engineering is the practice of having software, increasingly AI agents, carry out the repeatable steps of building and maintaining detection rules while a person keeps the approval decision.
Detection Coverage Metrics
What metrics should organizations use to measure detection rule effectiveness?
The detection engineering metrics that show rule effectiveness are per rule: each rule's true positive and false positive history, read alongside a coverage score across rules.
What is detection engineering maturity?
Detection engineering maturity is a measure of how repeatable and measured a team's detection work is.
Why is recall so hard to measure?
Detection recall is hard to measure because it needs a count of the attacks you missed, and a missed attack leaves no alert to count.
How often should an ATT&CK coverage map be updated?
A MITRE ATT&CK coverage map should be updated every time a detection rule or a log source changes, with a full review whenever MITRE publishes a new ATT&CK version.
How should I report ATT&CK detection coverage to our board?
Report MITRE ATT&CK coverage to a board as one score and its trend, with a short list of the largest gaps and what is being done about each.
How do detection coverage and detection efficacy differ in practice?
Detection coverage, as it is usually counted, says which attacker techniques have a rule mapped to them, and detection efficacy says whether those rules fire on a real attack and stay quiet otherwise.
How many use cases should a SIEM have?
There is no correct number of SIEM use cases, because the count of rules in a SIEM (security information and event management) system says little about which attacks it will catch.
Detection Engineering Tools and Rule Sources
What tools do detection engineers use?
Detection engineering tools come in six kinds: the SIEM (security information and event management) system or EDR (endpoint detection and response) tool that runs the rules, a rule format kept in version control, an attack test library, a coverage map, a source of rule content, and, most recently, AI agents that draft and tune rules.
What role does an EDR/XDR tool play in detection engineering?
In detection engineering, an EDR (endpoint detection and response) or XDR (extended detection and response) tool supplies the endpoint telemetry that many rules depend on, and it is also a place where detection rules run.
When should security teams prioritize building detection infrastructure versus buying it?
Security teams should prioritize building detection infrastructure when they have detection engineers who will maintain it for years and log sources that no product understands, and buy when either of those is missing.
Where do you get reliable detection rules from?
Reliable detection rules come from the rule set that ships with your detection tools, public repositories, paid detection content providers, and rules written from the attacks and logs in your own environment.
How do you prioritize prebuilt detection rules when there are hundreds to choose from?
Prioritize prebuilt detection rules by filtering on the logs you collect first, then on the attacker techniques most likely to be used against you, and enable what is left in small batches.
What's the difference between a detection content vendor's claimed ATT&CK coverage and the coverage actually deployed and validated in my environment?
A vendor's claimed MITRE ATT&CK coverage counts techniques with at least one rule tagged in its library, and validated coverage counts techniques where a rule is enabled in your SIEM (security information and event management) system, has its logs, and has been shown to fire.
Can you do detection engineering without a SIEM?
Yes. Detection engineering needs telemetry, an engine that runs queries against it on a schedule or a stream, and somewhere for the alerts to go, and a SIEM (security information and event management) system is only one way to get those.
How do you store your detection rules?
The most dependable approach to detection rule management, usually called detection as code, is to store each rule as a text file in a version-controlled repository such as Git and deploy to the SIEM (security information and event management) system from there.
Does sending more logs to the SIEM improve detection?
No. Sending more logs to the SIEM (security information and event management) system improves detection only when a rule or an investigation reads those logs, and when they are parsed into fields a query can use.
Detection Engineering Teams and Roles
Does AI replace detection engineers?
No. AI changes what detection engineers spend their time on, but it does not replace them.
Who should own detection engineering when the security stack already has a SIEM and SOC?
Detection engineering should be owned by one named person or a detection engineering team with the authority to change rules in the SIEM (security information and event management) system, and that owner usually sits inside or beside the SOC (security operations center).
How many people does a detection engineering function need?
No headcount formula holds across organizations. The size of a detection engineering team depends on how many rules are live, how many tools they run in, how often log sources change, and how many new rules are expected each quarter.
What is the difference between detection engineering and security operations?
Security operations works the alerts one case at a time, and detection engineering builds and maintains the rules that decide which alerts exist.
How do MSSPs handle fine-tuning detection rules for false positives?
MSSPs (managed security service providers) fine-tune detection rules for false positives by keeping a shared rule set for every client and adding per-client exclusions or thresholds on top when one client's environment makes a rule noisy.
How do MSSPs manage detection coverage gaps across multiple clients?
MSSPs (managed security service providers) manage detection coverage gaps across multiple clients by mapping each client's active rules and log sources to MITRE ATT&CK, the public catalog of attacker techniques, and then comparing those maps side by side.
How should security teams operationalize detection engineering when analysts are already buried in triage work?
Security teams buried in triage should start detection engineering at the handoff: every closed alert and finished hunt leaves a note a rule can be built from, and a fixed weekly block goes to the rules with the most benign closures.
What skills does a detection engineer need?
Detection engineer skills come down to four areas, which are fluency in at least one query language, knowledge of the logs, knowing how attacks look in those logs, and basic software engineering habits.
