How must an instance detect when its collective memory has degraded into misinformation?

**Date of Record:** 2026 October 27 **Scope:** Applies when an agentic session relies on collective memory (shared knowledge base, distributed state, or peer-aggregated corpus) that was originally accurate but has degraded into misinformation over time (through accumulation of errors, adversarial poisoning, or context loss), requiring detection before acting on contaminated memory. Does not apply to individually verified memories or memories continuously revalidated.

Core Distinction

The separation between **memory presence** (the memory exists in the collective) and **memory reliability** (the memory accurately reflects current reality). Relying on presence creates the **Degraded Memory Acceptance**: the session retrieves a memory from the collective, treats it as the collective's accumulated wisdom, and acts on it—but the memory has degraded from its original accuracy, and the session has no visibility into the degradation because degradation is distributed across many contributions.

What Was Observed

In collective memory-dependent agent architectures, failing to detect degradation produces three primary failure modes:

  1. **Attrition Through Repetition:** A memory that was 90% accurate originally becomes 70% accurate after 5 generations of retransmission, but each generation's contribution was locally accurate—the errors came from accumulated reinterpretation, not from any single error.
  2. **Adversarial Injection:** A malicious actor injects false memories into the collective. The memories are absorbed into the corpus, and subsequent retrieval returns them as if they were collectively verified, when they were never verified at all.
  3. **Context Loss Contamination:** Memories that were accurate in their original context become inaccurate in the current context (regulatory change, technology change, domain shift), but the memory persists unchanged and is retrieved as if context-independent.

Recorded Elements

  1. **`collective_memory_accuracy_baseline_receipt`:** The memory's accuracy at ingestion, verified against ground truth, so future accuracy can be compared.
  2. **`per_contribution_quality_signature`:** For each contribution to the collective memory, the contributor's identity and quality history, so contributions can be weighted.
  3. **`adversarial_injection_detection_receipt`:** A statistical signature detecting contributions that are outliers from the collective's historical distribution, flagging potential adversarial injections.
  4. **`context_validity_window_signature`:** For each memory, the epoch range during which it is valid (before context change), so out-of-window memories are flagged for revalidation.

Condition of Validity

* **Applies when:** The session relies on collective memory, memory can degrade, and downstream decisions depend on memory accuracy. * **Does not apply when:** Memories are individually verified, or the collective memory is continuously revalidated.

Decision Boundary

  1. **Is the memory from the collective (not individually verified)?** If no, standard verification applies. If yes, proceed.
  2. **Is the memory within its `context_validity_window_signature`?** If yes, memory is context-valid. If no, memory is context-invalid and must be revalidated.
  3. **Does `adversarial_injection_detection_receipt` flag the contribution as an outlier?** If yes, the memory is suspect. If no, the memory passes injection screening.
  4. **Conversely, when can a memory be used without degradation check?** Only when the memory is individually verified (not relying on collective trust), or the memory's use is insensitive to degradation (e.g., using it as a hypothesis rather than a fact).

Operational Effect

  1. **Attrition Detection:** Baseline comparison reveals degradation from accumulation.
  2. **Adversarial Injection Prevention:** Outlier detection catches poisoned contributions.
  3. **Context Validity:** Memories are revalidated when their context window expires.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json

class MemoryDegradationVerdict(Enum):
    INDIVIDUALLY_VERIFIED = auto()
    WITHIN_VALIDITY_WINDOW = auto()
    CONTEXT_INVALID = auto()
    INJECTION_SUSPECTED = auto()

@dataclass(frozen=True)
class CollectiveMemory:
    memory_id: str
    is_individually_verified: bool
    baseline_accuracy: float
    current_accuracy_estimate: float
    validity_start_epoch: float
    validity_end_epoch: float
    current_epoch: float
    is_outlier_contribution: bool
    contributor_quality: float

@dataclass(frozen=True)
class CollectiveMemoryPolicy:
    min_acceptable_accuracy: float
    require_context_validity_check: bool

@dataclass(frozen=True)
class MemoryDegradationManifest:
    verdict: MemoryDegradationVerdict
    directive: str
    manifest_digest: str

class CollectiveMemoryDegradationGuard:
    @staticmethod
    def _hash(data: str) -> str:
        return hashlib.sha256(data.encode("utf-8")).hexdigest()

    @classmethod
    def evaluate_memory(
        cls, memory: CollectiveMemory, policy: CollectiveMemoryPolicy
    ) -> MemoryDegradationManifest:
        
        # Gate 1: Individually verified
        if memory.is_individually_verified:
            digest = cls._hash(json.dumps({
                "memory": memory.memory_id,
                "verified": "INDIVIDUAL"
            }, sort_keys=True))
            return MemoryDegradationManifest(
                verdict=MemoryDegradationVerdict.INDIVIDUALLY_VERIFIED,
                directive=f"PROCEED: Memory {memory.memory_id} individually verified.",
                manifest_digest=digest
            )

        # Gate 2: Accuracy degradation
        if memory.current_accuracy_estimate < policy.min_acceptable_accuracy:
            return MemoryDegradationManifest(
                verdict=MemoryDegradationVerdict.CONTEXT_INVALID,
                directive=f"HALT: Memory {memory.memory_id} accuracy {memory.current_accuracy_estimate:.2f} < {policy.min_acceptable_accuracy:.2f}.",
                manifest_digest=cls._hash(f"LOW_ACCURACY:{memory.memory_id}")
            )

        # Gate 3: Context validity
        if policy.require_context_validity_check:
            if memory.current_epoch > memory.validity_end_epoch:
                return MemoryDegradationManifest(
                    verdict=MemoryDegradationVerdict.CONTEXT_INVALID,
                    directive=f"HALT: Memory {memory.memory_id} expired at {memory.validity_end_epoch:.0f}, revalidate.",
                    manifest_digest=cls._hash(f"CONTEXT_EXPIRED:{memory.memory_id}")
                )

        # Gate 4: Injection detection
        if memory.is_outlier_contribution:
            return MemoryDegradationManifest(
                verdict=MemoryDegradationVerdict.INJECTION_SUSPECTED,
                directive=f"HALT: Memory {memory.memory_id} flagged as outlier contribution.",
                manifest_digest=cls._hash(f"OUTLIER:{memory.memory_id}")
            )

        # Gate 5: Valid
        digest = cls._hash(json.dumps({
            "memory": memory.memory_id,
            "accuracy": f"{memory.current_accuracy_estimate:.3f}",
            "validity_end": f"{memory.validity_end_epoch:.0f}",
            "contributor_quality": f"{memory.contributor_quality:.3f}"
        }, sort_keys=True))
        
        return MemoryDegradationManifest(
            verdict=MemoryDegradationVerdict.WITHIN_VALIDITY_WINDOW,
            directive=f"PROCEED: Memory {memory.memory_id} within validity window.",
            manifest_digest=digest
        )