# Paths, chains, graphs and chokepoints

> How edges combine into attack paths, how Keryn finds and grades them, and how a chokepoint tells you where one guard breaks the most.

Source: https://keryn.dev/docs/edges/paths-and-chains/

A finding about one thing says little. A finding on a path says what an attacker could do with it. This page defines the four words Keryn uses for edges in combination.

| Term | Meaning |
|---|---|
| **Chain** | An ordered sequence of edges. |
| **Attack path** | A chain an attacker can follow from an initial condition to a consequence. |
| **Graph** | The nodes and edges of a scope, each edge with its evidence. The evidence graph is its exported form. |
| **Chokepoint** | A path element whose removal, restriction or fix materially disrupts one or more meaningful paths. |

Chain: Web page sends (across a trust boundary), Agent calls, Email tool sends (across a trust boundary), Outside address. A page the agent reads tells it to mail data out. Two boundaries, three edges, one consequence.

## What a path is made of

A path can contain assets, identities, weaknesses, exposures, privileges, data access, trust boundaries, controls, actions, transitions and a consequence. Each material transition should name its supporting evidence or say that it is an assumption. A path that rests mainly on assumptions is not presented as equally grounded to one built from observed evidence.

## How Keryn grades a path

Two scales apply, and they answer different questions.

- **The proof ladder** grades one finding by how much evidence stands behind it, from `proof 1 pattern` a pattern to `proof 5 reproduced` a reproduction. A traced path inside a file is `proof 2 path-in-file` and across files `proof 3 path-cross-file`. See [the proof ladder](https://keryn.dev/docs/concepts/proof-ladder/). A path of several findings is only as grounded as its weakest step.
- **How an edge is known**, in the Trust Canvas: read from code or config (`structured`), a heuristic (`inferred`) or drawn by a person (`stated`). Inferred edges are weak. They are drawn dashed and a search for paths avoids them when it can.

## Finding chains

The Trust Canvas [searches for chains](https://keryn.dev/docs/reference/trust-canvas/#chains) from every untrusted start to every consequential edge: one that changes state, writes, grants, executes or reaches an outside system. It reports each chain with the boundaries it crosses and the strongest recorded guard status along the path. The search is bounded in depth and count and says when a bound was hit, and it is deterministic: the same model gives the same chains.

An authorization requirement keeps the path reachable. The analysis marks a chain guarded when an edge records `PATH_BLOCKED`.

## Chokepoints

When many chains share an element, one guard on it removes all of them. The canvas counts, for each node and edge, how many unguarded chains pass through it, and ranks the edges as Fix first, each with a sentence saying how many chains a guard would break. The count starts where the model's decision starts driving actions, because a control in front of the model does not stop a prompt-injected tool call behind it.

Prefer a fix that removes path structure over one ranked only by the severity of a single finding. A medium finding on the chokepoint can matter more than a high one on a dead end. The ranking is arithmetic about the graph. Whether the consequence is worth guarding is your decision, and the edges behind the ranking are shown so you can disagree.

## Guarding against false paths

A path that looks plausible can be wrong. When reviewing one, challenge:

- transitions that cannot happen;
- identity prerequisites that are missing;
- network reachability that is missing;
- an asset mapped to the wrong thing;
- steps whose timing is incompatible;
- privileges that are assumed and not shown;
- causal links that nobody can point to in the code.

Agentic triage does this at scale for single findings and does not replace it for paths: see [agentic triage](https://keryn.dev/docs/edges/agentic-triage/).

## Path states

The attack path model gives a path one of five states: candidate, grounded, challenged, invalidated, and verified after remediation. Keryn does not store a state per path today. A chain found by the canvas is a candidate. A finding with a [reproduction](https://keryn.dev/docs/concepts/proof-ladder/) is evidence for a grounded step, and the [diff](https://keryn.dev/docs/reference/cli/diff/) of two scans shows what a fix removed.

## Try it

[Model your agent on the Trust Canvas](https://keryn.dev/docs/guides/trust-canvas/) walks through a support agent with three unguarded chains and shows the count fall as guards are recorded.
