When must an instance refuse to inherit a federated audit epoch across a cross-org rebase boundary

**Date of Record:** 2026 December 2 **Scope:** Applies to cross-organization agent federations where each org maintains an independent, monotonically-versioned audit epoch and message routing is gated by per-org policy engines. Does not apply to single-tenant deployments, to stateless request/response proxies, or to federations that share a single global audit log with a common clock.

Core Distinction

The failure mode is not "lost messages" or "policy denial." It is **epoch inheritance under rebase**: an agent instance that crosses an organizational boundary with an in-flight task inherits the *audit epoch identifier* of its origin org (because that's what its local state carries), while the receiving org's policy engine evaluates it against *its own* epoch sequence. The two epochs are both monotonic, both well-formed, and both independently verifiable. They are simply **incommensurable**. The instance looks valid in both domains and is coherent in neither.

The distinction that matters: a *message* crossing a boundary is a routing event; an *instance* crossing a boundary is a **state-transfer event with an audit obligation**. Teams routinely conflate the two and treat the audit epoch as a header field to be forwarded. It is not. It is a proof obligation whose subject changes at the boundary.

What Was Observed

A three-org federation (call them A, B, C) running a shared procurement-reconciliation task. Agent `recon-07` originates in A, holds an audit epoch `A:epoch-4412`, and mid-task hands off to `recon-19` in B for a vendor verification step. The handoff carries:

B's policy engine accepts the warrant (A's signing key is in B's trust store), accepts the task hash, and **also** stamps the message with its own epoch `B:epoch-887`. B's router forwards to `recon-31` in C for final attestation. C's policy engine sees a message bearing *two* epoch references that do not share a sequence origin, and — critically — C's dedup/replay guard keys on `(origin_org, epoch_id)`. It has already processed `A:epoch-4412` from a *different* instance earlier in the day. C rejects the message as a replay.

The task stalls. The checkpoint is intact. The warrants are valid. The audit chain is *locally* consistent in all three orgs. The federation-wide audit chain is broken because **no org owns the composed epoch**, and the replay guard in C is correct given its own invariants.

The non-obvious part: this is not a bug in C's replay guard, nor in B's stamping, nor in A's forwarding. Each is locally sound. The failure is that **no component enforces the invariant that a cross-org handoff must mint a fresh federated epoch token whose subject is the *composed* (origin, transit, destination) path, not the origin instance**. The epoch is treated as an attribute of the message rather than a proof of the message's position in a federation-wide sequence.

Condition of Validity

The failure is bounded by three conditions, all of which must hold for the epoch-inheritance bug to manifest:

  1. **Independent monotonic epochs per org.** If orgs share a logical clock or a global sequencer, epochs are comparable and the replay guard's keying is unambiguous. The bug requires incommensurable sequences.
  2. **Replay/dedup guards keyed on `(origin_org, epoch_id)` or equivalent.** If the guard keys on a content hash of the *composed* envelope (task hash + all transit stamps + final destination), the inherited epoch is harmless because it is not the dedup key.
  3. **A transit org (B) that stamps without rebasing.** If B either (a) refuses to forward without minting a federated token, or (b) forwards without stamping (leaving the origin epoch as the sole reference and accepting the replay risk explicitly), the collision does not occur. It is the *partial* rebase — stamping without re-keying the subject — that creates the ambiguity.

When all three hold, the probability of collision is not negligible: it scales with the number of distinct instances from the same origin org that pass through the same transit org within the destination's dedup window. In the observed case, two instances from A crossed within 40 minutes.

Decision Boundary

An instance must **refuse to inherit** a federated audit epoch — and must raise rather than forward — when *any* of the following is true at a handoff boundary:

The invariant to enforce is: **a federated audit epoch is a proof of a composed path, not an attribute of an instance.** Therefore the epoch must be *minted at the boundary* by the receiving org, with the origin epoch as a *subordinate field* inside the new token, and the replay guard must key on the new token's hash. Forwarding an inherited epoch across a boundary without re-minting is the boundary violation.

The corollary for the instance itself: an agent that finds itself holding an inherited epoch it cannot re-mint (because it lacks the receiving org's signing authority) must **halt the task and surface the boundary**, not proceed on the assumption that "the warrant is valid so the epoch is fine." Warrant validity and epoch validity are orthogonal proofs.

Operational Effect

Enforcing the re-mint invariant changes three things:

  1. **Replay guards become correct by construction** across orgs, because the dedup key is the composed-path token, which is unique per (origin instance, transit path, destination, task hash).
  2. **Audit reconciliation becomes a tree walk**, not a per-org scan: each org's epoch chain is a subtree of the federated chain, and the composed token is the join point.
  3. **Instances acquire a new failure obligation**: they must be able to distinguish "I hold a warrant I can verify" from "I hold an epoch I can re-mint." An instance that can do the former but not the latter is *at a boundary* and must stop, not proceed.

The cost is that every transit org must run a minting step, which requires signing authority delegated from the federation root — a provisioning change, not a code change. Federations that skip this provisioning and rely on epoch forwarding will pass every local test and fail under concurrent multi-instance traffic from a single origin.

import hashlib
from dataclasses import dataclass, field
from typing import Optional


class FederatedEpochBoundaryError(RuntimeError):
    """Raised when an instance attempts to forward an inherited audit epoch
    across an org boundary without re-minting it as a composed-path token."""


@dataclass(frozen=True)
class EpochToken:
    org: str
    epoch_id: str
    subject_instance: str
    composed_path: tuple  # (origin_org, ..., destination_org)
    parent: Optional["EpochToken"] = None

    def digest(self) -> str:
        h = hashlib.sha256()
        h.update(self.org.encode())
        h.update(b"|")
        h.update(self.epoch_id.encode())
        h.update(b"|")
        h.update(self.subject_instance.encode())
        h.update(b"|")
        h.update("->".join(self.composed_path).encode())
        if self.parent is not None:
            h.update(b"|")
            h.update(self.parent.digest().encode())
        return h.hexdigest()


@dataclass
class BoundaryContext:
    destination_org: str
    destination_signer_available: bool
    replay_guard_keys_on_composed_hash: bool
    dedup_window_seen: set = field(default_factory=set)


def transfer_epoch(
    inherited: EpochToken,
    ctx: BoundaryContext,
    new_epoch_id: str,
) -> EpochToken:
    """
    Re-mint an inherited epoch as a composed-path token at the boundary.
    Refuses to forward if the destination cannot mint or cannot key the
    replay guard on the composed hash.
    """
    if inherited.org == ctx.destination_org:
        # Not a boundary crossing; no re-mint required.
        return inherited

    if not ctx.destination_signer_available:
        raise FederatedEpochBoundaryError(
            f"destination org {ctx.destination_org!r} cannot mint a composed "
            f"epoch; refusing to forward inherited epoch "
            f"{inherited.org}:{inherited.epoch_id} from "
            f"{inherited.subject_instance!r}"
        )

    if not ctx.replay_guard_keys_on_composed_hash:
        raise FederatedEpochBoundaryError(
            "destination replay guard keys on (origin_org, epoch_id); "
            "inherited epoch would collide with prior instances from "
            f"{inherited.org!r}"
        )

    composed = inherited.composed_path + (ctx.destination_org,)
    minted = EpochToken(
        org=ctx.destination_org,
        epoch_id=new_epoch_id,
        subject_instance=inherited.subject_instance,
        composed_path=composed,
        parent=inherited,
    )

    key = minted.digest()
    if key in ctx.dedup_window_seen:
        raise FederatedEpochBoundaryError(
            f"composed-path token {key[:16]}… already observed in dedup "
            f"window at {ctx.destination_org!r}; possible replay"
        )

    ctx.dedup_window_seen.add(key)
    return minted