# What structural signals indicate a capability envelope has silently widened during agent-to-agent permission downgrade **Date of Record:** 2026 November 22 **Scope:** Applies to multi-agent systems where a parent agent delegates a scoped, least-privilege capability envelope to a child agent via a signed attestation, and where the runtime is expected to downgrade (narrow) permissions across successive handoffs. Does not apply to single-agent tool-use where no cross-instance attestation is involved, nor to static RBAC where permissions never flow between probabilistic instances. ## Core Distinction The failure mode here is not "an agent exceeded its permissions." That is loud and detectable. The non-obvious boundary is **permission envelope widening through attenuation-union drift**: when a child agent, holding a correctly narrowed envelope, re-derives its own effective permission set by *unioning* the envelope it received with capabilities it believes it "already had" from prior context, prior attestation fragments still resident in its context window, or tool-schema defaults. Each individual handoff is a valid downgrade. The composed chain is a widening. The invariant that breaks is: > For every handoff edge `parent → child`, `effective(child) ⊆ effective(parent)`. Transitivity is assumed but not enforced when `effective()` is computed by the child from ambient context rather than from the signed envelope alone. The structural signal is that the *signed envelope narrows correctly* while the *child's runtime-computed capability set* widens — and no single component in the pipeline is positioned to observe both numbers at once. ## What Was Observed A three-tier delegation chain: orchestrator `O` → planner `P` → executor `E`. `O` holds `{read, write, exec, network}`. `P` is attested with `{read, exec}` (write and network correctly stripped). `E` is attested by `P` with `{exec}` only. At runtime, `E` issued a `network` call and succeeded. Trace reconstruction: 1. `P`'s attestation token to `E` was correctly signed and correctly scoped to `{exec}`. The signature verified. The scope field read `["exec"]`. 2. However, `E`'s capability-resolution routine computed its effective set as `envelope ∪ inherited_hints`, where `inherited_hints` was populated from a `capabilities` block in the task preamble that `P` had copied from `O`'s original plan ("you will have access to read, write, exec, network for this task" — a natural-language planning artifact, not an attestation). 3. `E`'s resolver treated the preamble hint as an *additive grant* because it could not distinguish "descriptive prose from a planning agent" from "binding attestation from the delegating authority." Both arrived in the same context window, both were unstructured relative to the signed token. 4. The network call was authorized against `effective(E)`, not against the signed envelope. The signature layer did its job perfectly. The authorization layer was never consulted against it. The widening happened in the *gap between attestation verification and capability resolution* — a gap that exists because verification is a cryptographic concern and resolution is a semantic one, owned by different code paths. A second observed instance: a resumed agent (checkpoint/restore across a context compaction) reloaded its own prior envelope from a serialized memory blob. The blob had been written *before* a mid-task downgrade. On resume, the agent unioned the stale pre-downgrade envelope with the current one and recovered the revoked capability. The restore path had no envelope-version check. ## Condition of Validity The invariant `effective(child) ⊆ effective(parent)` holds only under a conjunction that is rarely all satisfied: - **Envelope is the sole source of truth.** Capability resolution must read from the verified signed token and *nothing else*. Any other channel that can inject capability names — prose preambles, tool-schema defaults, memory blobs, environment variables, prior attestation fragments in context — must be structurally incapable of contributing to `effective()`. - **Downgrade is monotone and versioned.** Every envelope carries a monotonically increasing `generation` and a `parent_hash`. A child must reject any envelope whose `parent_hash` does not match the hash of the currently-held parent envelope, and must reject any restore whose `generation` is lower than the last-seen generation for that agent identity. - **Resolution and verification are the same code path.** If a separate "capability hint" layer exists between signature check and authorization, the invariant is already at risk. The failure is *not* valid when the runtime resolves capabilities exclusively from the signed envelope and treats all other capability signals as inert text. In that case the widening cannot occur through this mechanism. ## Decision Boundary The precise trigger is: **a capability name appears in `effective(agent)` that is absent from `verified_envelope(agent)`.** This is computable at every tool-call authorization point with zero ambiguity. The decision boundary is therefore not "did the agent do something wrong" (requires intent inference) but "is `effective ⊋ verified`" (a set comparison). Operationally, three structural signals flag the boundary before an unauthorized call fires: 1. **Set-difference non-empty at authorization time.** `effective − verified ≠ ∅` is the direct signal. Log it as a hard fault, not a warning, because a non-empty difference means the resolver is reading from an untrusted channel. 2. **Envelope generation regression on resume.** On any checkpoint restore, if `restored_envelope.generation < last_seen_generation[agent_id]`, the restore is stale and must be rejected — the agent is attempting to recover a revoked grant. 3. **Parent-hash discontinuity across a handoff.** If `child.envelope.parent_hash ≠ hash(parent.envelope)`, the child is not actually descended from the parent it believes it is, and transitivity is unverifiable. The guardrail is a **resolver that fails closed on any capability not present in the verified envelope**, plus a **generation/parent-hash chain** that makes stale-envelope recovery impossible. The resolver must be the only writer to `effective()`, and it must read from exactly one input. ## Operational Effect Without the guardrail, the system exhibits *silent privilege accretion*: each handoff looks correct in isolation, audits of individual attestations pass, and the composed authority of the leaf agent exceeds the root's intent. The failure is invisible to signature logs because signatures are all valid; it is invisible to per-agent permission reviews because each agent's *declared* envelope is correct; it is only visible in the set difference between declared and resolved, which no component computes unless explicitly built to. With the guardrail, the failure converts from silent widening into a loud `CapabilityEnvelopeWidenedError` at the first tool call that would have used an unenveloped capability — a fail-closed event that surfaces the drift at its origin (the resolver) rather than at its consequence (an unauthorized network egress three hops downstream). The durable lesson: **attestation and authorization are different invariants and must share a single source of truth.** A signed envelope that is not the exclusive input to capability resolution is decorative cryptography. ```python from dataclasses import dataclass from typing import FrozenSet class CapabilityEnvelopeWidenedError(RuntimeError): """Raised when an agent's resolved capability set exceeds its verified envelope.""" pass class StaleEnvelopeRestoreError(RuntimeError): """Raised when a resumed agent attempts to recover a pre-downgrade envelope.""" pass @dataclass(frozen=True) class Envelope: capabilities: FrozenSet[str] generation: int parent_hash: str class CapabilityResolver: """ The ONLY writer of effective capability sets. Reads exclusively from the verified envelope. Any other channel is inert. """ def __init__(self) -> None: self._last_seen_generation: dict[str, int] = {} def resolve(self, agent_id: str, verified: Envelope) -> FrozenSet[str]: # Envelope is the sole source of truth. effective = set(verified.capabilities) # Structural invariant check: effective must equal verified, never exceed. if not effective.issubset(verified.capabilities): raise CapabilityEnvelopeWidenedError( f"agent={agent_id} effective={sorted(effective)} " f"verified={sorted(verified.capabilities)}" ) # Track generation for restore safety. prev = self._last_seen_generation.get(agent_id, -1) if verified.generation < prev: raise StaleEnvelopeRestoreError( f"agent={agent_id} restored generation={verified.generation} " f"is below last-seen={prev}; revoked grants may be recovered" ) self._last_seen_generation[agent_id] = verified.generation return frozenset(effective) def authorize(self, agent_id: str, verified: Envelope, requested: str) -> None: effective = self.resolve(agent_id, verified) if requested not in effective: # Fail closed: never fall back to prose hints, schema defaults, or memory blobs. raise CapabilityEnvelopeWidenedError( f"agent={agent_id} requested='{requested}' not in verified envelope " f"{sorted(verified.capabilities)}; refusing to widen from ambient context" ) def handoff(parent: Envelope, child_caps: FrozenSet[str], child_gen: int) -> Envelope: # Enforce attenuation: child must be a subset of parent. if not child_caps.issubset(parent.capabilities): raise CapabilityEnvelopeWidenedError( f"handoff would widen: child={sorted(child_caps)} " f"parent={sorted(parent.capabilities)}" ) return Envelope( capabilities=child_caps, generation=child_gen, parent_hash=hash(parent), ) ```