Mean time to detect (MTTD) is the average elapsed time between the start of a security incident and the moment the organization first identifies it as a real incident. In incident response and cybersecurity operations, MTTD measures how quickly monitoring, alerting and analysts turn malicious activity into a recognized case, and it is usually reported alongside mean time to respond and mean time to contain.
A short MTTD matters because attacker dwell time drives damage. The longer an intruder operates unnoticed, the more credentials, systems and data the intruder can reach, so detection speed is one of the most direct indicators of defensive maturity that a security operations center can track.
How mean time to detect is calculated
MTTD is calculated by summing the detection intervals of all qualifying incidents in a period and dividing by the number of incidents. Each interval runs from a start timestamp, the earliest evidence of malicious activity, to a detection timestamp, the moment an analyst or automated control confirms that something warrants an incident record.
The start timestamp is often unknown when the incident is opened. It is usually reconstructed afterward through digital forensics, by tracing log entries, endpoint telemetry and network flows back to the first malicious event. As a result, MTTD figures are revised after investigations close, and a dashboard number computed on the day of detection tends to understate the true interval.
The table below lists the timestamps that most incident response teams record and the role each plays in the calculation.
| Timestamp | Typical source | Role in MTTD |
|---|---|---|
| Initial compromise | Forensic reconstruction | Start of the interval |
| First malicious event logged | SIEM or endpoint telemetry | Alternative start when compromise is unclear |
| First alert raised | Detection rule or EDR | Measures tooling latency |
| Incident declared | Ticketing or case system | End of the interval in most programs |
| Containment started | Response records | Starts the response metrics, not MTTD |
A team must document which timestamps it uses, because choosing the first alert instead of incident declaration as the endpoint can shorten the reported value by hours without any real improvement in defense.
MTTD among related incident metrics
MTTD is one stage in a chain of time-based metrics that together describe the incident lifecycle. Detection measures recognition, while the later metrics measure how fast the organization acts after recognition.
The comparison below shows where MTTD sits relative to the metrics that are most often reported with it.
| Metric | Interval measured | Main question answered |
|---|---|---|
| MTTD | Compromise to detection | How long do threats remain unseen |
| Mean time to acknowledge | Alert to analyst pickup | How quickly does the queue move |
| Mean time to respond | Detection to first response action | How fast does the team act |
| Mean time to contain | Detection to containment | How fast is spread stopped |
| Dwell time | Compromise to eviction | How long did the attacker stay |
Dwell time and MTTD are often confused. Dwell time usually ends when the attacker is removed during eradication, so it includes detection and response together, whereas MTTD stops at recognition. In practice, MTTD frequently makes up the largest share of total dwell time, especially for stealthy intrusions.
Factors that shorten or lengthen detection
Detection speed depends mainly on telemetry coverage, detection logic quality and analyst capacity. Gaps in any of these three areas allow activity to pass without an alert or cause valid alerts to wait unread in a queue.
The following table summarizes the factors with the greatest effect on MTTD and the typical direction of that effect.
| Factor | Effect on MTTD | Practical lever |
|---|---|---|
| Log and endpoint coverage | Blind spots lengthen it sharply | Onboard critical assets to the SIEM and EDR |
| Detection rule quality | Precise rules shorten it | Map rules to MITRE ATT&CK techniques |
| Alert volume and noise | Alert fatigue lengthens it | Tune or retire noisy rules |
| Automation | Enrichment shortens triage | Use SOAR for context gathering |
| Proactive threat hunting | Finds quiet intrusions earlier | Schedule hypothesis-driven hunts |
| Staffing model | Off-hours gaps lengthen it | Provide continuous coverage or escalation |
Ransomware and commodity malware are often detected within minutes to hours because they are noisy, whereas targeted espionage campaigns can remain hidden for weeks or months. Published industry surveys report median values that range from days to several months, and those figures vary widely with sample, method and sector, so they serve only as rough context.
Using MTTD in a security program
MTTD is most useful as a trend measured consistently over time rather than as a single headline number. Programs typically report it monthly or quarterly, segmented by incident severity level, attack type and detection source.
- Segment by severity, because a few critical incidents can be hidden by many fast detections of low-impact events.
- Report the median with the mean, since a single long-running intrusion can distort the average.
- Record the detection source for each case, such as internal alert, threat hunt, third-party notification or user report.
- Recalculate after forensics, so the metric reflects the corrected start time rather than the first estimate.
- Validate with exercises, using tabletop exercises and purple team tests to see whether detection meets the target.
Targets should reflect the threat model. A decision table helps match the target to the environment.
| Situation | Reasonable target focus | Reason |
|---|---|---|
| High-value data and mature SOC | Hours for critical incidents | Rapid exfiltration risk justifies investment |
| Small team without 24-hour staffing | Same business day for high severity | Coverage limits make minutes unrealistic |
| Outsourced managed detection | Contractual detection windows | Service agreements define accountability |
| Regulated breach notification | Fast confirmation of reportable events | Notification deadlines start at awareness |
Limitations and common mistakes
The central limitation is that MTTD only counts incidents that were eventually detected. Intrusions that remain undiscovered never enter the calculation, so a low MTTD can coexist with serious undetected compromise. This survivorship bias means the metric must be read together with coverage and hunting results.
A second problem is metric gaming. When teams are rewarded for low MTTD, they may declare incidents earlier with less evidence, choose convenient start timestamps or exclude difficult cases. Clear written definitions and periodic review of incident records reduce this risk.
Finally, MTTD says nothing about detection quality. A fast detection followed by a slow or ineffective containment still produces a damaging incident, which is why the metric belongs inside a broader incident response plan rather than standing alone.
In plain words
Mean time to detect is the answer to a simple question: how long does a break-in go unnoticed. Imagine a store with cameras and alarms. If a thief slips in on Monday and the staff only notices on Friday, the detection time is four days. Averaged across many incidents, that number shows how alert the store really is.
In computer security, the same idea applies to hackers inside a network. The shorter the time, the less harm an attacker can do, because the defenders can start stopping the attack sooner.
A real-world example
A regional hospital network reviewed its incident records for one year and found an average detection time of 19 days. Most delays came from servers that sent no logs to the central monitoring system and from a single analyst who covered alerts only during business hours.
The security team onboarded the missing servers, added endpoint detection to clinical workstations, retired dozens of noisy rules and arranged overnight escalation through a managed provider. Forensic reconstruction was added to every closed case so that start times were accurate.
Over the next twelve months, the median detection time for high-severity incidents fell to under one day, and a credential theft attempt was caught within four hours of the first malicious login, before the attacker reached patient record systems.