liveBook · Manning

Authorization before retrieval

As explained in Authorization in Action

Authorization before retrieval is a design pattern that applies authorization constraints before protected content is fetched for an AI-mediated request.

Retrieval-augmented generation (RAG) brings enterprise documents into a language model’s context. Authorization before retrieval ensures that policy—not the model—determines which protected content can enter that context. Unauthorized data is never fetched, rather than being retrieved and filtered after generation. section 17.4

A concrete authorization-before-retrieval flow is:

  • Build a structured authorization request from the user’s principal, requested action, and relevant context. section 17.4.3
  • Evaluate applicable policies with Cedar typed partial evaluation (TPE), producing a policy residual rather than only allow or deny. section 17.4.3
  • Translate the residual into a retrieval filter, or authorize a bounded candidate set before fetching permitted content. section 17.4.3
  • Apply constraints to resource metadata such as tenant, ownership, or classification before chunks enter the model context. section 17.4.3

Multi-tenant retrieval

A user asks an AI assistant to find a document. The policy residual becomes a filter restricting vector-database chunks to that user’s tenant. The language model receives only matching chunks, so access is constrained before generation. section 17.4.3

Figure 17.4 Authorization before retrieval in RAG systems. Authorization constrains retrieval rather than generated output. By enforcing access before data is retrieved, the system ensures that the language model operates only on authorized inputs, making information leakage structurally impossible rather than merely discouraged.

The architecture diagram makes the security boundary visible: authorization constrains retrieval before authorized inputs reach the language model. section 17.4 section 17.4.3

How Authorization in Action covers it

How deep it goes
Explains request construction, Cedar partial evaluation, residual-to-filter translation, metadata filtering, and batch authorization alternatives.
Examples
Uses a multi-tenant vector database, tenant-scoped filters, policy residuals, and batched authorization of candidate resource identifiers.
What it assumes
Assumes user identity, authorization policies, request context, and retrievable resources carrying attributes such as tenant or ownership.
What you can do after
Apply it via Cedar and retrieval filters to prevent unauthorized chunks from entering an AI request’s context.
How it connects
Connects retrieval-augmented generation, authorization policy, identity, Cedar, typed partial evaluation, vector databases, and resource metadata.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Authorization in Action. The section links point to the parts of the book it draws on.