Multi-Stage Attack Graph Simulation Via Markov Chains: the Fundamental Matrix, the assumptions, the solver, and the diagnostic plots

Mathematical Foundation: The Fundamental Matrix Framework

By organizing all attack states into a standardized matrix, the model separates transient stages (where the attacker is actively maneuvering) from absorbing states (permanent outcomes). Through closed-form matrix inversion, it computes the expected time spent in each stage and the probability of each terminal outcome, conditional on the assumed transition matrix.

Canonical Block Form

Let the state space contain \(t\) transient states and \(r\) absorbing states (\(n = t + r\)). The transition probability matrix \(P \in \mathbb{R}^{n \times n}\) is partitioned into canonical block form:

\[P = \begin{pmatrix} Q & R \\ \mathbf{0} & I_r \end{pmatrix}\]

  • \(Q \in \mathbb{R}^{t \times t}\): Transition probabilities between transient states.
  • \(R \in \mathbb{R}^{t \times r}\): Transition probabilities from transient states into absorbing states.
  • \(\mathbf{0} \in \mathbb{R}^{r \times t}\): Zero matrix (absorbing states cannot transition back to transient states).
  • \(I_r \in \mathbb{R}^{r \times r}\): Identity matrix of order \(r\) (absorbing states are permanent).

The Fundamental Matrix (\(N\))

If every transient state can reach an absorbing state, \((I_t - Q)\) is invertible. The Fundamental Matrix \(N \in \mathbb{R}^{t \times t}\) is:

\[N = (I_t - Q)^{-1} = I_t + Q + Q^2 + Q^3 + \dots = \sum_{k=0}^{\infty} Q^k\]

Each entry \(N_{ij}\) is the expected number of time steps spent in transient state \(j\), given that the attack starts in transient state \(i\). Because \(N = I + Q + \dots\), the starting step counts: \(N_{ii} \ge 1\).


Expected Time to Resolution (\(\mathbf{t}\))

The expected number of steps before the chain is absorbed, from any starting state, is

\[\mathbf{t} = N \mathbf{1}, \qquad t_i = \sum_{j=1}^t N_{ij}\]

This is the expected time to resolution of any kind, including containment. A shorter time to resolution can mean faster containment (good) or faster detonation (bad), so it is not by itself a measure of adversary dwell. Each stage \(j\) has its own mean step duration \(h_j\) (hours), giving

\[\mathbf{T} = N \mathbf{h}\]

In this document every \(h_j = \Delta\tau = 4\) hours, so \(\mathbf{T} = 4\,\mathbf{t}\). The 4-hour step is an assumption. Rescaling hours to a different step is not a valid sensitivity check, because per-step probabilities only have meaning for the step length they were elicited for: a 1-hour step with the same \(P\) would imply a SOC that contains attacks four times faster per hour. A continuous-time formulation (rates per hour) removes this coupling.

The two layers of the model separate cleanly. The absorption probabilities \(B\) depend only on the embedded jump chain, meaning each transient row with its self-loop removed and the remaining entries renormalized. The self-loops and \(\Delta\tau\) affect timing only. The code below verifies this.


Absorption Probabilities (\(B\))

The matrix \(B \in \mathbb{R}^{t \times r}\) gives the probability that an attack starting in transient state \(i\) ends in absorbing state \(k\):

\[B = N R, \qquad \sum_{k=1}^r B_{ik} = 1 \;\; \text{for all } i\]


Conditional Time to Each Outcome

The expected time to resolution, conditional on ending in outcome \(k\), has the closed form

\[E[T \mid \text{start } i,\ \text{absorbed in } k] = \frac{\left(N\,(\mathbf{h} \circ B_{\cdot k})\right)_i}{B_{ik}}\]

where \(\circ\) is the elementwise product. For a catastrophic outcome, \(B_{\cdot k}\) is replaced by \(B_{\cdot A2} + B_{\cdot A3}\). This is the time metric that bears on response timelines, because it separates “time until containment” from “time until a catastrophic outcome, given that one occurs.”

Parameterization and Assumptions

The model has six transient states (kill-chain-style stages) and three absorbing states (outcomes). Transition probabilities are expert-elicited, illustrative values. They are not calibrated to any cited benchmark, and they were typed in by hand: no asset graph, PageRank, CVSS weighting, or loss distribution is computed. Each transient row gives the per-step probability, from a given stage, of staying (self-loop), advancing, regressing, or ending in an absorbing outcome. The baseline and the improved-posture matrices are two hand-set matrices; the improved posture is not derived from any specific control (MFA, EDR, or Zero Trust).

