Threat Modeling Compound AI Systems › Step 4: Reason about failure propagation

Michael BrenndoerferDecember 2, 20264 min read
Language AI HandbookAll chapters
Part 61 of 67Agentic AI and Protocol Security
Chapter 465Threat Modeling Compound AI Systems › Step 4: Reason about failure propagation
Reading section 8 of 15 · Step 4: Reason about failure propagation · 4 minSection 8 of 15 · 4 min

Section 8 of 15 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Write down the earliest point at which each assumption can fail, then follow the resulting data to the next boundary. A stale location begins in the catalog. Projecting fewer fields still passes the location through, and a comparison against the same stale source still agrees. The data owner needs a way to correct the catalog. If the system tracks when a location was verified, the application can check that provenance or return an unavailable result.

Now consider visibility. An unexpected field in a record response is a concern before model input is built. Both designs below use explicit projections, and neither projection includes the staff note. Another component can still mishandle it between retrieval and the projection. Review the retrieval service and intermediate application handling separately. In this example the staff note reaches the application, so testing only model exposure cannot establish that the note stayed out of application telemetry.

PythonIn [8]
CollapseExpand
@dataclass(frozen=True)
class FieldSet:
    public_fields: tuple[str, ...]


full_public = FieldSet(("title", "room", "shelf"))
location_only = FieldSet(("room", "shelf"))
PythonIn [9]
CollapseExpand
def project(record: CatalogRecord, fields: FieldSet) -> dict[str, str]:
    available = {
        "title": record.title,
        "room": record.room,
        "shelf": record.shelf,
    }
    return {field: available[field] for field in fields.public_fields}


public_context = project(record, full_public)
location_context = project(record, location_only)
assert (
    "staff_note" not in public_context and "staff_note" not in location_context
)
assert project(record, FieldSet(())) == {}

The available-field dictionary above defines the allowlist. Selecting an unlisted field raises an error. Empty selection produces an empty dictionary. In this notebook those are properties of a local function. A deployed system would also need to test that its actual context builder is the only path from retrieval into the model.

Compare the consequences of different faults

There are two different repair routes in the previous example. If the location record is stale, an application can detect a stale verification date only when the data includes a trustworthy verification record and the application checks it. When the location has been recently verified but the model proposes a different room, comparison with the selected record can catch the discrepancy even without a freshness field. The first concern belongs upstream near catalog maintenance. The second belongs downstream near formatting and response validation. Keep both in review because a summary that says data integrity is checked could hide which one is covered.

For a known boundary, list check, fallback, and owner together. If source projection fails because a required field is missing, fallback can be a deterministic unavailable status. If the rendering semantic check fails, fallback can be a template populated from the validated location record or an unavailable result, whichever the product allows. If the caller is denied at retrieval, a fallback should preserve the denial. When you choose an evidence trail for each branch, include the outcome as well as whether the normal path completed.

A small matrix is sufficient for this comparison because we care about which component sees each field. It is not a model of data retention or downstream analytics, which would add further columns. The next architectural question is whether each path carries the fields its consumer needs. A reviewer can trace the model context, the renderer's structured inputs, and any staff troubleshooting surface as separate destinations. Lower exposure at one destination says nothing about the others until their flows have been reviewed.

We will distinguish risk from reachability. A path in the diagram shows a transfer that can occur under the route's assumptions. Its presence does not assign a frequency or impact. Two paths can reach the same component and affect different assets because they carry different fields or operate under different authority. This is why the matrix measures the named field reach and leaves any overall severity judgment for evidence about the actual application.

As a readiness exercise, imagine a third design that applies the same public projection inside retrieval. The staff-only field then never crosses from retrieval into the application for that route. The existing model-context plot would give the same values as the corresponding application-side projection. A comparison of application exposure would distinguish them. That observation is a good test of whether a plot's dependent variable answers the question a reviewer is asking.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy