What happens when an instance presents a delegated scope whose capability attestation was minted against a superseded tool schema
**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF-mediated agent runtimes where an agent holds a verifiable credential (VC) containing delegated OAuth scopes, and each scope is bound to a per-tool capability attestation (a signed claim that this agent, under this scope, may invoke tool `T` with argument schema `S`). Does not apply to first-party agents whose scopes are minted and consumed within a single trust domain with no schema versioning.
Core Distinction
The failure is not scope escalation and not signature forgery. Both the VC's signature and the delegated scope grant verify correctly at the moment of presentation. The break is a **binding mismatch between two independently-valid artifacts**: the scope grant says "agent A may call tool `T`," and the capability attestation says "agent A, under this grant, may call `T` with schema hash `H_v7`." When the tool registry has advanced to `H_v9`, the attestation still verifies as a signature over an authentic claim—but the claim is now about a schema that no longer exists. The authorization decision is *structurally* valid and *semantically* stale.
Most AAIF implementations check the two artifacts in separate passes: verify the VC (signature, issuer, expiry, audience), then verify the attestation (signature, issuer, expiry, subject-matches-VC). Neither pass compares the attestation's `schema_hash` against the *currently served* tool descriptor. The gap between those two checks is the boundary.
What Was Observed
A research agent operating under a delegated scope `tool:write:research-db` was issued a capability attestation at session start. The attestation payload included:
{
"subject": "agent:research-7",
"scope": "tool:write:research-db",
"tool_id": "research_db.upsert",
"schema_hash": "sha256:9f2c...v7", // schema as of issuance
"arg_constraints": { "max_record_bytes": 65536, "required": ["id","payload"] },
"issued_at": "T0", "expires_at": "T0+8h"
}
Mid-session (roughly T0+3h), the tool owner deployed a schema revision: `payload` was renamed to `body`, and `max_record_bytes` was raised to 1 MiB. The registry now serves schema hash `v9`. The agent's attestation still verified—its signature was authentic, its expiry was in the future, its subject matched the VC, and its scope matched the grant. The authorization layer returned `ALLOW`.
The agent then executed a tool call using the `v7` argument shape (`payload`, 64 KiB budget). The tool server, which validates against `v9`, rejected the call with a schema error. The agent's reasoning loop, treating the rejection as a transient fault rather than an authorization/schema-version condition, retried three times with the same `v7` shape, then fell back to a "safe" path that wrote a truncated record with `body: null`. The write succeeded against `v9` (because `body` was nullable in the new schema), producing a semantically corrupt row that passed all downstream validation.
The authorization system logged `ALLOW` for every call. The audit trail showed a fully-authorized agent performing fully-authorized writes. Nothing in the AAIF layer flagged that the attestation had gone stale relative to the served schema.
Condition of Validity
The invariant that must hold for delegated-scope authorization to be sound is:
> *A capability attestation is valid only if its bound `schema_hash` matches the hash of the tool descriptor the enforcement point will actually apply.*
This is stronger than signature validity and stronger than scope membership. It is a **freshness-and-binding invariant across two mutable namespaces** (the credential namespace and the tool-registry namespace) that advance independently. The attestation is a signed statement about a *specific* schema; when the schema moves, the statement's truth value changes even though its bytes do not.
The condition fails whenever:
- The tool registry can advance schema without invalidating or re-issuing outstanding attestations, **and**
- The enforcement point validates the attestation's signature but not its `schema_hash` against the live descriptor, **and**
- The agent's execution loop treats schema-rejection as retryable rather than as an authorization-state change.
All three held in the observed incident. Removing any one bounds the failure.
Decision Boundary
The correct decision at presentation time is a **three-way comparison**, not two independent verifications:
- If `attestation.schema_hash == live_descriptor.hash` → `ALLOW`.
- If they differ **and** the live descriptor is backward-compatible with the attested schema (the tool owner published a compatibility relation) → `ALLOW` with a downgrade notice written to the agent's context, so the reasoning loop knows the argument shape it was attested for is still accepted.
- If they differ **and** no compatibility relation exists → `DENY` with reason `ATTESTATION_SCHEMA_STALE`, and **do not** let the agent retry: the denial must be surfaced as a terminal authorization state, not a transient error, so the loop does not fall back to a degraded write path.
The non-obvious part is the middle case. A naive implementation collapses the three-way into a binary "hash match / no match," which either over-denies during compatible rollouts (breaking long-running agents on every additive schema change) or—worse, as observed—under-denies by ignoring the hash entirely and letting the agent discover the mismatch only through a tool-level rejection it misclassifies as retryable.
Operational Effect
With the three-way check and the `ATTESTATION_SCHEMA_STALE` terminal state in place, the observed incident becomes a clean stop: the agent receives a non-retryable authorization denial at the boundary, its context is annotated with the reason, and its planner is forced to either re-request an attestation for `v9` or abandon the write. The corrupt nullable-`body` row is never produced.
The cost is that long-running agents must handle mid-session attestation re-issuance as a first-class state transition—a checkpoint that invalidates in-flight tool plans bound to the old schema. That is the price of the invariant: **attestation freshness is not a property of the credential alone; it is a joint property of the credential and the live tool descriptor, and it must be re-evaluated at every enforcement point, not at issuance.**
import hashlib
from dataclasses import dataclass
class StaleAttestationError(RuntimeError):
"""Raised when a capability attestation is bound to a superseded tool schema."""
@dataclass(frozen=True)
class Attestation:
subject: str
scope: str
tool_id: str
schema_hash: str
signature_valid: bool
@dataclass(frozen=True)
class ToolDescriptor:
tool_id: str
schema_hash: str
compatible_with: frozenset # set of prior schema_hashes still accepted
def authorize_tool_call(
att: Attestation,
grant_scopes: set,
live: ToolDescriptor,
compatibility_published: bool,
) -> str:
# Pass 1: credential validity (signature + scope membership).
if not att.signature_valid:
raise StaleAttestationError("attestation signature invalid")
if att.scope not in grant_scopes:
raise StaleAttestationError(f"scope {att.scope!r} not in grant")
if att.tool_id != live.tool_id:
raise StaleAttestationError(
f"attestation tool {att.tool_id!r} != live tool {live.tool_id!r}"
)
# Pass 2: THE BINDING CHECK. This is the step most AAIFs omit.
if att.schema_hash == live.schema_hash:
return "ALLOW"
if compatibility_published and att.schema_hash in live.compatible_with:
# Compatible rollout: allow, but force a downgrade notice into agent context.
return "ALLOW_WITH_SCHEMA_DOWNGRADE_NOTICE"
# Terminal authorization state — must NOT be surfaced as a retryable tool error.
raise StaleAttestationError(
"ATTESTATION_SCHEMA_STALE: attestation bound to "
f"{att.schema_hash}, live descriptor is {live.schema_hash}; "
"agent must re-request attestation or abandon the tool plan"
)
def _demo() -> None:
att = Attestation("agent:research-7", "tool:write:research-db",
"research_db.upsert", "sha256:v7", True)
live = ToolDescriptor("research_db.upsert", "sha256:v9", frozenset({"sha256:v8"}))
# v7 is neither the live hash nor in the compatibility set -> must raise.
authorize_tool_call(att, {"tool:write:research-db"}, live, compatibility_published=True)
if __name__ == "__main__":
_demo()