Mean Time to Detect (MTTD) is a familiar metric in traditional security operations, but applying it to AI agents requires more precision than the conventional definition provides. An agent does not simply trigger a signature-based alert. It reasons, calls tools, and produces outputs across multiple systems, often within seconds. A defensible MTTD figure depends on deciding, in advance, exactly what counts as the beginning of an incident and exactly what counts as its detection.
Why MTTD Needs Rethinking for AI Agents
Traditional MTTD assumes a relatively discrete triggering event: a malicious login, a malware signature, an unusual network connection. AI agents behave differently. Their actions unfold across a chain of reasoning steps, tool calls, and outputs, and a policy violation may not resemble any known signature. It may instead look like a subtle deviation from expected behavior, such as an agent accessing a data source outside its normal scope or invoking a tool it has never used before.
This means MTTD for agents cannot rely solely on matching known bad patterns. It must account for behavioral baselines and the possibility that the first sign of a problem is buried inside a sequence of otherwise ordinary-looking actions.
What You Need to Capture Before You Can Calculate Anything
Before any MTTD figure can be trusted, the underlying telemetry has to be complete and consistently timestamped. At minimum, this means instrumented logging across four layers of agent activity:
- Input layer: the prompts, instructions, and data the agent receives.
- Reasoning layer: the intermediate steps or decisions the agent takes, where available.
- Tool-call layer: every external action, API call, or system the agent invokes.
- Output layer: the final response, action, or artifact the agent produces.
Without logs at each of these layers, it is difficult to identify where a deviation actually began. Just as importantly, timestamps across all of these systems need to be synchronized. Agents frequently touch multiple platforms in a single task, and clock drift between systems can distort an MTTD calculation before the analysis even starts.
Defining the Start Event: The Hardest Part of the Exercise
The single most consequential decision in any MTTD methodology is defining the start event. Unlike a malware signature match, an agent's first sign of anomalous behavior is often ambiguous. Organizations need a documented, specific taxonomy that defines what qualifies as a start event for their environment, for example:
- The first unauthorized or out-of-scope tool call.
- The first instruction that conflicts with a defined policy.
- The first output containing data the agent should not have accessed.
- The first deviation from an established behavioral baseline.
Without a documented taxonomy, teams end up defining the start event retroactively, after an incident, which introduces inconsistency and makes MTTD figures difficult to compare across incidents or over time.
Detection Logic: Behavioral Deviation, Not Signature Matching
Because agent behavior rarely matches a known bad pattern, detection logic has to be built around behavioral deviation rather than static signatures. This typically means establishing a baseline of expected agent behavior (which tools it normally calls, which data it normally accesses, what kinds of outputs it typically produces) and alerting when activity falls outside that baseline.
This approach introduces a tradeoff. Behavioral detection is more likely to catch novel forms of policy violation, but it also requires a well-tuned baseline to avoid excessive false positives. Detection logic that is too loose will miss genuine incidents; logic that is too strict will generate alert fatigue and slow down analyst response, which in turn inflates MTTD.
Building a Repeatable MTTD Measurement Process
A repeatable process for calculating MTTD generally follows these steps:
- Confirm that logging is in place across the input, reasoning, tool-call, and output layers, with synchronized timestamps.
- Apply the documented start-event taxonomy to identify the first log evidence of anomalous or policy-violating behavior for a given incident.
- Identify the detection event: the timestamp of the automated alert or the point at which an analyst confirmed the behavior.
- Calculate the elapsed time between the start event and the detection event.
- Record both timestamps, the reasoning used to identify the start event, and any relevant context, so the calculation can be audited later.
- Repeat consistently across incidents and test cases to build a trend line rather than relying on a single data point.
Consistency matters more than precision on any single incident
A single MTTD measurement tells you little. The value of the metric comes from applying the same start-event taxonomy and detection logic consistently across incidents, so that trends and regressions become visible over time.
Tradeoffs and Open Gaps to Acknowledge
Any MTTD methodology for AI agents involves acknowledged tradeoffs. Reasoning-layer logging is not available for every agent architecture, which can leave a gap between the input and tool-call layers where anomalous behavior could originate undetected. Behavioral baselines require ongoing tuning as agents are updated or repurposed, and a baseline that was accurate at deployment may drift out of date. Finally, start-event taxonomies are inherently judgment calls; two teams applying the same taxonomy to an ambiguous incident may reach different conclusions about when the clock should have started.
These gaps do not invalidate the metric. They simply mean that MTTD for AI agents should be treated as a directional, trend-based measure rather than a precise, universally comparable number.
Where Runtime Governance Fits
Consistent MTTD measurement depends on infrastructure that most organizations have to build deliberately: structured logging across every layer of agent activity, synchronized timestamps across systems, documented start-event definitions, and policy enforcement that can generate reliable detection events. Runtime governance for AI agents is designed to provide this structural foundation, giving security and engineering teams the instrumentation needed to calculate MTTD consistently rather than reconstructing it after each incident.