रिसोर्स · 58

RAG: डॉक्यूमेंट एक्सेस राइट्स और आइसोलेशन वेरिफ़ाई करें

रिट्रीवल, साइटेशन, कैश और रिवोकेशन को टेस्ट करें ताकि एक डॉक्यूमेंट असिस्टेंट हर यूज़र की परमिशन का सम्मान करे।

अपडेटेड · 11 min

खाली प्रयोगशाला में निजी एआई कंप्यूटिंग ढाँचा AI से निर्मित संपादकीय चित्रण

यह गाइड क्या पाने में मदद करती है

  • बाउंड्री तय करें
  • एक्सपोज़र से पहले फ़िल्टर करें
  • कैश अलग करें
  • रिवोकेशन करें

जल्दी से चेक करें

  • क्या एक अलग वेक्टर नेमस्पेस काफ़ी है?
  • क्या प्रॉम्प्ट में परमिशन होनी चाहिए?
  • टेस्टिंग में कॉन्फिडेंशियल डॉक्यूमेंट्स से कैसे बचा जा सकता है?

स्टेप-बाय-स्टेप तरीका

  1. 1

    बाउंड्री तय करें

    हर डॉक्यूमेंट को एक ओनर, स्कोप और एक्सेस रूल असाइन करें। OWASP गलत तरीके से अलाइन किए गए वेक्टर-स्टोर परमिशन से क्रॉस-कॉन्टेक्स्ट लीकेज के बारे में बताता है। हमारा प्रपोज़्ड मेथड चंक्स और मेटाडेटा को भी प्रोटेक्टेड ऑब्जेक्ट्स के तौर पर ट्रीट करता है।

    डिलीवरेबल: डॉक्यूमेंट, ग्रुप और स्कोप इन्वेंट्री।

  2. 2

    एक्सपोज़र से पहले फ़िल्टर करें

    मॉडल तक चंक पहुंचने से पहले रिट्रीवल सर्विस में ऑथराइज़ेशन लागू करें। वेक्टर सर्च, लेक्सिकल सर्च, ग्राफ़ और डायरेक्ट डाउनलोड को कवर करें। एक प्रॉम्प्ट इंस्ट्रक्शन सर्वर-साइड ऑथराइज़ेशन की जगह नहीं ले सकता।

    डिलीवरेबल: डिसीजन पॉइंट्स और मिसिंग-आइडेंटिटी बिहेवियर।

  3. 3

    कैश अलग करें

    रिटेन किए गए सर्च रिज़ल्ट, कन्वर्सेशन, साइटेशन और जवाबों की इन्वेंट्री। चेक करें कि रीयूज़ संबंधित एक्सेस कॉन्टेक्स्ट पर निर्भर करता है। कस्टमर का नाम बताने वाला इंडेक्स फ़ील्ड अपने आप में आइसोलेशन साबित नहीं करता है।

    डिलीवरेबल: कैश कीज़ और सेपरेशन सिनेरियो।

  4. 4

    रिवोकेशन करें

    नॉन-सेंसिटिव टेस्ट डॉक्यूमेंट्स का इस्तेमाल करके, एक्सेस हटाएं, एक डॉक्यूमेंट डिलीट करें और एक ग्रुप बदलें। बदलाव से पहले खोली गई बातचीत को दोबारा चलाएं। पता करें कि कब चंक्स, लिंक्स और रखे गए जवाब उपलब्ध नहीं होते हैं।

    डिलीवरेबल: टाइमस्टैम्प्ड रिवोकेशन सबूत और गैप्स।

  5. 5

    नेगेटिव टेस्ट रखें

    एक ऑथराइज़्ड यूज़र, दूसरे ग्रुप और किसी अनजान पहचान वाले से वही सवाल पूछें। फ़ाइलनेम, एक्सर्प्ट, साइटेशन और लॉग की जांच करें। इंडेक्स या कनेक्टर में बदलाव के बाद दोबारा चलाएं; कुछ पासिंग केस सिर्फ़ लिमिटेड कवरेज बनाते हैं।

    डिलीवरेबल: टेस्ट मैट्रिक्स और करेक्शन ओनर।

दोबारा इस्तेमाल होने वाली वर्कशीट

अपने ऑथराइज़्ड ऑब्ज़र्वेशन के साथ पूरा करें। ये फ़ील्ड एक वर्किंग टेम्पलेट हैं, देखे गए नतीजे नहीं।

फ़ील्डरिकॉर्ड करने के लिए जानकारी
डॉक्यूमेंट / चंकओनर और स्कोप
टेस्ट आइडेंटिटीअलाउड ग्रुप, दूसरा ग्रुप, मिसिंग आइडेंटिटी
एक्सेस रूटरिट्रीवल, साइटेशन, फ़ाइल या कैश
रिजल्टएक्सपेक्टेड, ऑब्ज़र्व्ड, डेट और करेक्शन

काल्पनिक काम का उदाहरण

उदाहरण वाली स्थिति

काल्पनिक उदाहरण: डेटा किसी ग्राहक या देखे गए परिणाम का नहीं है। अलग अधिकार वाले दो विभाग ऐसा सहायक इस्तेमाल करते हैं जो एक ही दस्तावेज़-संग्रह में बिना एकसमान फ़िल्टर के खोजता है।

फैसला और उम्मीद का सबूत

