リソース · 58

RAG:ドキュメントのアクセス権限と分離の検証

ドキュメントアシスタントが各ユーザーの権限を尊重するように、取得、引用、キャッシュ、および取り消しをテストする。

更新済み · 15 min

無人ラボのプライベートAI計算基盤 AIで生成した編集用イラスト

このガイドが達成するのに役立つこと

  • 境界の定義
  • 公開前のフィルタリング
  • キャッシュの分離
  • 失効の実施

クイックチェック

  • 個別のベクトル名前空間で十分か?
  • プロンプトに権限を表示すべきか?
  • テストで機密文書を回避するにはどうすればよいか?

手順

  1. 1

    境界の定義

    各ドキュメントに所有者、スコープ、アクセスルールを割り当てます。 OWASPは、ベクターストアの権限設定の不整合によるクロスコンテキスト漏洩について説明しています。 提案手法では、チャンクとメタデータも保護対象として扱います。

    成果物:ドキュメント、グループ、スコープのインベントリ。

  2. 2

    公開前のフィルタリング

    チャンクがモデルに到達する前に、検索サービスで認証を強制します。 ベクター検索、レキシカル検索、グラフ、直接ダウンロードを対象とします。 プロンプトによる指示は、サーバー側の認証に代わるものではありません。

    成果物:決定ポイントとID欠落時の挙動。

  3. 3

    キャッシュの分離

    保持された検索結果、会話、引用、回答のインベントリを作成します。 再利用が関連するアクセスコンテキストに依存することを確認します。 顧客名を記載したインデックスフィールドだけでは、分離性を証明するものではありません。

    成果物:キャッシュキーと分離シナリオ。

  4. 4

    失効の実施

    機密性の低いテストドキュメントを使用して、アクセス権を削除し、ドキュメントを削除し、グループを変更します。 変更前に開かれた会話を再生します。 チャンク、リンク、および保持された回答が利用できなくなったタイミングを測定します。

    成果物:タイムスタンプ付きの失効証拠とギャップ。

  5. 5

    否定テストを保持します。

    承認済みユーザー、別のグループ、および未知のIDに対して同じ質問を行います。 ファイル名、抜粋、引用、およびログを検査します。 インデックスまたはコネクタの変更後に再実行します。 合格したケースがいくつかあるだけでは、限定的なカバレッジしか確立できません。

    成果物:テストマトリックスと修正担当者。

再利用可能なワークシート

承認された観察結果を記入してください。 これらのフィールドは作業用テンプレートであり、観察結果ではありません。

フィールド記録する情報
ドキュメント/チャンク所有者とスコープ
テストID許可グループ、その他のグループ、IDの欠落
アクセスルート取得、引用、ファイルまたはキャッシュ
結果期待値、観測値、日付、修正

架空の事例

具体的な状況

架空の例です。顧客や実際の観測結果を示すデータではありません。 権限が異なる二つの部署が、同じ文書群を一貫した絞り込みなしで検索するアシスタントを利用しています。

決定と期待される証拠

権限の異なるテストアカウントと架空の文書を用意し、検索結果、モデルに渡る抜粋、出典表示、拒否応答を確認します。 生成前に権限外の内容が露出することを防ぎます。権限を守るようモデルに指示するだけではアクセス制御になりません。

メカニズムの区別

メカニズム目的検証または制限
取得フィルタ取得チャンクの制限字句経路と直接リンクも対象とする
拒否プロンプト応答動作のガイド認証を委任しない
回答キャッシュ結果の再利用再利用前にアクセス権限コンテキストを確認する

管理指標

指標測定対象最初のアクション
リークの検出スコープ外に公開されたテストデータ影響を受ける使用をブロックし、原因を調査する
失効の遅延テスト済みのすべての経路が拒否されるまでの時間アクセス可能な名前キャッシュ
経路カバレッジコネクタと取得モードの実行テストされていないパスの特定

よくある間違い

  • 字句経路と直接リンクも対象とする
  • 認証を委任しない
  • 再利用前にアクセス権限コンテキストを確認する

よくある質問

個別のベクトル名前空間で十分か?

データのパーティション分割に役立つが、キャッシュ、ファイルリンク、ツールは同じ境界を尊重する必要がある。

プロンプトに権限を表示すべきか?

有用なコンテキストがモデルに到達する可能性がある。 データを公開するサービスはアクセス決定を強制する必要がある。

テストで機密文書を回避するにはどうすればよいか?

各グループごとに、固有のマーカーを持つ架空の監視文書を作成し、回答と引用を検証します。

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 .

無人のサイバー研究室にある分離された2つの文書保管区画 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

公式参照文献

参照文献はメソッドを裏付けるものです。 チェックは状況に合わせて調整してください。 これらは認証ではありません。 元の参照文献のタイトルやソース文書は別の言語で書かれている場合があります。

参照資料の確認日 .