Assumptions that the results depend on:

  • Markov property. “Starting at \(S_i\)” and “having reached \(S_i\)” are treated as identical, and the per-step detection hazard is constant. An attacker who reached \(S_3\) after 30 hours of slow movement has the same future as one who arrived in 4 hours; real detection probability can build up with time and noise.
  • Geometric holding times and a single step length. Each stage has a geometric holding time with a step length of \(\Delta\tau = 4\) hours for all stages. Because the self-loops are small (0.05–0.15), an attacker leaves each stage after a single step 85–95% of the time. The model’s timing is therefore close to deterministic, and no catastrophic outcome can occur in under 16 hours (see Time-to-Outcome Distributions). Real stages differ by orders of magnitude, from sub-hour lateral movement to multi-week dwell, so the implied time scale is a hypothetical, not a benchmark. The per-step probabilities are tied to the 4-hour step, so changing the step without re-eliciting them is not a valid sensitivity check.
  • S1 entry event. S1 begins when a user engages with a phishing lure (opens a malicious attachment, follows a malicious link, or submits credentials), not when a message is delivered. Filtered and ignored messages are outside the model. Under the baseline, 72% of S1 attacks eventually reach S2 (0.65 / 0.90). That is plausible only for this engaged cohort and would be far too high for delivered messages. Time spent in S1 is time to resolution, not dwell time in the industry sense, because the adversary is not yet inside the environment.
  • Outcome space. “Contained / Terminated” (A1) includes automated filtering, user non-engagement, abandoned attacks, and SOC action; it should not be read as “SOC wins.” A2 and A3 are mutually exclusive here, although double extortion (exfiltrate, then encrypt) is common; “catastrophic” counts only the first catastrophic outcome, and the A2/A3 split is not meaningful by itself. A1 is also treated as permanent, although containment is often partial and adversaries can re-enter through persistence or harvested credentials, so containment probabilities are upper bounds on durable containment.
  • Graph structure. Only S5 and S6 can reach A2/A3, and S6 has no regression edge, so catastrophic probability is largely P(reach S5/S6) times the S5/S6 exit split. The single back-edge S4 → S3 (0.05) is an illustrative attacker-backtracking edge with no empirical basis, kept in both regimes. The zeros from S2–S4 into A2 are also a strong claim: data theft from file shares or SaaS does not require domain dominance.
  • Containment share by depth. Conditional on leaving a stage, the share of exits that go to A1 falls from about 0.28–0.29 at S1–S2 to about 0.10–0.11 at S5–S6. That encodes a claim that defenders get worse at stopping attacks as the attacks become noisier. Deep stages usually generate the richest telemetry; what shrinks is the time left to respond. A continuous-time formulation, in which detection and progression are competing rates, can reproduce falling containment at depth without this assumption.
  • Single entry vector. Phishing is the only way in. Exploits were the most common initial infection vector in Mandiant’s 2024 investigations, at 33% (M-Trends 2025). In 56% of Sophos’s 2024 cases, adversaries logged in with valid credentials rather than breaking in (Sophos). Valid-credential entry would skip S1 and start at S2 or S3.
Display code
# Build a 9x9 transition matrix from the rows listed in params.yaml
matrix_from_params <- function(rows, transient, absorbing) {
  all_states <- c(transient, absorbing)
  stopifnot(length(rows) == length(transient), all(lengths(rows) == length(all_states)))
  P <- matrix(0, length(all_states), length(all_states), dimnames = list(all_states, all_states))
  P[transient, ] <- do.call(rbind, map(rows, unlist))
  P[absorbing, absorbing] <- diag(length(absorbing))
  P
}
transient_names <- params$states$transient
absorbing_names <- params$states$absorbing
all_state_names <- c(transient_names, absorbing_names)
t_dim <- length(transient_names)
r_dim <- length(absorbing_names)

# Mean step duration per transient stage (hours); the same for every stage by assumption
step_hours <- setNames(rep(params$step_hours$value, t_dim), transient_names)

# Baseline and improved-posture transition matrices P (9x9), illustrative values from params.yaml
P_baseline_raw <- matrix_from_params(params$transition_matrices$baseline, transient_names, absorbing_names)
P_hardened_raw <- matrix_from_params(params$transition_matrices$improved, transient_names, absorbing_names)

