---
title: "The Model"
subtitle: "Multi-Stage Attack Graph Simulation Via Markov Chains: the Fundamental Matrix, the assumptions, the solver, and the diagnostic plots"
---
```{r load}
#| include: false
source("R/00_setup.R")
source("R/01_model.R")
source("R/02_robustness.R")
knitr::read_chunk("R/functions.R")
knitr::read_chunk("R/01_model.R")
knitr::read_chunk("R/02_robustness.R")
```
## 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 {#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](#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](https://services.google.com/fh/files/misc/m-trends-2025-en.pdf)). In 56% of Sophos's 2024 cases, adversaries logged in with valid credentials rather than breaking in ([Sophos](https://www.sophos.com/en-us/press/press-releases/2025/04/sophos-report-56-sophos-ir-and-mdr-cases-adversaries-logged-instead)). Valid-credential entry would skip S1 and start at S2 or S3.
```{r show-model-states}
#| eval: false
#| ref.label: !expr c("fn-params", "model-states")
```
## 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.
```{r show-model-solver}
#| eval: false
#| ref.label: !expr c("fn-solver", "model-solver")
```
```{r show-model-jump-chain}
#| eval: false
#| ref.label: !expr c("fn-jump-chain", "model-jump-chain")
```
```{r model-key-values}
#| eval: false
```
## 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.
```{r transition-probability-matrix-plot}
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 `r sprintf("%.2f", P_baseline_raw[1, 7])` at the first stage to `r sprintf("%.2f", P_baseline_raw[6, 7])` 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 (`r sprintf("%.2f", P_baseline_raw[1, 2])` from S1 to S2, `r sprintf("%.2f", P_baseline_raw[2, 3])` S2 to S3, `r sprintf("%.2f", P_baseline_raw[3, 4])` S3 to S4, `r sprintf("%.2f", P_baseline_raw[4, 5])` S4 to S5, `r sprintf("%.2f", P_baseline_raw[5, 6])` 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 `r sprintf("%.2f", P_baseline_raw[1, 7])` at S1 and `r sprintf("%.2f", P_baseline_raw[2, 7])` at S2, and falls to `r sprintf("%.2f", P_baseline_raw[6, 7])` at S6, where the per-step catastrophic probability is `r sprintf("%.2f", P_baseline_raw[6, 8] + P_baseline_raw[6, 9])`. 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](robustness.qmd#one-row-at-a-time-control-sensitivity) 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 `r paste(sprintf("%.2f", a1_share_b), collapse = ", ")` for S1 through S6 under the baseline, and `r paste(sprintf("%.2f", a1_share_h), collapse = ", ")` 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.
```{r expected-time-to-resolution-plot}
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, `r sprintf("%.1f", res$hours_b[1])` hours from S1 against `r sprintf("%.1f", res$hours_b[6])` 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 `r sprintf("%.1f", res$steps_b[1])` steps (`r sprintf("%.1f", res$hours_b[1])` hours) for an attack starting at S1 to `r sprintf("%.1f", res$steps_b[6])` steps (`r sprintf("%.1f", res$hours_b[6])` 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 `r sprintf("%.1f", min(res$hours_b[1:3]))`–`r sprintf("%.1f", max(res$hours_b[1:3]))` hours to `r sprintf("%.1f", min(res$hours_h[1:3]))`–`r sprintf("%.1f", max(res$hours_h[1:3]))` 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 `r sprintf("%.1f", res$hours_b[6])` 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
```{r conditional-time-plot}
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, `r sprintf("%.1f", res$t_cont_b[1])` hours against `r sprintf("%.1f", res$t_cat_b[1])` 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 `r sprintf("%.1f", res$t_cat_b[6])` 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 `r sprintf("%.1f", res$t_cat_b[1])` hours from S1, versus `r sprintf("%.1f", res$t_cont_b[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 `r sprintf("%.0f", res$t_cat_b[1])` 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 {#time-to-outcome-distributions}
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.
```{r show-model-time-distribution}
#| eval: false
#| ref.label: !expr c("fn-time-distribution", "model-time-distribution")
```
```{r time-distribution}
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 `r floor_cat_h`.
**What the plot tells you.** No catastrophic outcome can happen before hour `r floor_cat_h`, 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 `r pct1(p_cat_by_24h)` by hour 24 and levels off at `r pct1(res$cat_b[1])`. Under the improved posture it levels off at only `r pct1(res$cat_h[1])`. 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 `r floor_cat_h` hours. By 24 hours, the probability of a catastrophic outcome is `r pct1(p_cat_by_24h)`, out of a lifetime `r pct1(res$cat_b[1])`.
**An almost fixed schedule.** Conditional on a catastrophic outcome, the 10th, 50th, 90th, and 99th percentiles of time from S1 are `r paste(q_cat_b, collapse = ", ")` hours, with a coefficient of variation of `r sprintf("%.2f", cov_cat_b)`. Conditional on containment, the median and 90th percentile are `r paste(q_cont_b, collapse = " and ")` hours. Each stage is left after one step `r pct1(min(p_leave_first_step))`–`r pct1(max(p_leave_first_step))` 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](https://www.crowdstrike.com/en-us/blog/crowdstrike-2025-global-threat-report-findings/)). 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](https://www.sophos.com/en-us/blog/2025-sophos-active-adversary-report)). Mandiant reports a 2024 median dwell time of 11 days overall and 6 days for ransomware intrusions ([M-Trends 2025](https://services.google.com/fh/files/misc/m-trends-2025-en.pdf)). 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.
```{r terminal-absorption-probability-frontier-plot}
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 `r pct1(res$cont_b[1])` at S1 to `r pct1(res$cont_b[6])` at S6, and at S3, privilege escalation, a catastrophic outcome (`r pct1(res$cat_b[3])`) first becomes more likely than containment. That makes S3 the model's tipping point, although the [uncertainty analysis](robustness.qmd#parameter-uncertainty-dirichlet) 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 `r pct1(res$cont_b[1])` for an attack starting at S1 to `r pct1(res$cont_b[3])` at S3, where catastrophic outcomes (`r pct1(res$cat_b[3])`) first become more likely than containment. This crossing follows directly from the hand-set S2 and S3 rows; the [uncertainty analysis](robustness.qmd#parameter-uncertainty-dirichlet) on the Robustness page shows how stable it is.
**Catastrophic probability rises steeply.** Combined catastrophic probability (A2 plus A3) grows from `r pct1(res$cat_b[1])` at S1 to `r pct1(res$cat_b[5])` at S5 and `r pct1(res$cat_b[6])` at S6.
**The A2/A3 split should not be over-read.** At S5 and S6 the split is roughly even (A2 `r pct1(base_solution$B[5, 2])`–`r pct1(base_solution$B[6, 2])`, A3 `r pct1(base_solution$B[5, 3])`–`r pct1(base_solution$B[6, 3])`), 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.
```{r risk-reduction-frontier-plot}
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 `r sprintf("%.1f", 100 * min(res$cat_b - res$cat_h))` to `r sprintf("%.1f", 100 * max(res$cat_b - res$cat_h))` percentage points. Residual risk is lowest from S1, at `r pct1(res$cat_h[1])`, 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 `r pct1(res$cat_h[6])`. The plot therefore does not show where to invest; the [one-row-at-a-time analysis](robustness.qmd#one-row-at-a-time-control-sensitivity) 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 `r paste0(sprintf("%.1f", 100 * (res$cat_b - res$cat_h)), collapse = ", ")` percentage points for S1 through S6. The largest absolute reductions occur at **`r transient_names[order(res$cat_b - res$cat_h, decreasing = TRUE)[1]]`** and **`r transient_names[order(res$cat_b - res$cat_h, decreasing = TRUE)[2]]`**.
**Why S1 shows the lowest residual risk.** From S1 the catastrophic probability falls from `r pct1(res$cat_b[1])` to `r pct1(res$cat_h[1])`, versus `r pct1(res$cat_b[6])` to `r pct1(res$cat_h[6])` 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](robustness.qmd#one-row-at-a-time-control-sensitivity) on the Robustness page tests that question directly.