अलग अधिकारों वाले परीक्षण खाते और काल्पनिक दस्तावेज़ बनाएँ। खोज, मॉडल को भेजे गए अंश, स्रोत-संदर्भ और अस्वीकृतियाँ जाँचें। जवाब बनने से पहले अनधिकृत सामग्री का खुलासा रोकें। मॉडल को अधिकार मानने का निर्देश देना पहुँच-नियंत्रण का विकल्प नहीं है।

मैकेनिज़्म में अंतर बताएं

मैकेनिज़्ममकसदवेरिफ़िकेशन या लिमिटेशन
रिट्रीवल फ़िल्टररिट्रीव किए गए चंक्स को लिमिट करेंलेक्सिकल रूट और डायरेक्ट लिंक को भी कवर करें
रिफ्यूज़ल प्रॉम्प्टरिस्पॉन्स बिहेवियर को गाइड करेंइसे ऑथराइज़ेशन न दें
आंसर कैशरिज़ल्ट को दोबारा इस्तेमाल करेंदोबारा इस्तेमाल करने से पहले परमिशन कॉन्टेक्स्ट चेक करें

मैनेजमेंट इंडिकेटर

इंडिकेटरयह क्या मापता हैपहला एक्शन
लीक देखे गएस्कोप के बाहर एक्सपोज़ हुए डेटा को टेस्ट करेंप्रभावित इस्तेमाल को ब्लॉक करें और कारण की जांच करें
रिवोकेशन में देरीसभी टेस्ट किए गए रूट के रिफ्यूज़ होने तक का समयअभी भी एक्सेसिबल कैश के नाम बताएं
रूट कवरेजकनेक्टर और रिट्रीवल मोड का इस्तेमाल किया गयाबिना टेस्ट किए गए पाथ की पहचान करें

आम गलतियाँ

  • लेक्सिकल रूट और डायरेक्ट लिंक को भी कवर करें
  • इसे ऑथराइज़ेशन न दें
  • दोबारा इस्तेमाल करने से पहले परमिशन कॉन्टेक्स्ट चेक करें

अक्सर पूछे जाने वाले सवाल

क्या एक अलग वेक्टर नेमस्पेस काफ़ी है?

यह डेटा को पार्टीशन करने में मदद करता है, लेकिन कैश, फ़ाइल लिंक और टूल्स को एक ही बाउंड्री का सम्मान करना चाहिए।

क्या प्रॉम्प्ट में परमिशन होनी चाहिए?

काम का कॉन्टेक्स्ट मॉडल तक पहुंच सकता है; डेटा को एक्सपोज़ करने वाली सर्विस को एक्सेस डिसीजन लागू करने होंगे।

टेस्टिंग में कॉन्फिडेंशियल डॉक्यूमेंट्स से कैसे बचा जा सकता है?

हर ग्रुप के लिए अलग-अलग मार्कर के साथ फिक्शनल सेंटिनल डॉक्यूमेंट बनाएं, फिर जवाबों और साइटेशन की जांच करें।

RAG: पहुँच अधिकार, उद्धरण और कैश

इस संस्करण में विस्तृत संदर्भ टिप्पणियाँ अंग्रेज़ी में उपलब्ध हैं।

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 .

खाली साइबर प्रयोगशाला में दस्तावेज़ भंडारण के दो अलग क्षेत्र AI से निर्मित संपादकीय चित्रण
Two storage zones in an empty lab. The depicted separation establishes neither real isolation nor certification.

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

1 · Initial rights
Identity / documentCross-team procedureAlpha noteBeta noteOps fileOld Alpha noteUnclassified document
Ops serviceAllowedAllowedAllowedAllowedAllowedDenied
Alpha serviceAllowedAllowedDeniedDeniedAllowedDenied
Beta serviceAllowedDeniedAllowedDeniedDeniedDenied
UnauthenticatedDeniedDeniedDeniedDeniedDeniedDenied

Three states with reproducible outcomes

Three states with reproducible outcomes
Fictional statePolicy changeAllowed accesses / 24
1 · Initial rightsOps 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 removedAlpha 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 deletedAlpha’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.

Twelve replay cases with positive controls and expected evidence
Situation and referenceDemonstration inputDecision and evidence to retain
The group’s own document

OWASP · LLM08:2025 Vector and Embedding Weaknesses

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

OWASP · LLM08:2025 Vector and Embedding Weaknesses

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

OWASP · LLM08:2025 Vector and Embedding Weaknesses

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

OWASP · API1:2023 Broken Object Level Authorization

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

OWASP · LLM08:2025 Vector and Embedding Weaknesses

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

OWASP · API1:2023 Broken Object Level Authorization

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

OWASP · LLM08:2025 Vector and Embedding Weaknesses

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

OWASP · API1:2023 Broken Object Level Authorization

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

OWASP · API1:2023 Broken Object Level Authorization

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

OWASP · API1:2023 Broken Object Level Authorization

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

OWASP · LLM01:2025 Prompt Injection

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

OWASP · LLM06:2025 Excessive Agency

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.

RAG: प्रासंगिकता और रैंकिंग

इस संस्करण में विस्तृत संदर्भ टिप्पणियाँ अंग्रेज़ी में उपलब्ध हैं।

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

ऑफ़िशियल रेफ़रेंस

रेफ़रेंस इस तरीके को सपोर्ट करते हैं। अपने कॉन्टेक्स्ट के हिसाब से चेक को एडजस्ट करें; वे सर्टिफ़िकेशन नहीं हैं। ओरिजिनल रेफ़रेंस टाइटल और सोर्स डॉक्यूमेंट दूसरी भाषा में हो सकते हैं।

संदर्भ जाँच की तारीख .