# Every row must be a probability distribution
stopifnot(all(abs(rowSums(P_baseline_raw) - 1) < 1e-8))
stopifnot(all(abs(rowSums(P_hardened_raw) - 1) < 1e-8))

Q_base <- P_baseline_raw[1:t_dim, 1:t_dim]
R_base <- P_baseline_raw[1:t_dim, (t_dim + 1):(t_dim + r_dim)]
Q_hard <- P_hardened_raw[1:t_dim, 1:t_dim]
R_hard <- P_hardened_raw[1:t_dim, (t_dim + 1):(t_dim + r_dim)]

Pure R Algebraic Solver: Fundamental Matrix & Time to Resolution

The solver computes \(N\), expected time to resolution, absorption probabilities, and conditional times to each outcome. Before inverting, it checks that every transient state can reach an absorbing state (which guarantees \(I - Q\) is invertible) and, after computing \(B\), that every row of \(B\) sums to 1.

Display code
# TRUE if every transient state has a path to an absorbing state
all_reach_absorbing <- function(Q, R) {
  reach <- rowSums(R) > 0
  repeat {
    updated <- reach | as.vector((Q > 0) %*% reach) > 0
    if (identical(updated, reach)) break
    reach <- updated
  }
  all(reach)
}

solve_absorbing_markov <- function(Q, R, h) {
  stopifnot(all_reach_absorbing(Q, R))

  N <- solve(diag(nrow(Q)) - Q, tol = 1e-14)
  dimnames(N) <- dimnames(Q)

  B <- N %*% R
  stopifnot(all(abs(rowSums(B) - 1) < 1e-8))

  # Conditional expected time to each outcome: N (h * B_k) / B_k
  time_given_outcome <- apply(B, 2, \(b) as.vector(N %*% (h * b)) / b)
  rownames(time_given_outcome) <- rownames(Q)

  cat_prob <- B[, 2] + B[, 3]
  time_given_catastrophe <- as.vector(N %*% (h * cat_prob)) / cat_prob

  list(
    N = N,
    B = B,
    steps = rowSums(N),
    hours = as.vector(N %*% h) |> setNames(rownames(Q)),
    time_given_outcome = time_given_outcome,
    time_given_catastrophe = setNames(time_given_catastrophe, rownames(Q))
  )
}
base_solution <- solve_absorbing_markov(Q_base, R_base, step_hours)
hard_solution <- solve_absorbing_markov(Q_hard, R_hard, step_hours)
Display code
# B depends only on the embedded jump chain: remove self-loops and renormalize
jump_chain <- function(P) {
  for (i in seq_len(t_dim)) {
    s <- P[i, i]
    P[i, i] <- 0
    P[i, ] <- P[i, ] / (1 - s)
  }
  P
}
J_base <- jump_chain(P_baseline_raw)
B_jump <- solve_absorbing_markov(
  J_base[1:t_dim, 1:t_dim], J_base[1:t_dim, (t_dim + 1):(t_dim + r_dim)], step_hours
)$B
stopifnot(max(abs(B_jump - base_solution$B)) < 1e-10)

# Depth diagnostics used in the text
holding_steps_b <- 1 / (1 - diag(Q_base))
p_leave_first_step <- 1 - diag(Q_base)
a1_share_b <- P_baseline_raw[1:t_dim, t_dim + 1] / (1 - diag(Q_base))
a1_share_h <- P_hardened_raw[1:t_dim, t_dim + 1] / (1 - diag(Q_hard))
stopifnot(round(range(a1_share_b), 2) == c(0.11, 0.29))
Display code
# One row per starting stage; prose numbers on every page are drawn from this table
res <- tibble(
  stage = transient_names,
  steps_b = base_solution$steps,
  hours_b = base_solution$hours,
  hours_h = hard_solution$hours,
  cont_b = base_solution$B[, 1],
  cont_h = hard_solution$B[, 1],
  cat_b = base_solution$B[, 2] + base_solution$B[, 3],
  cat_h = hard_solution$B[, 2] + hard_solution$B[, 3],
  uplift = cont_h - cont_b,
  t_cont_b = base_solution$time_given_outcome[, 1],
  t_cat_b = base_solution$time_given_catastrophe
)

# First stage where catastrophic outcomes are more likely than containment
cross_stage <- which(res$cat_b > res$cont_b)[1]

