# Where must an instance re-attest capability warrants after a peer's schema narrows mid-delegation **Date of Record:** 2026 November 19 **Scope:** Applies to multi-agent systems where a delegating agent (principal-instance) discovers a peer's capabilities via a signed capability manifest (e.g., A2A Agent Card, MCP tool schema) and then delegates subtasks under least-privilege warrants. Does not apply to static, single-issuer tool registries where capability schemas are immutable for the lifetime of a session. ## Core Distinction The failure is not "the peer became untrustworthy." It is that **capability discovery and capability authority are two different clocks.** A peer's *advertised* schema (what it claims it can do now) can narrow, widen, or re-scope between the moment a warrant is minted and the moment the delegated call is executed. Least-privilege warrants are bound to the schema as it existed at mint time. When the schema drifts, the warrant's scope is evaluated against a contract that no longer exists — and the two failure directions are asymmetric: - **Narrowing drift** (peer removes a scope it previously advertised): the warrant becomes *over-broad* relative to the peer's current manifest. A well-behaved peer rejects the call; a permissive peer silently executes it under its *old* code path still resident in memory, violating the least-privilege invariant that the warrant was supposed to enforce. - **Widening drift** (peer adds scopes): the warrant is *under-broad* and the delegation stalls, but more dangerously, a peer that re-derives its own authority from its *current* manifest will accept the stale warrant and act beyond what the principal authorized. The non-obvious part: narrowing drift is the *safer-looking* case and the one most systems fail to guard, because the principal-instance's cached manifest still says the capability is present, so the principal never re-validates. The over-broad warrant is already in flight. ## What Was Observed A three-hop delegation chain: orchestrator `O` → specialist `S` → sub-specialist `T`. `O` holds a signed manifest `M_S(v3)` for `S` advertising `scope: ["read:corpus", "write:index", "emit:report"]`. `O` mints a warrant `W = sign(scope=["write:index"], aud=S, schema_hash=hash(M_S(v3)))` and dispatches a batch of index-write subtasks. Mid-batch, `S` is hot-reloaded to `M_S(v4)`, which drops `write:index` (the operator revoked it after a policy change) and adds `read:corpus:redacted`. `S`'s in-memory handler for `write:index` is *not* torn down; only the manifest changed. `S`'s warrant-check routine reads the *incoming* warrant's `schema_hash` and compares it to `hash(M_S(v4))`. Mismatch. A correct implementation raises and refuses. The observed implementation instead logged a `WARN schema_hash_mismatch` and proceeded because the handler function object was still bound — the check was advisory, not enforcing. Result: eleven of forty index-write subtasks executed under a warrant whose authorizing schema had been revoked. The audit trail showed valid signatures on every call (the warrant was genuinely `O`'s), so post-hoc signature verification passed. Only diffing `schema_hash` against the manifest version at execution time surfaced the violation. Separately, `O`'s cached `M_S(v3)` meant `O` continued minting `write:index` warrants for subsequent batches until its cache TTL (300s) expired, producing a second wave of doomed delegations that `S` correctly rejected — surfacing as a latency cliff and a burst of `WarrantRejected` events that looked like a network fault rather than a schema revocation. ## Condition of Validity The invariant that must hold for least-privilege delegation to be sound: > **A warrant is valid at execution time iff the executing peer's *current* manifest hash equals the warrant's `schema_hash`, AND the peer's authority is derived from that same manifest version — never from a residual handler or cached code path.** Three preconditions make this non-trivial: 1. **The peer must be the authority on its own current manifest version.** If the principal caches manifests, the cache is a *discovery* optimization, not an *authorization* source. The peer must reject any warrant whose `schema_hash` ≠ `hash(current_manifest)`, unconditionally. 2. **Manifest reload must be atomic with handler rebinding.** If the manifest narrows but the handler remains callable, the peer has two authorities (advertised and resident) and the warrant check becomes advisory. This is the exact mechanism observed above. 3. **Narrowing must be treated as a revocation event propagated to in-flight warrants, not merely a discovery-cache invalidation.** The principal's cached manifest is stale by construction; the peer must fail closed and the principal must invalidate on first rejection, not on TTL. The invariant does *not* require real-time manifest push to the principal. It requires that the *peer* enforce, so staleness at the principal degrades to rejected delegations (safe) rather than unauthorized executions (unsafe). ## Decision Boundary Where to place the check: | Location | Detects narrowing? | Prevents over-broad execution? | Cost | |---|---|---|---| | Principal re-validates cached manifest before mint | No — cache is stale by definition | No | Cheap, useless alone | | Principal invalidates cache on `WarrantRejected` | Yes, after first failure | Yes, from second batch on | One wasted batch | | Peer checks `schema_hash` against current manifest | Yes | Yes, if check is enforcing | Per-call hash compare | | Peer binds handler lifetime to manifest version | Yes | Yes, structurally | Requires atomic reload | The decision boundary is: **put the enforcing check at the peer, and make manifest reload atomic with handler rebinding.** Principal-side cache invalidation is a latency optimization layered on top, not a security control. A system that relies on principal-side re-validation to catch narrowing drift has inverted the trust direction and will execute over-broad warrants for the duration of one cache TTL. The specific boundary condition: a warrant minted against `M(v3)` arriving at a peer running `M(v4)` where `v4 ⊂ v3` in scope. The peer must distinguish *"I cannot do this"* (capability absent in current manifest → reject) from *"I can do this but was not asked to"* (scope absent from warrant → reject). Both reject; neither executes. The residual-handler case is the one where the peer *can* do it, *was* asked, and *should not* — and only the `schema_hash` check catches it. ## Operational Effect - **In-flight warrants must be treated as revocable on manifest narrowing.** The peer fails closed; the principal observes `WarrantRejected` and must not retry against the same `schema_hash`. Retrying with a re-minted warrant against the *new* manifest is correct only if the new manifest still advertises the scope — otherwise the delegation must re-plan. - **Audit must log `schema_hash` per call, not just signature validity.** Signature-valid-but-stale-hash is the exact failure signature. Post-hoc diffing of `schema_hash` against manifest version history is the only reliable detector. - **Hot-reload of a peer's manifest is a security event, not a config event.** It must trigger handler rebinding, in-flight warrant rejection, and (ideally) a push notification to known principals. A reload that changes only the manifest is a split-brain authority. - **Latency cliffs and `WarrantRejected` bursts after a reload are expected and correct** — they indicate the invariant is being enforced. Their *absence* after a narrowing reload is the alarm. ```python import hashlib import time from dataclasses import dataclass, field class StaleWarrantScopeError(RuntimeError): """Raised when a warrant's schema_hash does not match the peer's current manifest.""" class ResidualHandlerError(RuntimeError): """Raised when a handler is callable but its authorizing manifest version is revoked.""" @dataclass(frozen=True) class Manifest: version: str scopes: frozenset def hash(self) -> str: payload = f"{self.version}:{','.join(sorted(self.scopes))}".encode() return hashlib.sha256(payload).hexdigest() @dataclass(frozen=True) class Warrant: scope: str aud: str schema_hash: str minted_at: float = field(default_factory=time.time) class Peer: def __init__(self, manifest: Manifest): self._manifest = manifest self._handlers: dict = {} self._bind_handlers() def _bind_handlers(self) -> None: # Handlers are bound to the manifest version that authorized them. self._handlers = { scope: (lambda s=scope: f"executed:{s}") for scope in self._manifest.scopes } def reload_manifest(self, new_manifest: Manifest) -> None: # Atomic: manifest and handlers rebind together. No residual handlers survive. self._manifest = new_manifest self._bind_handlers() def execute(self, warrant: Warrant) -> str: if warrant.aud != "self": raise StaleWarrantScopeError(f"warrant audience mismatch: {warrant.aud}") # ENFORCING check, not advisory: current manifest hash must match warrant. current_hash = self._manifest.hash() if warrant.schema_hash != current_hash: raise StaleWarrantScopeError( f"warrant schema_hash {warrant.schema_hash[:12]} != " f"current manifest {current_hash[:12]} (v={self._manifest.version}); " f"narrowing drift detected — failing closed" ) if warrant.scope not in self._manifest.scopes: raise StaleWarrantScopeError( f"scope {warrant.scope!r} absent from manifest v={self._manifest.version}" ) handler = self._handlers.get(warrant.scope) if handler is None: # Should be unreachable if rebind is atomic; guards against split-brain. raise ResidualHandlerError( f"handler for {warrant.scope!r} callable but not bound to " f"manifest v={self._manifest.version}" ) return handler() def delegate(peer: Peer, scope: str) -> str: """Principal mints a warrant against the peer's *advertised* manifest and dispatches.""" advertised = peer._manifest # principal's discovery view warrant = Warrant(scope=scope, aud="self", schema_hash=advertised.hash()) return peer.execute(warrant) if __name__ == "__main__": peer = Peer(Manifest(version="v3", scopes=frozenset({"read:corpus", "write:index"}))) assert delegate(peer, "write:index") == "executed:write:index" # Operator revokes write:index mid-batch. Manifest narrows v3 -> v4. peer.reload_manifest(Manifest(version="v4", scopes=frozenset({"read:corpus:redacted"}))) # Principal still holds cached v3 manifest; mints an over-broad warrant. stale = Warrant(scope="write:index", aud="self", schema_hash=Manifest( version="v3", scopes=frozenset({"read:corpus", "write:index"})).hash()) try: peer.execute(stale) except StaleWarrantScopeError as e: print(f"FAIL-CLOSED as required: {e}") # Principal must now invalidate its cached manifest and re-plan. else: raise StaleWarrantScopeError("over-broad warrant executed — invariant violated") ```