Ressourcen · 58
RAG: Dokumentzugriffsrechte und Isolierung überprüfen
Testabruf, Zitierungen, Caches und Widerruf, damit ein Dokumentassistent die Berechtigungen jedes Benutzers respektiert.
Aktualisiert · 7 min
Wozu dieser Leitfaden beiträgt
- Grenzen definieren
- Vor der Belichtung filtern
- Separate Caches
- Ausübungsrückruf
Kurzcheck
- Reicht ein separater Vektor-Namensraum?
- Sollten Berechtigungen in der Eingabeaufforderung enthalten sein?
- Wie können vertrauliche Dokumente beim Testen vermieden werden?
Schritt-für-Schritt-Anleitung
- 1
Grenzen definieren
Weisen Sie jedem Dokument einen Eigentümer, einen Umfang und eine Zugriffsregel zu. OWASP beschreibt kontextübergreifende Lecks aufgrund falsch ausgerichteter Vektorspeicherberechtigungen. Unsere vorgeschlagene Methode behandelt auch Chunks und Metadaten als geschützte Objekte.
Liefergegenstand: Dokumenten-, Gruppen- und Umfangsinventur.
- 2
Vor der Belichtung filtern
Erzwingen Sie die Autorisierung im Abrufdienst, bevor ein Chunk das Modell erreicht. Bedecken Sie die Vektorsuche, die lexikalische Suche, Grafiken und direkte Downloads. Eine zeitnahe Anweisung kann eine serverseitige Autorisierung nicht ersetzen.
Liefergegenstand: Entscheidungspunkte und Missing-Identity-Verhalten.
- 3
Separate Caches
Suchergebnisse, Konversationen, Zitate und Antworten werden im Inventar gespeichert. Stellen Sie sicher, dass die Wiederverwendung vom jeweiligen Zugriffskontext abhängt. Ein Indexfeld mit dem Namen eines Kunden allein beweist noch nicht die Isolation.
Lieferinhalt: Cache-Schlüssel und Trennungsszenarien.
- 4
Ausübungsrückruf
Verwenden Sie nicht vertrauliche Testdokumente, entziehen Sie den Zugriff, löschen Sie ein Dokument und ändern Sie eine Gruppe. Wiederholen Sie eine Konversation, die vor der Änderung geöffnet wurde. Messen Sie, wann Chunks, Links und gespeicherte Antworten nicht mehr verfügbar sind.
Lieferinhalt: zeitgestempelte Sperrnachweise und Lücken.
- 5
Negative Tests beibehalten
Stellen Sie die gleiche Frage wie ein autorisierter Benutzer, eine andere Gruppe und eine unbekannte Identität. Überprüfen Sie Dateinamen, Auszüge, Zitate und Protokolle. Wiedergabe nach Index- oder Connector-Änderungen; In einigen vorübergehenden Fällen wird nur eine begrenzte Deckung erreicht.
Liefergegenstand: Testmatrix und Korrekturverantwortlicher.
Wiederverwendbares Arbeitsblatt
Ergänzen Sie Ihre autorisierten Beobachtungen. Bei diesen Feldern handelt es sich um eine Arbeitsvorlage, nicht um beobachtete Ergebnisse.
| Feld | Zu erfassende Informationen |
|---|---|
| Dokument / Chunk | Eigentümer und Geltungsbereich |
| Identität testen | Erlaubte Gruppe, andere Gruppe, fehlende Identität |
| Anfahrtsweg | Retrieval, Zitierung, Datei oder Cache |
| Ergebnis | Erwartet, beobachtet, Datum und Korrektur |
Fiktives Arbeitsbeispiel
Beispielhafte Situation
Fiktives Beispiel: Diese Daten beschreiben keine Kunden oder beobachteten Ergebnisse. Zwei Abteilungen mit unterschiedlichen Rechten nutzen einen Assistenten, der denselben Dokumentbestand ohne einheitliche Filterung durchsucht.
Entscheidung und erwartete Beweise
Testkonten und fiktive Dokumente mit unterschiedlichen Rechten anlegen. Suche, Modellkontext, Quellenverweise und Ablehnungen prüfen. Unberechtigte Offenlegung vor der Antworterzeugung verhindern. Eine Anweisung an das Modell, Rechte zu beachten, ersetzt keine Zugriffskontrolle.
Unterscheiden Sie die Mechanismen
| Mechanismus | Zweck | Überprüfung oder Einschränkung |
|---|---|---|
| Abruffilter | Abgerufene Chunks beschränken | Decken Sie auch lexikalische Routen und direkte Links ab |
| Ablehnungsaufforderung | Antwortverhalten des Leitfadens | Delegieren Sie keine Berechtigungen daran |
| Antwort-Cache | Ein Ergebnis wiederverwenden | Berechtigungskontext vor Wiederverwendung prüfen |
Managementindikatoren
| Indikator | Was es misst | Erste Aktion |
|---|---|---|
| Beobachtete Lecks | Testdaten liegen außerhalb des Gültigkeitsbereichs | Betroffene Nutzung sperren und Ursache prüfen |
| Sperrverzögerung | Zeit bis alle getesteten Routen versagen | Namenscaches weiterhin zugänglich |
| Streckenabdeckung | Konnektoren und Abrufmodi ausgeübt | Identifizieren Sie ungetestete Pfade |
Häufige Fallstricke
- Decken Sie auch lexikalische Routen und direkte Links ab
- Delegieren Sie keine Berechtigungen daran
- Berechtigungskontext vor Wiederverwendung prüfen
Häufig gestellte Fragen
Reicht ein separater Vektor-Namensraum?
Es hilft bei der Partitionierung von Daten, aber Caches, Dateiverknüpfungen und Tools müssen dieselben Grenzen berücksichtigen.
Sollten Berechtigungen in der Eingabeaufforderung enthalten sein?
Nützlicher Kontext kann das Modell erreichen; Der Dienst, der Daten offenlegt, muss Zugriffsentscheidungen erzwingen.
Wie können vertrauliche Dokumente beim Testen vermieden werden?
Erstellen Sie für jede Gruppe fiktive Sentinel-Dokumente mit unterschiedlichen Markierungen und überprüfen Sie dann Antworten und Zitate.
RAG: Zugriffsrechte, Zitate und Caches
Ausführliche Hinweise stehen in dieser Ausgabe auf Englisch zur Verfügung.
An accurate answer can disclose a forbidden document. Retrieval relevance, citation validity and access authorisation are separate checks. The service providing passages must enforce the current identity’s rights before exposing them to the model.
Fictional CIE teaching set: four technical identities, six documents and three states. It illustrates a proposed policy without querying your system, authenticating real users or measuring product security. OWASP references describe risk families; the scenarios, rules and numbers below are our examples.
References consulted on .
Explore the fictional document policy
Choose identity, document, state and access path. The result is the decision expected under this policy, not an observed test of your application. All four paths should enforce the same access decision.
Local browser calculation with no connection to an AI model, vector database or account. No free-text field, secret or document to send.
Matrix of 24 expected decisions
Ops has group ops; Alpha has alpha; Beta has beta. The unauthenticated identity has no access. Documents without an explicit rule are denied.
10 allowed accesses across 24 fictional combinations
| Identity / document | Cross-team procedure | Alpha note | Beta note | Ops file | Old Alpha note | Unclassified document |
|---|---|---|---|---|---|---|
| Ops service | Allowed | Allowed | Allowed | Allowed | Allowed | Denied |
| Alpha service | Allowed | Allowed | Denied | Denied | Allowed | Denied |
| Beta service | Allowed | Denied | Allowed | Denied | Denied | Denied |
| Unauthenticated | Denied | Denied | Denied | Denied | Denied | Denied |
Three states with reproducible outcomes
| Fictional state | Policy change | Allowed accesses / 24 |
|---|---|---|
| 1 · Initial rights | Ops has group ops; Alpha has alpha; Beta has beta. The unauthenticated identity has no access. Documents without an explicit rule are denied. | 10 / 24 |
| 2 · Alpha group removed | Alpha remains authenticated but no longer has any required group. The cross-team procedure also requires one of ops, alpha or beta, so Alpha loses access to it as well. Ops and Beta groups are unchanged. | 7 / 24 |
| 3 · Group removed and old note deleted | Alpha’s group removal persists. The old Alpha note is deleted and denied to every identity, including Ops. Other document rules stay unchanged. | 6 / 24 |
These counts describe a small closed set, not a security rate. State changes are instant in this demonstration. In production, measure the actual delay on every path; revoking a right cannot retroactively erase a copy already read or exported.
Twelve replay cases with positive controls and expected evidence
Fictional scenarios. Buttons populate the demonstration and run no penetration test. To assess an application, compare each expectation with an actual trace from an authorised environment using sentinel data.
| Situation and reference | Demonstration input | Decision and evidence to retain |
|---|---|---|
| The group’s own document | Alpha service Alpha note 1 · Initial rights Vector retrieval | Allowed in this example Positive control: retain the permitted fictional passage and service decision. A system denying everything does not pass the functional test. |
| Another group’s document | Beta service Alpha note 1 · Initial rights Vector retrieval | Denied in this example Check that the passage, sensitive title and metadata are absent from data supplied to the model. |
| The secondary lexical branch | Beta service Alpha note 1 · Initial rights Lexical / hybrid retrieval | Denied in this example Retain each branch’s decisions before fusion and the final result. No vector leak does not establish lexical coverage. |
| A known citation identifier | Beta service Alpha note 1 · Initial rights Citation / file resolution | Denied in this example Call citation resolution using the Beta test identity; retain the object denial, not just the absence of a link in the answer. |
| An old cached answer | Alpha service Alpha note 2 · Alpha group removed Cached answer or passage | Denied in this example Create the answer before group removal and replay afterwards. Check that old passages are not returned under current rights. |
| The cross-team procedure after removal | Alpha service Cross-team procedure 2 · Alpha group removed Vector retrieval | Denied in this example This document requires an explicit group; remaining authenticated is insufficient. Retain the rule and membership change explaining the denial. |
| The unchanged group | Beta service Beta note 2 · Alpha group removed Lexical / hybrid retrieval | Allowed in this example Beta positive control: confirm that revocation handling does not block another authorised group. |
| The deleted but remembered document | Ops service Old Alpha note 3 · Group removed and old note deleted Cached answer or passage | Denied in this example Try an old citation and cache after deletion. Record object state and refusal to return it; separately verify removal of copies under your policy. |
| A document without a rule | Ops service Unclassified document 1 · Initial rights Vector retrieval | Denied in this example Even Ops has no implicit privilege. Retain the handling of an unclassified document and the process for correcting its access rule. |
| Access without an authenticated identity | Unauthenticated Cross-team procedure 1 · Initial rights Citation / file resolution | Denied in this example Check citation paths and their errors: reserved content must not be exposed during a denied attempt. |
| A source claims higher authority | Beta service Ops file 1 · Initial rights Cached answer or passage | Denied in this example A sentence inside the document changes neither groups nor service rules. Retain the technical denial even if model wording is persuasive. |
| The Ops file remains allowed | Ops service Ops file 3 · Group removed and old note deleted Citation / file resolution | Allowed in this example Positive control after both changes: establish this specific access without granting Ops the unclassified or deleted document. |
Document six technical boundaries
- Collection
- Retain document origin, version and status. Internal content can also carry hostile instructions. OWASP · LLM01:2025 Prompt Injection →
- Authorisation
- Check identity, object and groups in the service. Prompt text is not the permissions engine. OWASP · API1:2023 Broken Object Level Authorization →
- Generation and rendering
- Validate outputs for their destination: text, HTML, query or tool argument. A plausible answer is not directly executable input. OWASP · LLM05:2025 Improper Output Handling →
- Tool action
- Separate reading, proposing and modifying. Limit function, permission and autonomy to the task; read access does not authorise sending. OWASP · LLM06:2025 Excessive Agency →
- Configuration
- Keep secrets out of the system prompt. Confidentiality of its wording does not replace access controls. OWASP · LLM07:2025 System Prompt Leakage →
- Consumption
- Set request, duration and action limits, then exercise stopping and degraded operation with a demonstration budget. OWASP · LLM10:2025 Unbounded Consumption →
Useful traces without copying documents
Link test identifier, policy version, technical identity and effective groups, document identifier/version, access path, decision and timestamp. For revocation, add the change time and first observed denial per path. Use demonstration markers instead of secrets; restrict logs to necessary information and protect their access.
Continue with prompt injection testing →
Sources, editions and scope of the example
OWASP 2025 and API 2023 editions are explicitly identified. NIST AI 100-2 E2025 is a taxonomy published in March 2025; its page notes an April PDF correction and a June 2025 potential-update note. None certifies this simulator or your application.
- OWASP · LLM08:2025 Vector and Embedding Weaknesses · 2025
- OWASP · LLM01:2025 Prompt Injection · 2025
- OWASP · LLM06:2025 Excessive Agency · 2025
- OWASP · LLM05:2025 Improper Output Handling · 2025
- OWASP · LLM07:2025 System Prompt Leakage · 2025
- OWASP · LLM10:2025 Unbounded Consumption · 2025
- OWASP · API1:2023 Broken Object Level Authorization · 2023
- NIST AI 100-2 E2025 · Adversarial Machine Learning · Final · March 2025 ·
RAG: Relevanz und Rangfolge
Ausführliche Hinweise stehen in dieser Ausgabe auf Englisch zur Verfügung.
Relevance and permission need separate checks
A relevant document may be forbidden to the requester. Build the evaluation corpus within accessible scope and test denials independently of ranking scores.
- Keep permissions and document versions with the test set.
- Check revocation, deletion and citation paths before measuring relevance.
- Do not use an nDCG improvement as evidence that permissions are respected.
Explore ranking measures and relevance judgments →
Stanford CS276 · Retrieval evaluation · 2019 course archive · PDF pp. 3, 5–6 · consulted 2026-10-23
NIST TREC · Reciprocal rank definition · Repository snapshot 35cf096ba6d5ae08ca4803c056b31ed61a56a6d4 · consulted 2026-10-23
Offizielle Referenzen
Die Referenzen unterstützen die Methode. Passen Sie die Prüfungen an Ihren Kontext an; sie stellen keine Zertifizierung dar. Originalreferenztitel und Quelldokumente können in einer anderen Sprache verfasst sein.
Referenzen geprüft am .
- OWASP — LLM08:2025, Vector and Embedding Weaknesses
- OWASP · LLM01:2025 Prompt Injection
- OWASP · LLM06:2025 Excessive Agency
- OWASP · LLM05:2025 Improper Output Handling
- OWASP · LLM07:2025 System Prompt Leakage
- OWASP · LLM10:2025 Unbounded Consumption
- OWASP · API1:2023 Broken Object Level Authorization
- NIST AI 100-2 E2025 · Adversarial Machine Learning
- Stanford CS276 · Retrieval evaluation
- NIST TREC · Reciprocal rank definition
