Every major security vendor now claims their product is "AI-powered." The phrase has become so common that it communicates almost nothing. What matters is not whether a security product uses machine learning — most do in some form — but what specific problems that machine learning actually solves, and what it does not solve at all.
This article cuts through the marketing to explain what machine learning genuinely contributes to threat detection, where rule-based and signature-based approaches still outperform ML models, and how the most effective security operations programs combine the two rather than treating them as alternatives.
The Core Problem Machine Learning Solves
The fundamental challenge in threat detection is signal-to-noise ratio. A mid-sized enterprise generates hundreds of millions of security events per day — firewall logs, endpoint telemetry, authentication events, network flows, API calls, and application logs. The vast majority of these events are benign. A small fraction represent genuine threats. An even smaller fraction represent active attacks in progress.
Traditional rule-based detection systems — SIEM correlation rules, IDS signatures, firewall ACLs — work well for known attack patterns. If you write a rule for "three failed logins followed by a successful login from the same IP," it will catch that pattern every time. The problem is that it will also catch every legitimate user who fat-fingers their password twice before succeeding, generating thousands of false positives daily that bury the genuine detections in noise.
Machine learning addresses this problem by learning what "normal" looks like for a specific environment and flagging deviations from that baseline. Rather than asking "does this event match a known bad pattern," ML-based detection asks "does this event look unusual compared to everything this entity normally does?" This approach is particularly effective for two categories of threats that rule-based systems struggle with:
- Novel attack techniques. Rule-based systems can only detect what their rules describe. Zero-day exploits, new malware variants, and novel attack chains have no existing signatures. ML models can identify anomalous behavior patterns that suggest an attack even without a specific signature — the attacker doing something unusual with credentials, network connections, or file access, regardless of the specific technique.
- Insider threats and credential compromise. Lateral movement by a compromised insider account looks legitimate to signature-based tools because it uses valid credentials. ML models that understand baseline user behavior can detect when a real account starts behaving unusually — accessing data at odd hours, accessing systems outside their normal pattern, or downloading volumes of data inconsistent with their role.
The Four Core ML Techniques in Threat Detection
1. User and Entity Behavior Analytics (UEBA)
UEBA models establish behavioral baselines for individual users and entities (devices, service accounts, cloud resources) and score deviations from those baselines. A finance analyst who suddenly starts accessing source code repositories at 2 AM triggers an anomaly score. An API key that starts making requests from geographically impossible locations generates an alert.
The technical challenge in UEBA is distinguishing genuine anomalies from routine variation. Baselines must account for seasonality (end-of-quarter data exports are normal for finance teams), role changes, travel, and legitimate exceptions. The most effective UEBA implementations use multiple models in parallel — short-term vs. long-term baselines, peer group comparisons, and contextual signals from HR systems and access management — and require multiple anomalous signals before raising an alert.
2. Anomaly Detection on Network Traffic
Network traffic analysis (NTA) tools apply ML to identify abnormal communication patterns between hosts. Beaconing behavior (malware calling home at regular intervals), data staging before exfiltration (unusual volume of internal data movement), and command-and-control traffic can all be identified through pattern analysis even when the traffic is encrypted.
Encrypted traffic analysis has become particularly important as threat actors increasingly use TLS to obscure C2 communication. ML models trained on TLS handshake metadata, certificate characteristics, and traffic timing patterns can identify malicious encrypted traffic without decrypting it — preserving privacy while maintaining detection capability.
3. Alert Correlation and Attack Chain Detection
Individual security alerts rarely tell a complete story. A failed login attempt, followed by a privilege escalation event, followed by lateral movement to a sensitive system — each event might individually be below the alerting threshold. Combined, they describe an active attack campaign.
Graph-based ML models excel at connecting these dots across time and across different data sources. They build an attack graph that links related events into a coherent narrative, allowing a single analyst to review one consolidated incident rather than three separate low-priority alerts. This is the capability that most dramatically reduces mean time to detect — not by making individual detections faster, but by eliminating the investigation overhead of correlating related events manually.
4. Malware Classification
Static and dynamic malware analysis has been enhanced significantly by ML. Instead of relying purely on hash signatures (which fail immediately for any variant or recompiled malware), ML-based classifiers analyze file structure, API call sequences, behavioral patterns in sandboxes, and code similarity to known malware families. This approach catches variants that have never been seen before but exhibit characteristics consistent with known malware families.
Where ML-Based Detection Fails
Honest assessment of ML-based threat detection requires acknowledging its failure modes. Vendors rarely discuss these in their marketing materials, but understanding them is essential for configuring effective detection programs.
High false positive rates during baseline establishment. ML anomaly detection requires a learning period — typically 30 – 90 days — to establish accurate baselines. During this period, false positive rates are elevated, and organizations must resist the temptation to tune aggressively, which can cause genuine threats to be missed once the model stabilizes.
Adversarial ML evasion. Sophisticated threat actors are aware that their targets use ML-based detection. Slow and low attacks — moving laterally at a rate designed to stay within normal variation thresholds — can evade UEBA models that would catch faster-moving attackers. Nation-state actors in particular have demonstrated sophisticated awareness of how to stay below detection thresholds. ML detection works well against commodity threat actors; against highly targeted, sophisticated attackers, it is one layer of defense, not a guarantee.
Poor performance on infrequent events. ML models learn from data. For events that occur rarely — a CFO accessing the financial consolidation system once a quarter, a DR test that accesses backup systems every six months — there may not be enough historical data to establish a meaningful baseline. These events will either generate false positives or fail to detect genuine anomalies.
Explainability challenges. When a rule-based system triggers an alert, an analyst can immediately understand why: "this IP failed login 50 times." When an ML model triggers an alert, the explanation is often a numerical anomaly score without clear attribution to specific behaviors. This makes analyst investigation harder and can lead to alert fatigue if the model is not well-tuned. The best ML-based detection products invest heavily in explainability — showing analysts exactly which behaviors contributed to the anomaly score.
Building an Effective Detection Stack
The practical answer to "ML vs. rules" is: both, with clearly defined roles for each.
Use signature and rule-based detection for: Known malware, known bad IPs and domains, regulatory compliance violations (specific data patterns like unencrypted SSNs in logs), configuration violations, and any threat where you have a specific, definable pattern to match. These detections should be high-confidence and low-noise — when they fire, an analyst should be able to investigate quickly.
Use ML-based detection for: Insider threats, credential compromise, novel attack techniques, lateral movement, data exfiltration behavior, and any threat that manifests as anomalous behavior rather than a known pattern. Accept higher false positive rates in exchange for detection of threats that rules would miss entirely.
Use attack graph correlation for: Connecting low-confidence signals from both rule-based and ML detections into coherent incident narratives. A single ML anomaly and a single rule-based alert, each below normal alerting thresholds, may together describe a real attack. Correlation should run continuously and produce prioritized incident queues rather than individual alert queues.
Metrics That Actually Matter
Most security teams measure their detection capability by alert volume and closure rate. These metrics are misleading. An alert feed that generates 10,000 alerts per day has not detected 10,000 threats — it has created 10,000 analyst work items, most of which are noise. The metrics that actually measure detection effectiveness are:
- Mean time to detect (MTTD). From the moment an attacker establishes a foothold to the moment your team identifies the incident. Industry median is currently around 20 days; top-quartile teams achieve under 5 days. This is the number that determines breach severity.
- False positive rate at the incident level. Of every escalated incident your team investigates, what percentage turn out to be genuine threats? Below 30% suggests tuning problems; above 70% is excellent for ML-based detection.
- Detection coverage by MITRE ATT&CK technique. Map your detection rules and ML models to ATT&CK techniques and identify gaps. A red team exercise targeting uncovered techniques is the most honest test of your actual detection capability.
- Alert fatigue index. Track analyst sentiment around alert quality through regular surveys and turnover data. A detection stack that produces high alert volume but low analyst engagement will degrade over time as tuning falls behind and critical alerts are missed.
The Analyst Role in an ML-Enhanced SOC
The fear that ML-based detection will eliminate security analyst jobs is not supported by evidence. What changes is the nature of the work. Analysts spend less time on repetitive alert triage and more time on threat hunting, incident investigation, tuning ML models, and building institutional knowledge about attacker behavior in their specific environment.
This shift is actually positive for both security outcomes and analyst retention. The manual alert triage work that dominates lower-maturity SOCs is the primary driver of analyst burnout — reviewing hundreds of alerts per day, most of which are false positives, is cognitively draining and professionally unrewarding. Moving analysts up the stack to work that requires judgment, creativity, and deep knowledge of the environment improves retention while improving the quality of investigation work.
The highest-performing security operations teams treat ML as infrastructure — always running, always learning, always producing inputs for human decision-making — rather than as an autonomous detection engine. The machine does the pattern recognition at scale. The analyst does the contextual reasoning that turns patterns into conclusions.
See AI-driven threat detection in action
ZeroTB correlates signals across endpoints, cloud workloads, and identity providers using ML-based behavioral analytics. Cut your MTTD from days to hours.
Request a Demo