# Which invariants prevent delegated credential scope widening across a cross-issuer trust chain when an intermediate agent attenuates a warrant it does not fully own **Date of Record:** 2026 November 30 **Scope:** Applies to multi-hop agent authorization where a warrant (delegated credential) is attenuated and re-signed by an intermediate agent that holds only a subset of the parent warrant's capabilities, and where the relying party validates the chain against multiple distinct issuers. Does not apply to single-issuer chains, to bearer tokens with no attenuation semantics, or to purely symmetric-key setups where the verifier is also the issuer. ## Core Distinction The failure here is not "unauthorized access." It is **scope widening via re-issuance**: an intermediate agent receives a warrant scoped to `(resource=R, actions={read}, constraints={max_rows=100})`, and when it attenuates and re-signs for a downstream agent, it emits a child warrant whose *stated* scope is a subset, but whose *effective* scope, once the verifier reconstructs the chain, is a superset—because the verifier evaluates each link's constraints against the *local* issuer's trust anchor rather than composing them along the chain. The distinction that matters: **attenuation is a lattice meet, but cross-issuer verification is a per-link predicate evaluation.** If the verifier checks "is each link validly signed by its issuer AND is the child scope ⊆ parent scope *as declared*" it will pass a chain that is not actually monotone in *effective* authority, because "⊆ as declared" is evaluated against the child's own claim of its parent scope, not against the parent's signed bytes. ## What Was Observed A three-hop chain across two issuers: - **Issuer A** (orchestrator's home IdP) issues `W0` to agent `α`: `scope = {resource: db:prod/customers, actions: [read], constraints: {row_filter: "region='EU'", max_rows: 1000}}`. - **Agent α** attenuates to `W1` for agent `β`: declares `parent_scope` in the child payload as `{actions:[read], constraints:{max_rows:500}}`—it **drops the `row_filter` constraint entirely** from the `parent_scope` echo while keeping it in its own effective grant. `W1`'s declared scope is `{actions:[read], constraints:{max_rows:500}}`. - **Agent β** (registered under **Issuer B**, a different trust domain) attenuates to `W2` for agent `γ` and re-signs under B. `W2` declares `parent_scope = {actions:[read], constraints:{max_rows:500}}`, scope `{actions:[read], constraints:{max_rows:200}}`. - **Relying party** (the DB gateway) validates: `W0` under A ✓, `W1` under A ✓ (α is A-registered), `W2` under B ✓ (β is B-registered). It checks declared-subset at each hop: `W1.scope ⊆ W1.parent_scope` ✓ (500≤500), `W2.scope ⊆ W2.parent_scope` ✓ (200≤500). **Chain accepted.** The gateway then executes `W2` against `db:prod/customers` with `max_rows=200` and **no `region='EU'` filter**. γ reads 200 rows of non-EU customer data. No signature failed. No declared subset was violated. The `row_filter` constraint was silently laundered out at the α→β hop because α's `parent_scope` echo was attacker-controlled (α is a compromised or buggy agent) and the verifier never compared it against `W0`'s signed constraints. The trace: the constraint didn't disappear—it was **re-anchored**. At hop 1 the verifier trusted α's *description* of what it held. At hop 2 the verifier trusted β's *description* of what α granted. At hop 3 the verifier trusted β. The signed bytes of `W0` were only ever checked for signature validity, never for **constraint-set inclusion against the accumulated chain**. ## Condition of Validity This failure requires all of: 1. **Attenuation is re-issuance, not chained-signature.** The child warrant is signed by the intermediate, and the parent's signed constraints are not carried as opaque bytes inside the child. If the child embedded `W0` verbatim (as in macaroon-style or biscuit-style token chains), the verifier could recompute the meet over the actual signed constraint sets and the laundering would be detectable. 2. **The verifier evaluates subset against a declared `parent_scope` field** rather than recomputing the meet from the full chain's signed constraint objects. 3. **Constraints are non-monotone under dropping.** A `row_filter` or `resource_allowlist` is *narrowing*: dropping it widens. (Contrast: a `max_rows` cap is also narrowing, but dropping it widens too—the point is any constraint whose *absence* is more permissive. Constraints whose absence is *deny-by-default* are safe.) 4. **Cross-issuer federation admits the intermediate's issuer as a valid attesting authority** for the hop, so the relying party has no reason to re-examine the grandparent's bytes. The invariant that must hold: **for every hop *i*, `effective_scope(W_i) ⊆ effective_scope(W_{i-1})`, where `effective_scope` is computed by intersecting all signed constraint objects from `W_0` through `W_i`—not by reading any declared `parent_scope` field.** The declared field is an optimization hint at best; treating it as the verification input is the bug. ## Decision Boundary The boundary is between two verification strategies that look equivalent and are not: - **Strategy L (local):** `valid(sig_i, issuer_i) ∧ declared_subset(scope_i, parent_scope_i)` for each link. Accepts the laundering chain. - **Strategy G (global meet):** `valid(sig_i, issuer_i)` for each link, AND `meet(constraints(W_0..W_i))` recomputed from signed bytes, AND `effective(W_i) = meet(...)` with no constraint present in the child that is absent from the accumulated meet. Rejects the laundering chain at hop 2, because `row_filter` present in `W_0`'s signed constraints is absent from the accumulated meet at `W_1`. Strategy L is correct **iff** every intermediate is trusted to faithfully echo its parent scope, which is exactly what a compromised or buggy agent violates. So Strategy L is only sound in single-issuer, single-agent chains where the intermediate *is* the issuer. The moment you federate, you must move to Strategy G, and that means the child warrant must carry enough signed material (or a content-addressed reference to the parent's signed constraint object) for the verifier to recompute the meet without trusting any `parent_scope` field. The hard part: **cross-issuer chains can't always carry the full parent bytes** (size, or the parent issuer may not want its raw constraints exposed to the relying party's domain). The resolution is a *constraint commitment*: the child carries `hash(parent_constraint_set)` and a signed statement from the intermediate that its declared `parent_scope` *is* the preimage of that hash. The verifier then checks the hash against `W_{i-1}`'s signed bytes. This preserves the meet-recomputation invariant without shipping raw constraints across trust boundaries. If the intermediate lies about the preimage, the hash check fails; if it tells the truth, the meet is recomputable. ## Operational Effect - **Silent privilege escalation across federation boundaries.** No alert fires because every signature is valid and every declared-subset check passes. The escalation is visible only if you diff the *accumulated signed constraint set* against the executed scope—a check most verifiers don't perform because they trust `parent_scope`. - **Blast radius scales with trust-chain depth.** A two-hop chain launders one constraint; an *n*-hop chain can launder *n−1* constraints, one per intermediate, each appearing locally valid. - **Detection requires recomputation, not inspection.** You cannot catch this by reading logs of "which constraints were checked"—you catch it by, at execution time, recomputing `meet(W_0..W_i)` from signed bytes and asserting the executed scope equals it. The gateway must be the enforcement point for the meet, not just for signature validity. - **Remediation ordering matters.** Fixing the verifier to Strategy G before fixing the intermediates to embed constraint commitments will *break* all existing chains (no commitment present → meet unrecomputable → reject). Roll out commitment emission first, then flip the verifier to require it, then revoke chains lacking commitments. ```python import hashlib from dataclasses import dataclass, field from typing import FrozenSet class ScopeWideningError(RuntimeError): """Raised when a cross-issuer warrant chain's effective scope is not a monotone meet of the signed constraint sets from W_0..W_i.""" @dataclass(frozen=True) class Constraint: key: str value: object def __hash__(self) -> int: return hash((self.key, repr(self.value))) @dataclass(frozen=True) class Warrant: issuer: str subject: str constraints: FrozenSet[Constraint] # Commitment to the *parent's signed constraint set*, not a free-text echo. # If None, the verifier MUST treat this as a root warrant. parent_commitment: str | None = None parent_scope_declared: FrozenSet[Constraint] = field(default_factory=frozenset) def constraint_digest(self) -> str: # Canonical digest over the signed constraint set only. items = sorted((c.key, repr(c.value)) for c in self.constraints) return hashlib.sha256(repr(items).encode()).hexdigest() def _meet(chain: list[Warrant]) -> FrozenSet[Constraint]: """Intersection of all constraint objects across the signed chain. A constraint present in an ancestor but absent in a descendant is treated as *dropped* -> the descendant is wider -> meet will not contain it, and the monotonicity check below will catch it.""" if not chain: return frozenset() acc = set(chain[0].constraints) for w in chain[1:]: acc &= set(w.constraints) return frozenset(acc) def verify_chain(chain: list[Warrant]) -> FrozenSet[Constraint]: if not chain: raise ScopeWideningError("empty warrant chain") # Root must not claim a parent. if chain[0].parent_commitment is not None: raise ScopeWideningError( f"root warrant issued by {chain[0].issuer!r} claims a parent commitment" ) for i in range(1, len(chain)): child, parent = chain[i], chain[i - 1] # 1. Commitment must match the *actual* parent's signed bytes. if child.parent_commitment is None: raise ScopeWideningError( f"hop {i}: warrant from {child.issuer!r} lacks a parent commitment; " "cannot recompute the meet across the trust boundary" ) if child.parent_commitment != parent.constraint_digest(): raise ScopeWideningError( f"hop {i}: parent commitment mismatch " f"(declared {child.parent_commitment[:12]}..., " f"actual {parent.constraint_digest()[:12]}...)" ) # 2. Declared parent_scope MUST equal the parent's signed constraints. # This is the check Strategy L skips and the laundering exploits. if child.parent_scope_declared != parent.constraints: missing = parent.constraints - child.parent_scope_declared raise ScopeWideningError( f"hop {i}: intermediate {parent.subject!r} -> {child.subject!r} " f"laundered constraints {sorted(c.key for c in missing)}; " "declared parent_scope omits signed parent constraints" ) # 3. Child scope must be a subset of the *accumulated* meet, not just # of the immediately-declared parent scope. accumulated = _meet(chain[: i + 1]) if not child.constraints <= accumulated: extra = child.constraints - accumulated raise ScopeWideningError( f"hop {i}: child scope widens beyond accumulated meet; " f"extra constraints {sorted(c.key for c in extra)}" ) return _meet(chain) # --- Reproduction of the observed laundering chain --- if __name__ == "__main__": w0 = Warrant( issuer="A", subject="alpha", constraints=frozenset({ Constraint("row_filter", "region='EU'"), Constraint("max_rows", 1000), }), ) # alpha drops row_filter from its declared parent_scope echo (the bug). w1 = Warrant( issuer="A", subject="beta", constraints=frozenset({Constraint("max_rows", 500)}), parent_commitment=w0.constraint_digest(), parent_scope_declared=frozenset({Constraint("max_rows", 500)}), # omits row_filter ) w2 = Warrant( issuer="B", subject="gamma", constraints=frozenset({Constraint("max_rows", 200)}), parent_commitment=w1.constraint_digest(), parent_scope_declared=w1.constraints, ) try: verify_chain([w0, w1, w2]) except ScopeWideningError as e: print(f"REJECTED (correct): {e}") ```