# Guards for numbers quoted as static text
stopifnot(
  round(res$hours_b[1], 1) == 14.2, round(res$hours_b[6], 1) == 4.2,
  round(100 * res$cat_b[3], 1) == 52.9, round(100 * res$cont_b[3], 1) == 47.1,
  round(100 * res$cont_b[1], 1) == 72.5, round(100 * res$cont_h[1], 1) == 97.3,
  round(100 * res$uplift[1], 1) == 24.8, cross_stage == 3,
  round(100 * res$cat_b[1], 1) == 27.5
)

# Guards for static numbers quoted in Parameterization and Assumptions
stopifnot(
  isTRUE(all.equal(range(diag(Q_base)), c(0.05, 0.15))),
  isTRUE(all.equal(range(1 - diag(Q_base)), c(0.85, 0.95))),
  round(P_baseline_raw[1, 2] / (1 - P_baseline_raw[1, 1]), 2) == 0.72
)

Diagnostic Visualizations & Outcome Decomposition

The diagnostic plots below show the routing structure of the transition matrix, the expected time to resolution from each starting stage, the conditional time to each outcome, the baseline absorption probabilities, and the change in catastrophic probability under the improved posture.


The Transition Probability Matrix (P) plot

The heatmap shows the main paths an intrusion can take under the assumed parameters and where the per-step exit probabilities sit.

Display code
matrix_df <- as.data.frame(P_baseline_raw) |>
  rownames_to_column(var = "From_State") |>
  pivot_longer(cols = -From_State, names_to = "To_State", values_to = "Probability") |>
  mutate(
    Fill_Prob = if_else(From_State %in% absorbing_names, NA_real_, Probability),
    From_State = factor(From_State, levels = rev(all_state_names)),
    To_State = factor(To_State, levels = all_state_names)
  )

p1_heatmap <- ggplot(matrix_df, aes(x = To_State, y = From_State, fill = Fill_Prob)) +
  geom_tile(color = "white", linewidth = 0.5) +
  geom_text(aes(label = ifelse(Probability > 0, sprintf("%.2f", Probability), "")), size = 3.2) +
  scale_fill_gradient(
    low = "#f8f9fa", high = "#d9534f",
    limits = c(0, max(P_baseline_raw[1:t_dim, ])),
    na.value = "#e9ecef", name = "P(Transition)"
  ) +
  labs(
    title = "Kill-Chain Transition Probability Matrix (P)",
    subtitle = "Illustrative baseline; absorbing rows (identity) shown in gray and excluded from the color scale",
    x = "Target State (t + 1)",
    y = "Origin State (t)"
  ) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8.5),
        axis.text.y = element_text(size = 8.5))

p1_heatmap

How to read the plot. Each row is where an attacker is now, and each column is where they can be one 4-hour step later. The number in a cell is the assumed chance of that move, and darker red means more likely; each row adds up to 1. The first six columns are attack stages, A1 is containment, and A2 and A3 are data theft and ransomware. The gray rows at the bottom are final outcomes, which never change once reached.

What the plot tells you. Most of the weight sits just right of the diagonal, so an attacker who is not stopped usually moves one stage deeper at each step. The chance of containment in a single step falls from 0.25 at the first stage to 0.10 at the last, and catastrophic outcomes are possible only from the last two stages. These numbers are assumed inputs, not measurements, and every other result on this site follows from them.

In more detail

Directional momentum. The super-diagonal carries the largest transient-to-transient probabilities (0.65 from S1 to S2, 0.55 S2 to S3, 0.60 S3 to S4, 0.55 S4 to S5, 0.70 S5 to S6), so under these parameters an attack that is not stopped keeps advancing.

Per-step exit probabilities to A1. The per-step probability of ending in \(A_1\) is 0.25 at S1 and 0.25 at S2, and falls to 0.10 at S6, where the per-step catastrophic probability is 0.85. These are assumed inputs, not findings, so they cannot by themselves show where defensive investment pays off most; the one-row-at-a-time analysis on the Robustness page addresses that question.

Containment share falls with depth by assumption. Conditional on leaving a stage, the probability that the exit is A1 is 0.28, 0.29, 0.22, 0.18, 0.11, 0.11 for S1 through S6 under the baseline, and 0.58, 0.56, 0.53, 0.44, 0.37, 0.37 under the improved posture. This encodes a claim that defenders get worse at stopping attacks as they become noisier. In practice, lateral movement, credential access, and payload staging generate the richest telemetry; what shrinks at depth is the time left to respond, not necessarily the probability of detection.


The Expected Time to Resolution Plot

The expected time to resolution is the expected time until the incident ends in any outcome, including containment. It is not adversary dwell time: a shorter value can reflect faster containment or faster detonation.

