Threat Modeling Compound AI Systems › Step 5: Map authority, the part that makes or breaks security
Language AI HandbookAll chapters For the catalog lookup, authority means permission for an authenticated reader to read the requested record at the time of the check. The application's capability to perform the service call is necessary, but the service capability is only one input to the decision. In the fixture below the authorized entry set represents the reader's current permissions. The answer-model context plays no role in that set.
PythonIn [13]Expand
def has_read_permission(
entry_id: str, current_visible_entries: frozenset[str]
) -> bool:
return entry_id in current_visible_entries
entry_id = "catalog-entry-1"
approved_entries = frozenset({entry_id})
assert has_read_permission(entry_id, approved_entries)
assert not has_read_permission("catalog-entry-2", approved_entries)
assert not has_read_permission(entry_id, frozenset())This check describes a declared state at one decision. A design with changing permissions needs to say whether the read and the later display share an authorization snapshot or perform separate checks against current state. That choice determines what happens if access changes between retrieval and display. The catalog exercise assumes authorization at the read boundary and a session-bound reply, with no access changes during the simulated request.
Bound authority to the current decision
Each authorization worksheet needs a subject, one operation, a resource, and a state or time at which the rule is evaluated. Those terms make it easier to discuss a question such as what happens when the reader signs out. In the example, the subject is the current reader session, the operation is reading the entry, and the resource is its identifier. The fixture supplies the identifier set at the point of evaluation. Similar prototypes sometimes put the set into model context because it seems convenient. Doing so exposes policy data to the answer stage without deciding who enforces membership.
Track authority across delegated calls, too. A service account may have rights to retrieve many records on behalf of the application. A user-visible action still needs the application to establish the invoking reader's permission for the specific entry. One way to review this is to examine a failing fixture for an account that is valid but lacks access to one record. The lookup can be denied even though the infrastructure client has its own valid authentication. This distinction belongs in the service test alongside ordinary successful cases.
Trust boundaries can change within the same request. If the application computes a draft in one session and later shows it inside a separate workspace, those endpoints can have different audiences. A model proposal about where to send a reply cannot establish the user's authority to send it there. The design controls in this chapter only display results to the current client, and include no external send route. Add the audience and the necessary authorization checks to the model if that capability is introduced later.
Revocation is a design question about timing. An application may choose to recheck at each sensitive boundary. Another architecture may issue access untied to model output for a limited lifetime, according to policy. A reviewer needs to know which decision that deployment makes, whether there is a distinct cached result, and how long the application can continue after a permission update. Our fixture simulates decisions using a supplied set. It models none of the time between allocation of that set and a distributed operation.
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!