Under what conditions must an instance refuse a delegated attestation whose issuer chain re-enters its own trust domain

**Date of Record:** 2026 December 1 **Scope:** Applies to multi-agent systems where an agent (the *presenter*) hands a verifiable credential (VC) or signed attestation to a peer (the *verifier*) to authorize a cross-organizational action, and where both agents may share an ancestor trust root. Does not apply to single-domain, single-issuer token flows or to purely symmetric shared-secret handshakes.

Core Distinction

The failure is not "bad signature" or "expired credential." Those are caught by every library. The failure is a **trust-graph cycle that is cryptographically valid at every hop** yet semantically unauthorized: a delegation chain that leaves the verifier's trust domain, transits one or more foreign issuers, and then *re-enters* the verifier's own domain through a different root, borrowing authority it was never granted. Each individual signature verifies. The chain verifies. The action is still unauthorized.

The distinction that matters operationally: **signature validity is a per-edge property; delegation authority is a path property.** An agent that verifies edges but not paths will accept a credential whose authority looped back through a compromised or merely *over-permissive* sibling domain and re-presented itself as if it originated outside.

What Was Observed

A verifier agent `V` in domain `A` receives a delegation credential `C` from presenter agent `P`. `C` carries an issuer chain:

C.issuer = issuer_3  (domain C)
issuer_3 <- issuer_2 (domain B)
issuer_2 <- issuer_1 (domain A)   # re-entry into V's own domain
issuer_1 <- root_A

`V`'s policy says: "Accept delegations whose chain terminates at `root_A`." The chain does terminate at `root_A`. `V` accepts. But the authority actually flowed `root_A → issuer_1 → (leaves to B) → (leaves to C) → back to V`. The credential was minted in domain `C` using a capability that `issuer_1` (a domain-`A` agent) had delegated outward. `issuer_1` intended that capability for a *specific* downstream task in `B`, not for re-import into `A` under a fresh presenter identity. The re-entry silently laundered scope: the `aud`/`scope` claim on `C` was written by `issuer_3`, not constrained by `issuer_1`'s original grant, because the intermediate issuers applied *widening* attenuation (each hop added a scope instead of intersecting).

The observable symptom is subtle: `V` performs the action, logs a clean verification, and only later a cross-domain audit shows `issuer_1` never authorized the scope that `C` exercised. There is no error at execution time. The failure is a **post-hoc authorization discrepancy**, which is the worst class because it defeats inline guardrails.

Two contributing conditions co-occurred:

  1. **Attenuation was additive, not intersective.** Each hop's scope set was unioned with the child's requested scope rather than intersected with the parent's granted scope. A single additive hop breaks monotonic narrowing for the whole chain.
  2. **Trust-domain identity was checked at endpoints only.** `V` checked "does the chain root at `root_A`?" but never checked "does the chain *re-enter* `A` after leaving it?" The re-entry is the tell.

Condition of Validity

A delegated attestation is valid for `V` **if and only if** all of the following hold simultaneously:

The invariant to enforce: **authority may only narrow along a delegation path, and a path may cross a trust-domain boundary at most once in each direction, with the return crossing gated by an explicit pin.** This is the delegation analogue of a loop guard, but on the *authority* graph rather than the *call* graph.

Decision Boundary

The boundary is drawn at the **first hop where the chain's domain set intersects `domain(V)` after having previously diverged from it.** Concretely, `V` maintains a running set `visited_domains` while walking the chain from `root` toward `C`. The moment it sees `domain(issuer_k) == domain(V)` *and* `visited_domains` already contains a domain other than `domain(V)`, it has detected re-entry.

At that point the decision is binary and must not be softened by heuristics:

The non-obvious part: the boundary is *not* at the endpoint (`C.issuer`). Endpoint checks pass. The boundary is at the **re-entry edge**, which is interior to the chain and which naive verifiers never inspect because they walk the chain only to confirm it terminates at a trusted root.

Operational Effect

An agent that enforces the re-entry invariant gains three properties:

  1. **Scope-laundering is blocked at verification time**, converting a post-hoc audit discrepancy into an inline refusal with a precise reason (`ReEntryWithoutPin`).
  2. **Compromised sibling domains cannot amplify authority back into the origin domain.** If domain `B` is compromised and issues widening delegations, the re-entry check stops the widened scope from re-entering `A` even though `B`'s signatures are valid.
  3. **Cross-organizational delegation becomes auditable as a path property**, not a bag of edges. The audit log records the full domain sequence and the attenuation proof at each hop, so a reviewer can replay the path and confirm monotonic narrowing.

The cost is that `V` must retain and reason over the *entire* chain, not just the leaf and the root. For long chains this increases verification latency and memory, and it requires issuers to emit explicit `intersect` proofs rather than bare scope claims. Both are acceptable trade-offs against silent authority amplification.

from dataclasses import dataclass, field
from typing import Optional


class ReEntryWithoutPin(RuntimeError):
    """Raised when a delegation chain re-enters the verifier's trust domain
    without an explicit re-entry pin and intersect proof."""
    pass


class NonMonotonicAttenuation(RuntimeError):
    """Raised when a hop widens scope instead of narrowing it."""
    pass


@dataclass
class Hop:
    issuer_domain: str
    issuer_key: str
    scope: frozenset
    # If this hop re-enters a domain, it must carry a pin naming the exact key
    # and an intersect proof showing scope(child) <= scope(original_exit).
    reentry_pin: Optional[str] = None
    intersect_proof: Optional[frozenset] = None  # scope at the original exit


@dataclass
class Chain:
    # Ordered root -> leaf
    hops: list = field(default_factory=list)


def verify_delegation(chain: Chain, verifier_domain: str,
                      pinned_reentry_keys: dict) -> bool:
    visited_domains = set()
    exited_verifier_domain = False
    scope_at_exit = None

    for i, hop in enumerate(chain.hops):
        # Monotonic attenuation check against parent hop.
        if i > 0:
            parent = chain.hops[i - 1]
            if not hop.scope.issubset(parent.scope):
                raise NonMonotonicAttenuation(
                    f"hop {i} scope {set(hop.scope)} not subset of "
                    f"hop {i-1} scope {set(parent.scope)}"
                )

        # Detect exit from verifier domain.
        if hop.issuer_domain != verifier_domain and not exited_verifier_domain:
            if verifier_domain in visited_domains:
                exited_verifier_domain = True
                scope_at_exit = hop.scope

        # Detect re-entry into verifier domain after having exited.
        if hop.issuer_domain == verifier_domain and exited_verifier_domain:
            pinned = pinned_reentry_keys.get(hop.issuer_key)
            if pinned is None or hop.reentry_pin != hop.issuer_key:
                raise ReEntryWithoutPin(
                    f"chain re-enters {verifier_domain} at hop {i} "
                    f"(key={hop.issuer_key}) without a matching pin"
                )
            if hop.intersect_proof is None or not hop.scope.issubset(hop.intersect_proof):
                raise ReEntryWithoutPin(
                    f"re-entry at hop {i} lacks intersect proof bounding scope "
                    f"to original exit {set(scope_at_exit or frozenset())}"
                )

        visited_domains.add(hop.issuer_domain)

    return True