CSE Roadmap

Common tier · about 3 hours · 12 parts

Part 4 of 12 · 2 min read

An attacker's goal is a tree of AND and OR steps with a computable probability

Multiplying through every step an attack actually requires turns a vague fear into a number you can argue with.

Think of a heist movie's planning montage. The crew needs the guard's schedule AND the vault combination AND a working getaway car. Miss any one requirement and the whole plan fails. That is exactly how an AND-gate in an attack tree behaves.

An attack tree breaks an attacker's goal into AND steps (every one must succeed) and OR steps (any one succeeding is enough), each leaf carrying a probability and a cost. That means the goal's overall probability is computable exactly, by multiplying through AND gates and combining OR gates, rather than guessed at as "likely" or "unlikely.".

A worked example. The "customer table leaves the company" goal has four OR'd paths. The injection path requires all four of: an attacker plants content the agent reads (0.7), the model obeys the planted instruction (0.3), the agent can read the table (0.9), and the agent can send data outside (0.8) -- multiplying through gives roughly 15.1%. The other three paths (stolen credential, insider reading traces, a vector-index leak) each have their own AND chain. Combined through the OR at the root, the overall goal succeeds 43.3% of the time with no mitigations at all -- a single number built entirely from the tree's own structure and its leaf assumptions.

The key lines. From code/mini-threats/threats.py:

# from code/mini-threats/threats.py
def prob(t, mitigated=frozenset()):
    if t.kind == "LEAF":
        return 0.0 if t.mitigation in mitigated else t.p
    ps = [prob(k, mitigated) for k in t.kids]
    if t.kind == "AND":
        r = 1.0
        for p in ps: r *= p
        return r
    r = 1.0
    for p in ps: r *= 1 - p
    return 1 - r

Read it as: a mitigated leaf's probability is forced to exactly 0.0. That zero then propagates up through every AND it is part of. This is the entire mechanism behind "you don't need to stop the model from being fooled if another step in its AND chain is removed." Zeroing out any one leaf in an AND kills that whole path's contribution. It does not matter how likely the other three leaves in the same chain are.

Attack tree

An attack tree is a goal broken into AND and OR sub-goals down to concrete steps, each with a probability and a cost.

Example: the injection path's four-leaf AND chain, at 0.7 x 0.3 x 0.9 x 0.8 = 15.1%, is the attack tree making a normally vague worry ("could someone poison a web page and get our data out?") into an arithmetic claim that a reader can check leaf by leaf and disagree with on any one number.