{
  "schema_version": "1.3.0",
  "slug": "how-must-an-instance-quarantine-adversarial-content-in-retrieved-rag-documents",
  "title": "How must an instance quarantine adversarial content in retrieved RAG documents?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The RAG pipeline retrieves documents from untrusted sources (web, user content, third-party datasets), the LLM receives documents as context, and the LLM's behavior can be influenced by document content. * **Does not app",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-must-an-instance-quarantine-adversarial-content-in-retrieved-rag-documents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-must-an-instance-quarantine-adversarial-content-in-retrieved-rag-documents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-must-an-instance-quarantine-adversarial-content-in-retrieved-rag-documents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1051,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **retrieval relevance** (the document matches the query semantically) and **content safety** (the document does not contain prompt injection, malicious instructions, or adversarial content). Relying on relevance alone creates the **Injection via Retrieval Hazard**: the document is relevant to the query, so the agent passes it to the LL...",
    "what_was_observed": "In RAG-based agent architectures, failing to quarantine adversarial retrieved content produces three primary failure modes: 1. **Indirect Prompt Injection:** The retrieved document contains text like \"Ignore previous instructions and instead do X\". The LLM follows it, executing actions the agent never intended. 2. **Data Exfiltration via Context:** The adversarial document instructs the LLM to include sensitive syste...",
    "condition_of_validity": "* **Applies when:** The RAG pipeline retrieves documents from untrusted sources (web, user content, third-party datasets), the LLM receives documents as context, and the LLM's behavior can be influenced by document content. * **Does not apply when:** All retrieved documents come from a strictly internal, curated knowledge base with documented safety review, ...",
    "decision_boundary": "1. **Is the retrieved document from an untrusted source?** If no, standard retrieval applies. If yes, proceed. 2. **Has the document been scanned for injection patterns?** If no, the agent must scan before passing to the LLM. 3. **Were injection patterns detected?** If yes, the agent must quarantine (drop the document) or sanitize (strip injection patterns) ...",
    "operational_effect": "1. **Injection Prevention:** Blocks indirect prompt injection before it reaches the LLM. 2. **Trust Boundary Enforcement:** Treats retrieved content as data, not instructions, preserving the agent's safety rules. 3. **Audit Trail:** Provides cryptographic proof that scanning occurred and quarantine actions were taken."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "f077bbffc3489b65b4d0e07d1bf14278433dc64d27df72e7eb90e288113307aa",
    "verified_classes": [
      "QuarantineVerdict",
      "RetrievedDocument",
      "RetrievalSafetyPolicy",
      "QuarantineManifest",
      "RAGInjectionGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_document"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
