{
  "schema_version": 1,
  "title": "RAG Document Access Control",
  "review_type": "AI-assisted source-support audit; not independent expert verification",
  "sources": [
    {
      "id": "S1",
      "key": "rag-architecture",
      "title": "Retrieval Augmented Generation with Huggingface Transformers and Ray",
      "author": "Kamsetty, A. (2021).",
      "url": "https://huggingface.co/blog/ray-rag",
      "requested_url": "https://huggingface.co/blog/ray-rag",
      "accessed_at": "2026-11-13T22:38:56.986Z",
      "source_type": "primary",
      "version": null,
      "published_at": "2021-02-10T00:00:00.000Z",
      "source_date_note": "Kamsetty, A. (2021).",
      "retrieved_body_sha256": "e560556a6fb4447a1432690e4993fe91c5117e70a705c2fabec8d3a33e1f16bf",
      "library": {
        "id": "46f3ffc4bbd079e05a8ded5ad882e391",
        "revision": "e53ba23d35dfe41db4dce1ab971ee509",
        "published_at": "2021-02-10T00:00:00.000Z",
        "captured_at": "2026-11-06T20:15:05.499Z",
        "exact_quote_in_saved_original": true,
        "passage_matches": [
          {
            "evidence_id": "S1-E1",
            "exact_match": true
          }
        ]
      },
      "evidence": [
        {
          "id": "S1-E1",
          "location": "What is Retrieval Augmented Generation?",
          "quote": "retrieves contextual documents from an external knowledge base",
          "normalized_text_offset": 1240
        }
      ],
      "limitations": "Architecture context from the saved public original; no dated training instructions are reused.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S2",
      "key": "acl-azure",
      "title": "Security Filter Pattern - Azure AI Search | Microsoft Learn",
      "author": "Microsoft. (Documentation accessed 2026).",
      "url": "https://learn.microsoft.com/en-us/azure/search/search-security-trimming-for-azure-search",
      "requested_url": "https://learn.microsoft.com/en-us/azure/search/search-security-trimming-for-azure-search",
      "accessed_at": "2026-11-13T22:38:57.192Z",
      "source_type": "primary",
      "version": null,
      "published_at": null,
      "source_date_note": "Microsoft. (Documentation accessed 2026).",
      "retrieved_body_sha256": "ec191b82d814b3051d25a1a14eb8f34cb40fbf08d60414cba394bcac175af97b",
      "library": null,
      "evidence": [
        {
          "id": "S2-E1",
          "location": "About the security filter pattern",
          "quote": "The principal is just a string, used in a filter expression",
          "normalized_text_offset": 1727
        }
      ],
      "limitations": "Filtering simulates result trimming; the application still needs trusted authentication and authorization.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S3",
      "key": "acl-elastic",
      "title": "Controlling access at the document and field level | Elastic Docs",
      "author": "Elastic maintainers. (Documentation accessed 2026).",
      "url": "https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level",
      "requested_url": "https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level",
      "accessed_at": "2026-11-13T22:38:57.165Z",
      "source_type": "primary",
      "version": null,
      "published_at": null,
      "source_date_note": "Elastic maintainers. (Documentation accessed 2026).",
      "retrieved_body_sha256": "3a3fd5970779e65a08ccd020878e846e468589d99db8b2773b9503753493d5a5",
      "library": null,
      "evidence": [
        {
          "id": "S3-E1",
          "location": "Document level security",
          "quote": "Document level security restricts the documents that users have read access to.",
          "normalized_text_offset": 421
        }
      ],
      "limitations": "An actual product-level control with documented limitations; not equivalent to every vector filter.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    }
  ],
  "claims": [
    {
      "id": "C01",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Authenticate caller — Trusted principal — The application establishes the caller and trusted group membership. — A user-entered team name must not become authoritative policy.; Resolve policy — Allowed documents — The service derives access rules from trusted authorization state. — Policy version and revocation behavior need explicit handling outside this toy.; Retrieve within policy — Filter + top-k — Select candidates within the allowed set before ranking in this experiment. — The implementation must ensure the retrieval filter cannot be omitted or changed by the caller.; Assemble context — Authorized text — Only approved document text crosses into model context. — Caches, citations and follow-up reads need the same caller-aware boundary.",
      "source_ids": [
        "S1",
        "S2",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S2-E1",
        "S3-E1"
      ],
      "verdict": "editorial_diagram_with_source_supported_roles",
      "reason": "Diagram is a teaching workflow, not an exhaustive protocol or measured system. Each role and arrow is bounded in nearby text."
    },
    {
      "id": "C02",
      "notebook_locations": [
        "experiment"
      ],
      "claim": "Four fictional documents have fixed relevance scores and ACLs. Select a trusted principal and k. Compare filtering the candidate set before top-k with taking the global top-k and then removing unauthorized hits. D1: Team A, score .98. D2: Team B, .94. D3: Public, .85. D4: Public, .70. ACLs and identity are trusted fixed inputs. Both displayed final contexts exclude disallowed documents; post-filtering can underfill the result set. No timing or attack is simulated. Public caller, k=2, filter first: D3 · D4: Two allowed documents are selected from the allowed candidate set. Public caller, k=2, top-k first: Empty after trimming: D1 and D2 occupied the cutoff and are then removed. Send global hits to the model first: Outside this permitted workflow: Filtering the displayed answer later would not undo that context disclosure.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_synthetic_experiment",
      "reason": "Original fixed inputs and outputs; Python assertions and independent browser arithmetic checked in verification artifacts."
    },
    {
      "id": "C03",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "RAG brings retrieved text into a generator’s context. For a collection with restricted documents, access policy therefore matters before text crosses into that context. A document’s relevance to a question does not give the caller permission to read it. The diagram separates identity, policy, retrieval and context assembly.",
      "source_ids": [
        "S1",
        "S2"
      ],
      "evidence_ids": [
        "S1-E1",
        "S2-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C04",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Microsoft’s security-filter pattern carries principal identifiers in indexed fields and applies a query filter. Its documentation explicitly says those strings do not perform authentication or authorization. Elastic separately documents document-level security enforced through roles. These are different mechanisms; neither removes the need to understand the actual deployment’s policy boundary.",
      "source_ids": [
        "S2",
        "S3"
      ],
      "evidence_ids": [
        "S2-E1",
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C05",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "For the public caller at k=2, the order of filtering and truncation changes coverage: filtering first returns D3 and D4; global top-k followed by trimming returns none. That is a property of the declared list. It is not a claim that every database executes filters or approximate search in the same order.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C06",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "A filter expression alone does not establish who the caller is. In the trusted application, the identity-to-policy mapping must be controlled by the server. The lab’s principal selector is an educational input; exposing such a selector as authority in a real endpoint would invalidate the assumed boundary.",
      "source_ids": [
        "S2"
      ],
      "evidence_ids": [
        "S2-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C07",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "Editorial review questions: how do ACL changes reach the index, how are stale cache entries invalidated, and are passage previews and direct source reads checked too? The lesson proposes these checks; it does not prove that a particular cache or index enforces them.",
      "source_ids": [
        "S2",
        "S3"
      ],
      "evidence_ids": [
        "S2-E1",
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C08",
      "notebook_locations": [
        "reproduce"
      ],
      "claim": "The original standard-library Python example passed its assertions and 9 input fixtures. Its browser implementation is separately compared against those results.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "tested_original_example",
      "reason": "No publisher code executed; no model, external network call or privileged action in the examples."
    },
    {
      "id": "C09",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Does a high relevance score grant access? Correct answer: No. Relevance and permission are different properties.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C10",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "For the public caller at k=2, what does filter-before-top-k return here? Correct answer: D3 and D4. D1 and D2 are excluded before truncation; the allowed set contains D3 and D4.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C11",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Who should derive the authoritative filter in the stated architecture? Correct answer: Trusted application policy. A principal string in a filter does not authenticate the caller.",
      "source_ids": [
        "S2"
      ],
      "evidence_ids": [
        "S2-E1"
      ],
      "verdict": "source_supported_and_worked_example",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C12",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Can filtering an answer undo restricted text already sent in model context? Correct answer: No. The earlier context disclosure has already happened in that hypothetical workflow.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    }
  ],
  "original_experiment": {
    "scope": "A local synthetic document collection. No real identities, permissions or protected documents are queried.",
    "assumptions": "D1: Team A, score .98. D2: Team B, .94. D3: Public, .85. D4: Public, .70. ACLs and identity are trusted fixed inputs. Both displayed final contexts exclude disallowed documents; post-filtering can underfill the result set. No timing or attack is simulated.",
    "results_file": "verification/python-results.json"
  },
  "library_gap": null,
  "excluded_evidence": [],
  "limitations": [
    "No real model or GPU measured.",
    "Sources and version/date labels checked as recorded; this does not prove absence of errors."
  ],
  "separate_audit_file": "verification/source-audit.json",
  "publication": {
    "state": "published",
    "approved_on": "2026-11-14",
    "published_on": "2026-11-14",
    "source_checks_on": "2026-11-13"
  }
}
