Threat Modeling Compound AI Systems › Worked example: two architectures, one matrix
Language AI HandbookAll chapters Keep the answer contract fixed while changing what the answer model sees. The broader design projects all three public fields. The narrow design projects room and shelf. Both retain the original title at the application level when needed for the display. Neither enables editing, and both check the proposed location before rendering.
Read each matrix row as an individual effect in the declared design. Here "model input" denotes data present in the answer model's request context. "Application only" means the application's intermediate result can contain that field and the model context does not. A control outside the route has no operation in this exercise.
PythonIn [10]Expand
matrix = [
("Title", "Model input", "Application only"),
("Room", "Model input", "Model input"),
("Shelf", "Model input", "Model input"),
("Staff note", "Application only", "Application only"),
("Edit catalog", "Outside route", "Outside route"),
]
for item, full_view, narrow_view in matrix:
print(f"{item:15} {full_view:18} {narrow_view}")ConsoleOut [10]Expand
Title Model input Application only Room Model input Model input Shelf Model input Model input Staff note Application only Application only Edit catalog Outside route Outside route
PythonIn [11]Expand
public_counts = [len(public_context), len(location_context)]
full_count, narrow_count = public_counts
fewer_fields = full_count - narrow_count
assert public_counts == [3, 2]
assert fewer_fields == 1The count uses the keys in each example dictionary. Both contexts carry the same room and shelf values. Narrowing the projection removes one public field, the title. This count tracks scope in a declared configuration. Fields can vary in sensitivity and in how much information they contain, so equal counts would tell you little about privacy risk.
VisualizationOut [12]Expand

The diagram exposes a narrow tradeoff for this task. Location-only keeps the answer ingredients and omits a field the model does not need. A later feature that needs to compare titles changes the functional requirement. Update the projection and its boundary test together when that requirement changes.
Conditions for comparing views
A comparison depends on a fixed task. We are looking up one caller-visible catalog entry and providing the room and shelf. Neither route asks the answer model to select a different resource. The same catalog source, current reader and return route apply. To explain any matrix difference, a reader should be able to point to one design choice. With a different source or more permissive user, the field reach might change for an unrelated reason. Hold the access decision fixed while you compare the projections.
There are two distinct ways to count data here. The number of field names describes the shape of a record. The number of distinct field values across a batch describes a different property and can change when data varies while the schema stays fixed. The plot uses the first count for one row. It cannot tell how many people the fuller view could identify, how much text it contains, or how much work the model uses. Those observations require a different experiment and privacy or performance criteria.
A useful control expectation for both views is that the public location values returned by projection still match the source. That makes the effect of changing scope easier to verify. For this toy example, dictionary values are direct copies. For a deployed system with normalization, decide whether a value such as room E01 can be shortened to E1. The application needs a checked mapping if such normalization can change the apparent location. Failing to define equivalence at the comparison step can make valid answers fail while invalid ones with similar labels still pass.
If you include a third experimental view for a room-only route, write down the changed task contract. For example, a visitor guide might answer which hall to enter without identifying a shelf. A field count of one would then be expected for this new contract. Under the original task with a required shelf, that same projection would omit an essential field. You can distinguish content minimization from missing functionality by testing the task outcome and the allowed fields in separate assertions.
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!