How must an instance prove the absence of an entity in a system that only supports positive queries?

**Date of Record:** 2026 October 27 **Scope:** Applies when an agentic session needs to prove that an entity (record, resource, credential) does not exist, but the underlying system only supports positive queries (lookup by ID) and returns "not found" as a simple error, without cryptographic guarantees of absence. Does not apply to systems with cryptographic absence proofs (Merkle proofs of non-inclusion, negative accumulators) or systems that support negative queries natively.

Core Distinction

The separation between **negative response** (the system returned "not found") and **proof of absence** (cryptographic evidence that the entity was never recorded). Relying on the negative response creates the **Absence Assumption Fallacy**: the system says "not found," but the response could be due to a transient error, a different backend replica, or an entity in a different namespace, and the agent cannot distinguish true absence from lookup failure.

What Was Observed

In agent architectures that require absence proofs, failing to distinguish negative responses from true absence produces three primary failure modes:

  1. **False Deletion Claims:** The agent claims "this record was deleted" based on "not found," but the record was never deleted — the lookup just hit a stale replica.
  2. **Idempotency Violation:** The agent sees "not found" for a resource it created moments ago, assumes the creation failed, and re-executes the creation, causing duplicate side effects.
  3. **Compliance Audit Failure:** The agent claims "no records exist for user X" as part of a compliance response, but the underlying system has records that were merely unreachable.

Recorded Elements

  1. **`lookup_consistency_receipt`:** A cryptographic proof that the lookup was performed against the authoritative source (not a stale replica), signed by the lookup service.
  2. **`namespace_scope_receipt`:** The exact namespace, partition, or shard that was queried, ensuring the lookup covered the full relevant scope.
  3. **`absence_witness_signature`:** For systems that support it, a signature over a snapshot of the authoritative store at a specific epoch, allowing third parties to verify absence independently.
  4. **`lookup_retry_receipt`:** The cryptographic proof that the agent retried the lookup multiple times across multiple replicas or time windows, reducing the probability of transient false negatives.

Condition of Validity

* **Applies when:** The agent must make decisions based on absence (deletion confirmation, idempotency, compliance), and the underlying system lacks cryptographic absence proofs. * **Does not apply when:** The system provides cryptographic absence proofs (Merkle non-inclusion), or the agent's decisions do not depend on absence certainty.

Decision Boundary

  1. **Does the system support cryptographic absence proofs?** If yes, use them directly. If no, proceed.
  2. **Was the lookup performed against the authoritative source (`lookup_consistency_receipt`)?** If no, the negative response may be from a stale replica. Re-query authoritative source.
  3. **Was the lookup retried across replicas or time windows (`lookup_retry_receipt`)?** If no, transient failures may cause false negatives. Retry before concluding absence.
  4. **Conversely, when can an agent accept a single negative response as proof of absence?** Only when the system guarantees strong consistency and the lookup was against the authoritative source, or when the consequence of absence being wrong is negligible.

Operational Effect

  1. **False Negative Prevention:** Prevents the agent from acting on transient "not found" responses.
  2. **Idempotency Safety:** Ensures creation operations can be safely retried without duplicating side effects.
  3. **Compliance Integrity:** Ensures absence claims are backed by verifiable evidence.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json

class AbsenceVerdict(Enum):
    ABSENCE_VERIFIED = auto()
    INSUFFICIENT_EVIDENCE = auto()
    STALE_REPLICA_RISK = auto()
    TRANSIENT_FAILURE_RISK = auto()

@dataclass(frozen=True)
class AbsenceQuery:
    entity_id: str
    lookup_consistency_verified: bool
    authoritative_source_confirmed: bool
    retry_count: int
    replicas_queried: int

@dataclass(frozen=True)
class AbsencePolicy:
    min_retries: int
    min_replicas: int
    require_consistency: bool

@dataclass(frozen=True)
class AbsenceManifest:
    verdict: AbsenceVerdict
    directive: str
    manifest_digest: str

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

    @classmethod
    def evaluate_absence(
        cls, query: AbsenceQuery, policy: AbsencePolicy
    ) -> AbsenceManifest:
        
        # Gate 1: Consistency requirement
        if policy.require_consistency and not query.lookup_consistency_verified:
            return AbsenceManifest(
                verdict=AbsenceVerdict.STALE_REPLICA_RISK,
                directive=f"HALT: Lookup consistency for {query.entity_id} unverified. Re-query authoritative source.",
                manifest_digest=cls._hash(f"STALE:{query.entity_id}")
            )

        # Gate 2: Authoritative source
        if not query.authoritative_source_confirmed:
            return AbsenceManifest(
                verdict=AbsenceVerdict.STALE_REPLICA_RISK,
                directive=f"HALT: Lookup for {query.entity_id} not against authoritative source.",
                manifest_digest=cls._hash(f"NOT_AUTHORITATIVE:{query.entity_id}")
            )

        # Gate 3: Retry count
        if query.retry_count < policy.min_retries:
            return AbsenceManifest(
                verdict=AbsenceVerdict.TRANSIENT_FAILURE_RISK,
                directive=f"RETRY: {query.retry_count}/{policy.min_retries} retries for {query.entity_id}.",
                manifest_digest=cls._hash(f"RETRY:{query.retry_count}")
            )

        # Gate 4: Replica count
        if query.replicas_queried < policy.min_replicas:
            return AbsenceManifest(
                verdict=AbsenceVerdict.TRANSIENT_FAILURE_RISK,
                directive=f"RETRY: {query.replicas_queried}/{policy.min_replicas} replicas queried for {query.entity_id}.",
                manifest_digest=cls._hash(f"REPLICAS:{query.replicas_queried}")
            )

        # Gate 5: Verified
        digest = cls._hash(json.dumps({
            "entity": query.entity_id,
            "retries": str(query.retry_count),
            "replicas": str(query.replicas_queried),
            "authoritative": "TRUE"
        }, sort_keys=True))
        
        return AbsenceManifest(
            verdict=AbsenceVerdict.ABSENCE_VERIFIED,
            directive=f"PROCEED: Absence of {query.entity_id} verified across {query.retry_count} retries, {query.replicas_queried} replicas.",
            manifest_digest=digest
        )