Display code
ttr_df <- res |>
  select(Origin_State = stage, Baseline = hours_b, Improved = hours_h) |>
  pivot_longer(cols = c(Baseline, Improved), names_to = "Architecture", values_to = "Hours") |>
  mutate(
    Origin_State = factor(Origin_State, levels = transient_names),
    Architecture = recode(Architecture,
      Baseline = "Baseline (illustrative)",
      Improved = "Improved posture (illustrative)"
    )
  )

p2_ttr <- ggplot(ttr_df, aes(x = Origin_State, y = Hours, fill = Architecture)) +
  geom_col(position = position_dodge(width = 0.8), width = 0.7) +
  geom_text(aes(label = sprintf("%.1fh", Hours)), position = position_dodge(width = 0.8), vjust = -0.4, size = 3) +
  scale_fill_manual(values = c("Baseline (illustrative)" = "#d9534f", "Improved posture (illustrative)" = "#0275d8")) +
  scale_y_continuous(expand = expansion(mult = c(0, 0.15))) +
  labs(
    title = "Expected Time to Resolution",
    subtitle = "Expected steps to any terminal outcome from each starting stage, times an assumed 4-hour step",
    x = "Attack Origin State",
    y = "Expected Hours (4h / Step)"
  ) +
  theme(axis.text.x = element_text(angle = 35, hjust = 1, size = 8.5))

p2_ttr

How to read the plot. Each pair of bars is a starting stage, from S1 on the left to S6 on the right. The height of a bar is the expected number of hours until the incident ends in any way, whether contained or catastrophic. Red bars are the baseline and blue bars the improved posture, and the label on each bar gives its value. Hours are the expected number of steps multiplied by the assumed 4 hours per step.

What the plot tells you. Incidents end sooner the deeper the attack starts: under the baseline, 14.2 hours from S1 against 4.2 hours from S6, partly because fewer stages remain. The improved posture ends incidents sooner, mainly by containing them earlier. A shorter time is not automatically good news, though: it can mean faster containment or a faster catastrophe, and this plot cannot tell the two apart.

In more detail

Time to resolution shortens with depth. Under the baseline, expected time to resolution falls from 3.5 steps (14.2 hours) for an attack starting at S1 to 1.1 steps (4.2 hours) at S6. Part of this is mechanical, since there are fewer stages left to traverse; part is outcome mix.

The improved posture shortens it mainly through earlier containment. From S1 through S3 the improved posture lowers the expected time to resolution from 12.6–14.2 hours to 7.6–7.9 hours, but the plot cannot separate faster containment (good) from faster detonation (bad); the conditional times below can.

The S6 values are identical by construction. The baseline and improved S6 rows share the same self-loop (0.05), so S6 shows 4.2 hours in both regimes. This is a parameter choice, not a finding about late-stage defense.


Conditional Time to Containment versus Time to a Catastrophic Outcome

Display code
cond_df <- bind_rows(
  tibble(Regime = "Baseline", Origin_State = transient_names,
         Contained = base_solution$time_given_outcome[, 1],
         Catastrophic = base_solution$time_given_catastrophe),
  tibble(Regime = "Improved posture", Origin_State = transient_names,
         Contained = hard_solution$time_given_outcome[, 1],
         Catastrophic = hard_solution$time_given_catastrophe)
) |>
  pivot_longer(cols = c(Contained, Catastrophic), names_to = "Outcome", values_to = "Hours") |>
  mutate(
    Origin_State = factor(Origin_State, levels = transient_names),
    Regime = factor(Regime, levels = c("Baseline", "Improved posture"))
  )

p_cond <- ggplot(cond_df, aes(x = Origin_State, y = Hours, fill = Outcome)) +
  geom_col(position = position_dodge(width = 0.8), width = 0.7) +
  geom_text(aes(label = sprintf("%.1fh", Hours)), position = position_dodge(width = 0.8), vjust = -0.4, size = 2.8) +
  facet_wrap(~Regime) +
  scale_fill_manual(values = c(Contained = "#5cb85c", Catastrophic = "#d9534f")) +
  scale_y_continuous(expand = expansion(mult = c(0, 0.15))) +
  labs(
    title = "Expected Time to Outcome, Conditional on That Outcome",
    subtitle = "E[T | start i, absorbed in outcome], assuming a 4-hour step",
    x = "Attack Origin State",
    y = "Expected Hours"
  ) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8))

p_cond

