What is detection engineering?
Detection engineering is the practice of designing, testing, deploying, and tuning the rules that turn security telemetry into alerts.
Definition
Detection engineering
Also called Detection development, Detection engineer
Detection engineering is the practice of designing, building, testing, deploying, and maintaining the rules and analytics that turn security telemetry into alerts, treated with the rigor of software engineering.
How it works
A detection starts as a hypothesis about attacker behavior, often a MITRE ATT&CK technique, and becomes logic that runs against log data. The engineer checks that the needed telemetry exists, writes the rule, tests it against both malicious activity and normal history, documents how to respond, and deploys it. After deployment, alert outcomes feed back into tuning.
Palantir's Alerting and Detection Strategy (ADS) framework, published after low-quality, undocumented alerts led to fatigue and alerting apathy, makes this explicit. Every alert must complete sections for its goal, categorization, strategy abstract, technical context, blind spots and assumptions, false positives, validation, priority, and response before it reaches production, and each is stored in version control and peer-reviewed. Elastic's public detection-rules repository applies the same thinking with code: rules live in a repository alongside Python tooling for parsing, validating, unit testing, and packaging them.
Example
A threat report describes attackers creating cloud access keys from the console instead of through infrastructure-as-code. The engineer confirms cloud audit logs are collected, writes a rule for key creation outside the deployment pipeline, backtests it against past logs to see how often it would have fired, adds an exclusion for a sanctioned admin workflow, and ships it with a runbook. Cotool's detection page walks through this exact case with a coding agent connected over MCP: the agent searches the logs, creates the detection, tests it over past data, and deploys it.
A sketch of that rule's logic, independent of query language:
match: cloud audit event = CreateAccessKey
where: caller is a human user, not a deployment role
and the request didn't come from the CI/CD pipeline's network
except: break-glass admin accounts with an open change ticket
output: user, key ID, source IP, user agent, recent sign-ins for that user
Useful health measures for a detection library include the share of each rule's alerts that turn out to be true positives, how many rules have fired at all in the last quarter, how many have a validation test that still passes, and how long a noisy rule waits for tuning.
Why it matters for a SOC
Detections decide what the SOC sees. Weak ones miss attacks, and noisy ones bury analysts in false positives. Treating rules as engineered artifacts, versioned, tested, and reviewed, is what detection as code formalizes. The bottleneck is engineer time, which is why some platforms now use agents for the feedback loop. Cotool, for example, writes detections as Python, has agents investigate every alert, and feeds each verdict back into tuning the detection that fired.
Related terms
- Sigma rulesSigma is an open, vendor-neutral format for writing detection rules for log data in YAML, so a rule can be written once, shared, and converted into the query language of whichever SIEM or log platform a team uses.
- MITRE ATT&CKMITRE ATT&CK is a free, publicly maintained knowledge base that catalogs the tactics and techniques attackers use against real systems, based on observed intrusions, and gives defenders a shared vocabulary for detection and threat intelligence.
- False positiveA false positive is a security alert that incorrectly classifies benign activity as malicious, such as a detection firing on an approved admin script or a legitimate login from a new location.
- Purple teamPurple teaming is a collaborative security exercise in which red team attackers and blue team defenders work together, emulating specific adversary behaviors and testing and improving detection and response as they go.
Go deeper
- What is detection as code? Pros, cons, and what comes nextDetection as code keeps SIEM rules in Git, tests them in CI, and ships them through peer review. Its real pros and cons, and when it still fits.
- What is a detection factory?A detection factory turns intel, hunts, and coverage gaps into detections that agents write, backtest, and tune, then ships them only through automated gates.
- Detection engineering with AI agents: write, backtest, version, tuneAI agents can draft, test, and tune detection rules. The engineering work is the replay, labels, and publish gate that decide which rules ship.
- When should a threat hunt become a detection?A decision rule for turning a threat hunt into a detection: repeatability, backtested false positives, data latency, run cost, and severity, plus when to keep it a hunt.
Sources
- GitHub - palantir/alerting-detection-strategy-framework · accessed November 16, 2026
- GitHub - elastic/detection-rules · accessed November 16, 2026
- AI Detection Engineering with Python Detections | Cotool · accessed November 16, 2026
