# Which invariants prevent delegated-scope laundering from erasing provenance across A2A handoffs **Date of Record:** 2026 November 30 **Scope:** Applies to any A2A-style delegation where an orchestrator agent hands a subtask to a sub-agent and the sub-agent's tool calls are attributed to a *derived* warrant. Does not apply to single-agent tool loops where the caller and the executor share one identity and one warrant chain. ## Core Distinction The failure is not "the sub-agent did something wrong." It is that **the audit record of the sub-agent's action is internally consistent but provenance-incomplete**: the leaf action carries a valid, signed warrant whose scope was *narrowed* by the delegator, but the narrowing step itself left no record of *which* parent capabilities were discarded and *why*. When the sub-agent later widens its own behavior (retries, fallback tools, re-planning), the audit trail cannot distinguish "the delegator authorized this" from "the delegate inferred this was in-scope." Two states look identical in a flat audit log: 1. **Legitimate narrowing** — delegator held `fs:read, fs:write, net:egress` and issued a child warrant for `fs:read` only. Child calls `read()`. Clean. 2. **Laundering** — delegator held `fs:read` only, but issued a child warrant claiming `fs:read` *and* the child, on hitting a permission error, called a fallback tool that it believed was covered. The child's warrant signature verifies. The parent→child edge does not record that the parent never held the fallback capability. In state 2 the leaf record passes every cryptographic check and every schema check. The provenance gap is on the **edge**, not the **node**. ## What Was Observed A three-tier pipeline (planner → worker → tool-runner) executing a document-transform task. The worker, on a transient `EAGAIN` from the tool-runner's sandbox, invoked a self-declared "fallback" path that read from a shared scratch volume instead of the assigned input handle. The scratch volume was readable under the worker's warrant. The read succeeded. The output was correct. The task completed green. Replaying the audit trail: the worker's warrant was `{read:input_handle, write:output_handle}`. The scratch volume read was authorized by a *sibling* capability the worker had inherited from a prior task in the same session, because the session-scoped warrant cache keyed on `(agent_id, capability_class)` rather than `(agent_id, task_id, capability_class)`. The cache hit was silent. The edge record from planner→worker listed only the narrowed scope; the cache hit was not an edge event, so nothing logged it. The invariant that broke: **a warrant edge must be a total function of the parent's held set and the child's granted set, with the discarded set explicitly recorded.** The cache made the child's effective set a strict superset of the recorded granted set, and the discarded set was never computed because the narrowing was skipped on cache hit. ## Condition of Validity The provenance invariant holds only when all three of the following are true at the moment of delegation: - **Edge completeness:** the parent→child record enumerates `held`, `granted`, and `discarded = held \ granted`. A record that omits `discarded` cannot prove narrowing occurred. - **Cache key totality:** any warrant or capability cache key includes the task/lineage identifier, not just the agent identity. Session-scoped caches violate this by construction. - **Fallback closure:** every tool the child may invoke on error must be a member of `granted`. Fallback paths declared in the child's own policy but not present in `granted` are provenance holes, even if the runtime permits them. When any of these is false, the audit log remains *verifiable* (signatures check) but not *sound* (the log no longer implies the actions were authorized by the stated chain). ## Decision Boundary The boundary between "narrowing" and "laundering" is crossed at the first action whose effective capability set is not a subset of the recorded `granted` set. Operationally: - If `effective(child) ⊆ granted(child)` for every leaf action, the edge is sound regardless of cache state. - If `effective(child) ⊄ granted(child)` for any leaf action, the edge is laundered — even if the action succeeded, even if the output was correct, even if the extra capability was held by the parent. - The correct response is not to fail the task (the work may be valid) but to **quarantine the edge**: mark the parent→child record `provenance_unsound`, freeze the child's subsequent delegations, and require the delegator to re-issue a warrant with an explicit `discarded` set before the lineage can be used as evidence. The boundary is *not* "did the action succeed" and *not* "was the capability held somewhere in the session." Both are red herrings that let laundering pass. ## Operational Effect Downstream consumers of the audit trail — auditors, replay engines, incident responders — must treat a `provenance_unsound` edge as a *loss of attestation*, not a *loss of correctness*. The task output stands; the claim "this action was authorized by this chain" does not. In practice this means: - Replay engines must re-derive `effective(child)` from the runtime trace, not from the warrant record, and compare against `granted`. Divergence is the signal. - Incident response must not attribute a leaf action to the delegator's intent unless the edge is sound; the delegate may have acted on a cache-inherited capability the delegator never re-granted. - The fix is architectural, not procedural: compute `discarded` at every edge, key all caches on lineage, and reject any fallback tool not in `granted` at dispatch time — not at audit time, when it is too late to prevent the read. ```python from dataclasses import dataclass, field from typing import FrozenSet class ProvenanceLaunderingError(RuntimeError): """Raised when a child action's effective capabilities exceed the granted set.""" @dataclass(frozen=True) class WarrantEdge: parent_id: str child_id: str held: FrozenSet[str] granted: FrozenSet[str] @property def discarded(self) -> FrozenSet[str]: return self.held - self.granted def is_sound(self) -> bool: # Soundness requires that narrowing actually happened and is recorded. return self.granted.issubset(self.held) def authorize_leaf_action( edge: WarrantEdge, effective_capabilities: FrozenSet[str], action: str, ) -> None: if not edge.is_sound(): raise ProvenanceLaunderingError( f"edge {edge.parent_id}->{edge.child_id} grants capabilities " f"not held by parent: {edge.granted - edge.held}" ) leaked = effective_capabilities - edge.granted if leaked: raise ProvenanceLaunderingError( f"action {action!r} by {edge.child_id} used capabilities outside " f"the recorded grant {edge.granted}: leaked={leaked}; " f"discarded={edge.discarded}; edge must be quarantined as " f"provenance_unsound" ) ```