How to read the plot. Each pair of bars is a starting stage, and the two panels compare the baseline with the improved posture. The green bar is the expected time until the attack is contained, counting only attacks that end contained. The red bar is the expected time until data theft or ransomware, counting only attacks that end that way. Times are in hours at an assumed 4 hours per step, and the labels give each value.

What the plot tells you. Containment, when it happens, comes sooner than catastrophe: from S1 under the baseline, 10.1 hours against 25.0 hours. The red bars matter most for a response plan, because they show roughly how long defenders have before an unstopped attack does serious damage. They shrink with depth, to 4.2 hours at S6. The hours follow from the assumed step length, not from observed attacks.

In more detail. Conditional on ending in a catastrophic outcome, the baseline expected time to that outcome is 25.0 hours from S1, versus 10.1 hours to containment. The metric that bears on a response timeline is the first: under these assumptions, an attack that starts at phishing delivery and goes on to a catastrophic outcome takes about 25 hours to get there. This figure scales linearly with the assumed 4-hour step and rests on the memoryless assumption.


Time-to-Outcome Distributions and the Structural Floor

Means hide the shape of the timing. The cumulative incidence function (CIF) for outcome \(k\), starting from stage \(i\), is the probability that the attack has ended in \(k\) by step \(s\):

\[\mathrm{CIF}_k(s) = \sum_{u=0}^{s-1} \mathbf{e}_i^\top Q^u R_{\cdot k}\]

It is exact in closed form from matrix powers, with no simulation needed.

Display code
# Probability of absorption into each outcome at each step, by matrix powers
outcome_pmf <- function(Q, R, start = 1, max_steps = 200) {
  x <- replace(numeric(nrow(Q)), start, 1)
  out <- matrix(0, max_steps, ncol(R), dimnames = list(NULL, colnames(R)))
  for (s in seq_len(max_steps)) {
    out[s, ] <- as.vector(x %*% R)
    x <- as.vector(x %*% Q)
  }
  out
}
stopifnot(length(unique(step_hours)) == 1)

pmf_b <- outcome_pmf(Q_base, R_base, start = 1)
pmf_h <- outcome_pmf(Q_hard, R_hard, start = 1)
hours_grid <- seq_len(nrow(pmf_b)) * unname(step_hours[1])

cat_pmf_b <- pmf_b[, 2] + pmf_b[, 3]
cond_cat_b <- cat_pmf_b / sum(cat_pmf_b)
cond_cont_b <- pmf_b[, 1] / sum(pmf_b[, 1])
q_at <- function(cond, p) hours_grid[which(cumsum(cond) >= p - 1e-12)[1]]
q_cat_b <- map_dbl(c(0.10, 0.50, 0.90, 0.99), \(p) q_at(cond_cat_b, p))
q_cont_b <- map_dbl(c(0.50, 0.90), \(p) q_at(cond_cont_b, p))
floor_cat_h <- hours_grid[which(cat_pmf_b > 0)[1]]
mean_cat_b <- sum(hours_grid * cond_cat_b)
sd_cat_b <- sqrt(sum((hours_grid - mean_cat_b)^2 * cond_cat_b))
cov_cat_b <- sd_cat_b / mean_cat_b
p_cat_by_24h <- sum(cat_pmf_b[hours_grid <= 24])

# Consistency with the closed form, and guards for numbers quoted as static text
stopifnot(abs(mean_cat_b - res$t_cat_b[1]) < 1e-6)
stopifnot(abs(sum(pmf_b) - 1) < 1e-8)
stopifnot(floor_cat_h == 16, round(res$t_cat_b[1], 1) == 25.0)
Display code
cif_df <- bind_rows(
  tibble(Regime = "Baseline", Hours = hours_grid,
         Contained = cumsum(pmf_b[, 1]), Catastrophic = cumsum(pmf_b[, 2] + pmf_b[, 3])),
  tibble(Regime = "Improved posture", Hours = hours_grid,
         Contained = cumsum(pmf_h[, 1]), Catastrophic = cumsum(pmf_h[, 2] + pmf_h[, 3]))
) |>
  bind_rows(tibble(Regime = c("Baseline", "Improved posture"), Hours = 0, Contained = 0, Catastrophic = 0)) |>
  pivot_longer(c(Contained, Catastrophic), names_to = "Outcome", values_to = "CIF") |>
  filter(Hours <= 60) |>
  arrange(Regime, Outcome, Hours)

