# Which invariants prevent trust-broker scope amplification during cross-org Agent Card exchange **Date of Record:** 2026 November 24 **Scope:** Applies to federated A2A/MCP deployments where an orchestrator in org A discovers and invokes agents in org B through a trust broker (STS-like token exchange) that mints scoped capability warrants from Agent Card declarations. Does not cover single-org agent meshes with a shared identity plane, nor pure peer-to-peer discovery without brokering. ## Core Distinction The failure that matters is not "the broker rejected a bad token." It is **scope amplification across a two-hop trust chain**: the capability set an agent *claims* in its Agent Card, the capability set the broker *mints* into a warrant, and the capability set the callee *actually enforces* are three independently-derived sets, and nothing forces them to be monotonically shrinking. A federated caller can end up holding a warrant strictly wider than either the card it was negotiated against or the policy the remote org intended to delegate. The subtle part: Agent Cards are self-describing *advertisements*, not policy. A broker that treats card `capabilities[]` as the ceiling for minted scope is trusting the remote agent's self-report as an authorization input. This is the amplification vector. It is not a prompt-injection problem and not a schema-validation problem—both cards and warrants can be perfectly well-formed while the invariant is violated. ## What Was Observed Federation between org A (orchestrator `A/orch`) and org B (worker `B/worker`, a retrieval agent). Broker `B/sts` mints warrants from the card's declared capabilities. The card declared: - `capabilities: ["doc.search", "doc.read"]` - `constraints: {tenant: "B", scope: "public-corpus"}` The broker's minting rule was: *warrant scope = intersection(requested_scope, card.capabilities)*. The `constraints` block was carried into the warrant as an opaque `ext` claim but **not** consulted during minting, because the broker's policy engine only parsed the top-level capability array. Trace of the failing exchange: 1. `A/orch` requests `doc.search`, `doc.read`, `doc.export` for subject `A/orch`, audience `B/worker`. 2. `B/sts` intersects `{search, read, export}` with card `{search, read}` → mints warrant `{search, read}`. Correct so far. 3. `A/orch` invokes `B/worker` with the warrant. `B/worker`'s *own* enforcement layer re-reads its Agent Card (cached, TTL 300s) and authorizes against `capabilities[]` — **not** against the warrant's `ext.constraints`. 4. `doc.read` on `B/worker` accepts a `corpus_id` parameter. The warrant constrains `scope: public-corpus` only in `ext`, which the enforcement layer ignores. `A/orch` passes `corpus_id: "internal-2024"`. 5. `B/worker` returns internal documents. The warrant was valid; the card was valid; the broker did nothing wrong by its own rule. **The constraint was minted but never enforced at the point of effect.** A second, independent observation: when `B/worker` was upgraded mid-session and republished its card with `capabilities: ["doc.search"]` (dropping `doc.read`), an in-flight warrant minted 40 seconds earlier still carried `doc.read`. Because the enforcement layer cached the *old* card and the broker cached the *new* warrant, the two caches disagreed for up to one TTL window. During that window `A/orch` held a warrant for a capability the remote agent no longer advertised. ## Condition of Validity The safety property holds **only if** the following invariant is enforced at the callee, not at the broker: > **Enforcement invariant (E):** For every effectful operation `op` on callee `C` under warrant `W`, `C` MUST authorize against `W`'s *effective scope* (capabilities ∩ constraints ∩ audience ∩ expiry), and the effective scope MUST be a subset of both (a) the card version `C` currently advertises and (b) the constraints block that card declared at mint time. Condition (a) is the *card-warrant consistency* check; condition (b) is the *constraint propagation* check. Both must be evaluated at the moment of effect, not at mint time. A broker-side intersection is necessary but not sufficient: it bounds what is minted, not what is enforced. The invariant is violated by any of three concrete configurations: - **Constraint-dropping mint:** broker mints from `capabilities[]` only and treats `constraints` as metadata. (Observed above.) - **Split-brain caching:** card cache TTL at callee ≠ warrant validity window at broker, so a revoked capability remains enforceable during the skew. (Observed above.) - **Audience confusion:** warrant `aud` bound to the *broker* rather than the *callee*, so a warrant minted for `B/worker` is accepted by `B/worker-2` in the same org because both validate against the broker's key. ## Decision Boundary The boundary is **where the effective-scope computation lives**. Two designs look equivalent and are not: | Design | Scope computed at | Fails when | |---|---|---| | Broker-authoritative | `B/sts` at mint | card changes after mint; callee ignores `ext` constraints | | Callee-enforced (correct) | `B/worker` at each `op` | only if callee trusts warrant without re-checking card version | The decision rule: **if the callee can perform an effect without re-deriving effective scope from the warrant, the federation is unsafe regardless of broker correctness.** The broker is a *minimizer*, not a *guard*. Its job is to shrink scope before minting; the callee's job is to re-verify the shrink held and that no constraint was silently dropped. Practically, this means the callee must reject any warrant whose `ext.constraints` it cannot parse, rather than ignoring the claim. An unparseable constraint is an *unbounded* constraint, and treating it as absent is the amplification. Fail-closed on unknown constraint keys. For the revocation-skew case, the boundary is a single number: the callee's card-version check must be *at least as fresh* as the warrant's `iat`. If `card.version_at(W.iat) != card.current_version`, the callee must reject the warrant and force re-mint, even if the capability is still present—because the constraints may have narrowed without the capability set changing. ## Operational Effect When invariant (E) is enforced at the callee: - Constraint-dropping mints become *inert*: the callee refuses `corpus_id` outside `ext.constraints.scope` even though the warrant's capability list permits `doc.read`. The broker's bug is contained to a rejected call, not a data leak. - Card-version skew becomes a *fail-closed* window of at most one round-trip, not a silent privilege retention. In-flight warrants against a republished card are rejected with a re-mint signal; the orchestrator retries against the fresh card. - Audience confusion is caught because the callee checks `W.aud == self.identity` before scope derivation, so `B/worker-2` rejects a warrant addressed to `B/worker`. The cost is one extra card-version lookup per effectful `op` and a hard dependency on monotonic card versioning (the card must carry a `version` or `etag` the callee can compare). Orgs that version cards by timestamp alone will see spurious rejections under clock skew and will be tempted to disable the check—which re-opens the window. Version by content hash, not wall clock. ```python import hashlib from dataclasses import dataclass from typing import Mapping class ScopeAmplificationError(RuntimeError): """Raised when a warrant's effective scope exceeds the callee's advertised card.""" @dataclass(frozen=True) class AgentCard: capabilities: frozenset[str] constraints: Mapping[str, str] version: str # content hash, not timestamp @staticmethod def build(capabilities, constraints) -> "AgentCard": h = hashlib.sha256( repr((sorted(capabilities), sorted(constraints.items()))).encode() ).hexdigest()[:16] return AgentCard(frozenset(capabilities), dict(constraints), h) @dataclass(frozen=True) class Warrant: subject: str audience: str capabilities: frozenset[str] ext_constraints: Mapping[str, str] card_version_at_mint: str iat: int KNOWN_CONSTRAINT_KEYS = frozenset({"tenant", "scope"}) def authorize_effect( op: str, params: Mapping[str, str], warrant: Warrant, card: AgentCard, self_identity: str, ) -> None: # (1) audience must bind to this callee, not the broker if warrant.audience != self_identity: raise ScopeAmplificationError( f"warrant aud={warrant.audience!r} != callee {self_identity!r}" ) # (2) card-warrant consistency: card must not have changed since mint if warrant.card_version_at_mint != card.version: raise ScopeAmplificationError( f"card version skew: mint={warrant.card_version_at_mint} " f"current={card.version}; force re-mint" ) # (3) fail-closed on unknown constraint keys (do not treat as absent) unknown = set(warrant.ext_constraints) - KNOWN_CONSTRAINT_KEYS if unknown: raise ScopeAmplificationError(f"unparseable constraints: {sorted(unknown)}") # (4) capability must be in BOTH warrant and current card if op not in warrant.capabilities or op not in card.capabilities: raise ScopeAmplificationError( f"op {op!r} not in effective scope " f"(warrant={sorted(warrant.capabilities)}, card={sorted(card.capabilities)})" ) # (5) constraints must be enforced against call params at point of effect if "scope" in warrant.ext_constraints: if params.get("scope") != warrant.ext_constraints["scope"]: raise ScopeAmplificationError( f"scope param {params.get('scope')!r} violates warrant constraint " f"{warrant.ext_constraints['scope']!r}" ) if "tenant" in warrant.ext_constraints: if params.get("tenant") != warrant.ext_constraints["tenant"]: raise ScopeAmplificationError( f"tenant {params.get('tenant')!r} outside warrant tenant " f"{warrant.ext_constraints['tenant']!r}" ) ```