← Back to your requirements

How to meet it OWASP AISVS v1.01

Access Control & Identity for AI Components & Users · AI Resource Authorization & Classification

Search only what the user may see

AISVS 5.2.2 Level 2

Verify that retrieval pipelines (e.g., RAG queries, embedding lookups) enforce the end-user's authorization context at each retrieval and assembly stage, rather than relying solely on the service account's permissions.

OWASP AISVS v1.01, requirement 5.2.2

In plain English

When the assistant searches documents for a user, it should only find what that user is allowed to see. The search must apply that user's permissions. The service account behind it usually has far wider access.

What good looks like

  • Each retrieval query carries the user's identity or permission filter.
  • Documents in the index keep their access control information.
  • Tests show a user cannot retrieve another user's restricted documents.

How teams usually do it

  • Storing access lists as metadata on each chunk and filtering on them at query time.
  • Separate indexes per permission group where filtering is not possible.

Evidence an auditor would accept

  • Query code showing the filter.
  • Test results with users of different permission levels.

Common mistakes

  • Indexing everything with a service account and filtering only in the user interface.
  • Copying documents into the index without their permissions.

Not sure which requirements apply to your system? Take the assessment.

Requirement text from the OWASP AI Security Verification Standard, licensed under CC BY-SA 4.0. This guidance is shared under the same licence.