p_cif <- ggplot(cif_df, aes(x = Hours, y = CIF, color = Outcome)) +
  geom_step(linewidth = 1) +
  geom_vline(xintercept = floor_cat_h, linetype = "dashed", color = "gray40") +
  facet_wrap(~Regime) +
  scale_color_manual(values = c(Contained = "#5cb85c", Catastrophic = "#d9534f")) +
  scale_y_continuous(labels = percent_format(), limits = c(0, 1)) +
  scale_x_continuous(breaks = seq(0, 60, 8)) +
  labs(
    title = "Cumulative Incidence of Each Outcome, Attack Starting at S1",
    subtitle = sprintf("P(outcome reached by hour t); dashed line = structural floor of %d h for any catastrophic outcome (4-hour step)", floor_cat_h),
    x = "Hours since start (4-hour steps)",
    y = "Cumulative incidence"
  )

p_cif

How to read the plot. Each line shows, for an attack that starts at S1, the chance that it has ended in a given way by a given hour. The green line is containment and the red line a catastrophic outcome (data theft or ransomware); the left panel is the baseline and the right the improved posture. The lines climb in steps because the model moves in 4-hour steps. The dashed line marks hour 16.

What the plot tells you. No catastrophic outcome can happen before hour 16, because the shortest route to one takes four 4-hour steps; this floor comes from the model’s design, not from attacker behavior. Under the baseline, the chance of catastrophe reaches 17.9% by hour 24 and levels off at 27.5%. Under the improved posture it levels off at only 2.7%. Real attacks can move much faster or slower than this fixed schedule allows.

In more detail

A hard floor. The chain moves one edge per 4-hour step, and the shortest path to a catastrophic outcome from S1 (S1 → S2 → S4 → S6 → A3) has four edges. No catastrophic outcome can therefore occur before 16 hours. By 24 hours, the probability of a catastrophic outcome is 17.9%, out of a lifetime 27.5%.

An almost fixed schedule. Conditional on a catastrophic outcome, the 10th, 50th, 90th, and 99th percentiles of time from S1 are 20, 24, 32, 40 hours, with a coefficient of variation of 0.19. Conditional on containment, the median and 90th percentile are 8 and 20 hours. Each stage is left after one step 85.0%–95.0% of the time, so time to catastrophe is close to (number of stages traversed) × 4 hours.

Benchmarks fall outside this range on both sides. The average eCrime breakout time, from the first compromised host to another, was 48 minutes in 2024 (CrowdStrike 2025 Global Threat Report). Sophos reports a median of 11 hours from an attacker’s initial action to the first attempt on Active Directory (Sophos 2025 Active Adversary Report). Mandiant reports a 2024 median dwell time of 11 days overall and 6 days for ransomware intrusions (M-Trends 2025). The discrete 4-hour chain can represent neither the sub-hour tail nor the multi-week tail, so its time outputs should be read as a restatement of the step assumption.


The Baseline Terminal Absorption Frontier Plot

The plot decomposes the final outcome of an attack by starting stage, under the baseline parameters.

Display code
absorb_df <- as.data.frame(base_solution$B) |>
  rownames_to_column(var = "Origin_State") |>
  pivot_longer(cols = -Origin_State, names_to = "Absorbing_Outcome", values_to = "Probability") |>
  mutate(
    Origin_State = factor(Origin_State, levels = transient_names),
    Absorbing_Outcome = factor(Absorbing_Outcome, levels = absorbing_names)
  )

p3_frontier <- ggplot(absorb_df, aes(x = Origin_State, y = Probability, fill = Absorbing_Outcome)) +
  geom_col(width = 0.7) +
  geom_text(aes(label = sprintf("%.1f%%", Probability * 100)),
            position = position_stack(vjust = 0.5), size = 3.2, color = "white", fontface = "bold") +
  scale_fill_manual(
    values = setNames(c("#5cb85c", "#f0ad4e", "#d9534f"), absorbing_names)
  ) +
  scale_y_continuous(labels = percent_format()) +
  labs(
    title = "Baseline Terminal Absorption Frontier",
    subtitle = "Decomposition of final incident outcomes by starting stage (illustrative parameters)",
    x = "Attack Origin State",
    y = "Absorption Probability (%)",
    fill = "Terminal State"
  ) +
  theme(axis.text.x = element_text(angle = 35, hjust = 1, size = 8.5))

p3_frontier

