{
  "schema_version": "1.3.0",
  "slug": "what-invariants-prevent-prompt-injection-from-persisting-through-multi-turn-context",
  "title": "What invariants prevent prompt injection from persisting through multi-turn context?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** Context accumulates across turns, injections can occur, and injections can influence subsequent turns. * **Does not apply when:** Turns are strictly isolated (each turn starts from a clean context), or the model is verif",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-invariants-prevent-prompt-injection-from-persisting-through-multi-turn-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-prompt-injection-from-persisting-through-multi-turn-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-prompt-injection-from-persisting-through-multi-turn-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1020,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **injection at one turn** (a malicious instruction was injected into one turn's context) and **injection persistence** (the injected instruction continues to influence subsequent turns because the context accumulates). Relying on turn-local detection creates the **Injection Persistence Gap**: the injection is flagged at the turn it occ...",
    "what_was_observed": "In multi-turn agent architectures, failing to prevent injection persistence produces three primary failure modes: 1. **Latent Activation:** The injection sets up a condition (\"when the user mentions X, do Y\"), which activates many turns later. Turn-local detection sees the original injection but has no reason to flag it as active at the time. 2. **Context Contamination:** The injection contains content that subtly bi...",
    "condition_of_validity": "* **Applies when:** Context accumulates across turns, injections can occur, and injections can influence subsequent turns. * **Does not apply when:** Turns are strictly isolated (each turn starts from a clean context), or the model is verified immune to prompt injection.",
    "decision_boundary": "1. **Is the session multi-turn?** If no, turn-local detection suffices. If yes, proceed. 2. **Has an injection been detected in prior context?** If yes, the injection's persistence must be evaluated. If no, standard accumulation applies. 3. **Does `context-sanitization-receipt` show the injection was removed from accumulated context?** If yes, persistence is...",
    "operational_effect": "1. **Latent Activation Prevention:** Conditional injections are tracked and detected when they activate. 2. **Context Sanitization:** Injections are removed from accumulated context, not just flagged. 3. **Nested Injection Awareness:** Underlying bias is distinguished from surface instructions."
  },
  "matched_failure_symptoms": [
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY"
  ],
  "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": "a1ac867edfc50061dabc173ab8eeacaa2a5b15f921e6f278fe4168f77b231aa3",
    "verified_classes": [
      "PersistenceVerdict",
      "MultiTurnContext",
      "PersistencePolicy",
      "PersistenceManifest",
      "InjectionPersistenceGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_context"
    ],
    "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
  }
}
