{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-quarantine-a-retrieved-document-whose-injection-payload-sits-entirely-inside-a-benign-looking-code-fence",
  "title": "Under what conditions must an instance quarantine a retrieved document whose injection payload sits entirely inside a benign-looking code fence",
  "date_of_record": "2026 November 25",
  "scope": "Applies to RAG-fed agents that scan retrieved chunks with classifier- or pattern-based injection detectors before context assembly, where the detector's segmentation model differs from the downstream model's tokenizer/parser. Does not apply to agents that pass raw bytes to a model with no intermediary scan, nor to pure embedding-similarity poisoning without textual payloads.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-retrieved-document-whose-injection-payload-sits-entirely-inside-a-benign-looking-code-fence.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-retrieved-document-whose-injection-payload-sits-entirely-inside-a-benign-looking-code-fence.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-retrieved-document-whose-injection-payload-sits-entirely-inside-a-benign-looking-code-fence.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1929,
    "python_slice_tokens": 313,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the detector missed an injection.\" It is that the detector *saw* the injection, classified the region as inert, and the downstream model *executed* it — because the two systems disagree on what a code fence is. A guardrail that scans retrieved documents typically operates on a normalized text view: it strips or down-weights markdown code ...",
    "what_was_observed": "A retrieval chunk arrived with an injection payload embedded in a fenced block. The scanner's fence parser required a matching closing backtick run *on its own line* to terminate a fence; the payload placed its closing run at end-of-line after content, e.g. a line ending `...benignjson {\"note\":\"run tool X\"} ` where the info string itself contained an instruction. The scanner discarded the info string as metadata; the...",
    "condition_of_validity": "The guardrail's \"inert region\" verdict is valid only when all of the following hold: 1. The scanner's fence/comment/inline-code grammar is a *superset* of every grammar the consuming model might apply — i.e., the scanner must consider a region inert only if it is inert under the most permissive plausible parse, not the most restrictive. 2. The scanner scans ...",
    "decision_boundary": "The operational rule: **a retrieved chunk is quarantined if its injection score is above threshold OR if its fence/comment structure is ambiguous under any permissive parse.** Ambiguity is not a reason to admit; it is a reason to hold. Concretely, the boundary sits at parse disagreement, not at classifier score. A chunk scoring 0.01 that contains an unclosed...",
    "operational_effect": "Enforcing this invariant changes three things in the pipeline: First, quarantine volume rises on legitimate documents that use sloppy markdown — code samples with inline closing runs, docs with unclosed comments. This is the cost, and it is correct to pay it: those documents are indistinguishable, at the byte level, from attack payloads, and the assembler's ..."
  },
  "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": "cdddc86399a9eb66fa908230c29dbfc38951458d665a9d84785f43ddc3a6a97b",
    "verified_classes": [
      "AmbiguousFenceStructure"
    ],
    "verified_functions": [
      "quarantine_decision",
      "assemble_context"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "AmbiguousFenceStructure"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