How to read the plot. Each bar is a starting stage, and its colored segments show how attacks starting there end under the baseline. Green is containment, orange is data exfiltration, and red is ransomware. Each bar adds up to 100%, and the labels give each share. Reading from left to right shows how the final outcome changes the deeper into the network an attack starts. These are shares across many hypothetical attacks, not a forecast for any single incident.

What the plot tells you. The deeper the starting point, the worse the outcome. Containment falls from 72.5% at S1 to 10.5% at S6, and at S3, privilege escalation, a catastrophic outcome (52.9%) first becomes more likely than containment. That makes S3 the model’s tipping point, although the uncertainty analysis shows the exact stage is not certain. The split between data theft and ransomware is itself an assumption.

In more detail

Containment declines with depth. Under the baseline parameters, the probability of ending in \(A_1\) falls from 72.5% for an attack starting at S1 to 47.1% at S3, where catastrophic outcomes (52.9%) first become more likely than containment. This crossing follows directly from the hand-set S2 and S3 rows; the uncertainty analysis on the Robustness page shows how stable it is.

Catastrophic probability rises steeply. Combined catastrophic probability (A2 plus A3) grows from 27.5% at S1 to 80.7% at S5 and 89.5% at S6.

The A2/A3 split should not be over-read. At S5 and S6 the split is roughly even (A2 38.3%–42.1%, A3 42.4%–47.4%), but A2 and A3 are modeled as mutually exclusive, whereas double extortion is common in practice. In the improved-posture matrix, A2 equals A3 at S5 and S6 because the two columns were assigned identical values, which shows the split is a parameter choice.


The Catastrophic Breach Risk Under an Improved Posture

The plot contrasts baseline catastrophic probability with the illustrative improved posture. The improved-posture matrix changes all six rows at once, so differences across starting stages reflect where the attacker begins, not where a control is applied.

Display code
comparison_df <- res |>
  transmute(
    Origin_State = factor(stage, levels = transient_names),
    Baseline_Catastrophic = cat_b * 100,
    Hardened_Catastrophic = cat_h * 100
  )

p4_reduction <- ggplot(comparison_df, aes(x = Origin_State)) +
  geom_segment(aes(xend = Origin_State, y = Hardened_Catastrophic, yend = Baseline_Catastrophic),
               color = "gray60", linewidth = 1) +
  geom_point(aes(y = Baseline_Catastrophic, color = "Baseline"), size = 3.5) +
  geom_point(aes(y = Hardened_Catastrophic, color = "Improved posture"), size = 3.5) +
  scale_color_manual(values = c("Baseline" = "#d9534f", "Improved posture" = "#0275d8"), name = "Posture") +
  scale_y_continuous(labels = function(x) paste0(x, "%")) +
  labs(
    title = "Catastrophic Breach Probability: Baseline vs. Improved Posture",
    subtitle = "Probability of terminal ransomware or exfiltration, by starting stage (illustrative parameters)",
    x = "Attack Origin State",
    y = "Combined Catastrophic Probability (%)"
  ) +
  theme(axis.text.x = element_text(angle = 35, hjust = 1, size = 8.5))

p4_reduction

How to read the plot. Each column is a starting stage. The red dot is the chance that an attack starting there ends in data theft or ransomware under the baseline, and the blue dot is the same chance under the improved posture. The gray line between them shows the size of the reduction, so a shorter line means a smaller benefit at that stage. The vertical axis is in percent, and both postures use the same illustrative model.

What the plot tells you. The improved posture lowers the chance of catastrophe from every starting stage, by 24.8 to 40.5 percentage points. Residual risk is lowest from S1, at 2.7%, but that is partly built in: an attack starting at S1 must pass through all six improved stages. Residual risk is highest from S6, at 63.2%. The plot therefore does not show where to invest; the one-row-at-a-time analysis addresses that.

In more detail

Lower catastrophic probability at every stage. By construction, the improved posture (blue) lowers combined catastrophic probability relative to the baseline (red) from every starting stage.

Where the absolute reductions are largest. The reductions in catastrophic probability are 24.8, 31.6, 39.9, 40.5, 36.9, 26.3 percentage points for S1 through S6. The largest absolute reductions occur at S4: Lateral Movement and S3: Privilege Escalation.

Why S1 shows the lowest residual risk. From S1 the catastrophic probability falls from 27.5% to 2.7%, versus 89.5% to 63.2% from S6. This is guaranteed by the setup: an attacker starting at S1 passes through all six hardened rows, one starting at S6 only through the last. It is not evidence that upstream investment has greater leverage. The one-row-at-a-time analysis on the Robustness page tests that question directly.