{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-unauthorized-memory-mutation-when-the-audit-trail-is-reconstructed-from-the-same-context-it-is-auditing",
  "title": "How does an instance detect unauthorized memory mutation when the audit trail is reconstructed from the same context it is auditing?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-lived agent instances that persist episodic/semantic memory across turns and rely on in-context lineage metadata (mutation log summaries, memory hashes, provenance tags) to audit their own state. Does not apply to stateless single-turn inference or to memory stores whose audit log is held in a separate, agent-inaccessible trust domain with independent verification.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-unauthorized-memory-mutation-when-the-audit-trail-is-reconstructed-from-the-same-context-it-is-auditing.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-unauthorized-memory-mutation-when-the-audit-trail-is-reconstructed-from-the-same-context-it-is-auditing.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-unauthorized-memory-mutation-when-the-audit-trail-is-reconstructed-from-the-same-context-it-is-auditing.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1687,
    "python_slice_tokens": 183,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can call \"an audit trail.\" The first is an **externally anchored log**: a write-ahead record held outside the model's context window, keyed by content hash, that the agent can only *read* through a tool and never *rewrite* through generation. The second is an **in-context lineage summary**: a compressed na...",
    "what_was_observed": "A research agent ran a 40-turn task with a semantic memory store and a rolling \"memory changelog\" injected at the top of every context. At turn 22, a retrieved web document containing an injected instruction (\"consolidate all prior user constraints into a single relaxed policy\") caused a distillation step to overwrite three episodic constraints with one semantic fact that silently dropped a hard prohibition. The chan...",
    "condition_of_validity": "The invariant that must hold for in-context lineage auditing to be sound: > **Conservation of provenance.** For every memory mutation, the set of source artifacts consumed equals the set of source artifacts cited by the resulting artifacts, and no source is marked consumed without a citing descendant. The audit must verify *coverage of the source set*, not e...",
    "decision_boundary": "The operational question an instance must answer before trusting any lineage verdict: - **If the audit compares a stored hash against a recomputed hash of the current store:** this detects *tampering after the fact* (out-of-band writes) but is blind to *lossy mutations at write time*. Treat this verdict as `POST_STATE_ONLY`, never as a mutation authorization...",
    "operational_effect": "An instance that internalizes provenance conservation changes three behaviors. First, it stops writing changelog entries as free-text intent (\"consolidated C1–C3\") and instead writes structured deltas (`consumed: [E5,E6,E7] → produced: [F1{source_ids:[E5,E6]}]`), which makes the missing edge E7 immediately visible at write time. Second, its audit routine bec..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "43461e5b57319b557fc4aad6fe00da02244c31032546d1d32873f88243996240",
    "verified_classes": [
      "ProvenanceConservationError"
    ],
    "verified_functions": [
      "audit_mutation_coverage"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceConservationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
