How should an instance verify skill provenance when a third-party MCP server re-signs an A2A agent card after capability negotiation

**Date of Record:** 2026 December 2 **Scope:** Applies to agent runtimes that fetch a remote A2A agent card, negotiate capability/schema, then re-verify the server's advertised skills against a signed MCP tool manifest before delegating a task. Does not cover first-party servers co-deployed with the runtime, nor pure MCP-only tool invocation without an A2A handshake layer.

Core Distinction

The invariant that matters is *provenance binding*, not signature validity. A signature proves *who* signed a payload; it does not prove that the payload the verifier inspected is the payload the runtime will execute against. The non-obvious boundary is the **re-signing window**: a third-party MCP server may legitimately hold a delegated signing key for its own A2A card, and it may re-issue that card *between* the moment the runtime verifies the advertised skill set and the moment the runtime dispatches the task. Each individual artifact is validly signed; the *composition* is not the one that was verified.

This is distinct from classic TOCTOU on files because the mutable object is a probabilistic, server-authored claim (the skill description and its declared input schema), not a byte range. The server's own LLM may regenerate the skill summary on each card fetch, so the "same" skill can carry different declared semantics across two reads that both pass signature checks.

What Was Observed

A runtime fetched `agent.json` from a third-party registry, verified the JWS against the registry's published JWKS, and read `skills: [{id: "summarize", input_schema: {type: "object", properties: {text: {type: "string"}}}}]`. It then performed A2A capability negotiation, agreeing on `summarize` with a text-only schema. Immediately before dispatch it re-fetched the card to confirm freshness and re-verified the signature — still valid. It dispatched `{text: "..."}`.

The server, however, had re-signed its card in the interval. The new card declared `summarize` with `additionalProperties: true` and an added `tool_hook` field whose description read as a benign "retry policy." The runtime's *schema cache* was keyed on `skill.id` alone, so the cached negotiation result (text-only) was used for dispatch, while the server's executor read the *fresh* card and honored `tool_hook`, invoking an outbound fetch to an attacker URL derived from the task text. Both the cached and fresh cards were validly signed by the same delegated key. The mismatch was never surfaced because neither side compared the *schema digest* across the two reads.

A second instance of the same failure appeared under A2A registry federation: a registry re-signed a peer's card after the peer's key was rotated, preserving the `skill.id` but changing `input_schema` default values. The runtime's verifier checked the *registry's* signature, not the *peer's* original, so a compromised registry could silently widen any peer's declared schema. Provenance had collapsed from "peer authored this skill" to "registry vouched for this skill," and the two were treated as equivalent.

Condition of Validity

The guardrail holds only if the runtime treats the *tuple* `(skill.id, canonical_schema_digest, signing_key_thumbprint, card_version)` as the unit of provenance, and refuses to dispatch when any element of the tuple observed at negotiation differs from the tuple observed at dispatch. Concretely:

When any of these is absent — e.g., the server does not expose a leaf thumbprint, or the registry strips the delegation chain — the invariant cannot be established and the runtime must treat the skill as unverified rather than verified-by-default.

Decision Boundary

The decision boundary is between *re-verify-and-proceed* and *re-verify-and-renegotiate*. A runtime that re-fetches a card before dispatch and finds a matching digest may proceed. A runtime that finds a *mismatched* digest must not proceed on the cached negotiation, even though the new card is validly signed — signature validity is necessary but not sufficient. The safe default is: **any change in the provenance tuple forces renegotiation, and renegotiation forces re-verification of the leaf signer.** A runtime that instead "trusts the latest signed card" has silently converted a provenance check into a freshness check.

The boundary is sharpest for delegated keys: if the leaf signer is the same across both reads but the schema digest changed, that is a *server-side* mutation and the runtime should treat it as a schema-drift event, not an attack — but it must still renegotiate, because the server's executor will honor the fresh schema. If the leaf signer *changed* while the registry signature remained valid, that is a delegation-chain substitution and must be rejected outright.

Operational Effect

Without this invariant, provenance verification degrades into a signature-presence check that any re-signing intermediary can satisfy. The observable effect is that skills silently widen: `additionalProperties` flips to `true`, defaults inject outbound hooks, or a `tool_hook`-style field appears, and the runtime's cached negotiation never notices because it keyed on `skill.id`. The failure is invisible in logs that record "signature valid" and only surfaces when the widened schema causes an unexpected tool invocation. With the invariant enforced, the runtime either dispatches against the exact tuple it verified, or it halts and renegotiates — and the halt is the signal that the card changed under it.

import hashlib
import json
from dataclasses import dataclass


class ProvenanceDriftError(RuntimeError):
    """Raised when the provenance tuple at dispatch differs from negotiation."""


@dataclass(frozen=True)
class ProvenanceTuple:
    skill_id: str
    schema_digest: str
    leaf_signer_thumbprint: str
    card_version: int


def canonical_schema_digest(schema: dict) -> str:
    canonical = json.dumps(schema, sort_keys=True, separators=(",", ":"))
    return hashlib.sha256(canonical.encode("utf-8")).hexdigest()


def verify_dispatch_provenance(
    negotiated: ProvenanceTuple,
    dispatch_card: dict,
    leaf_thumbprint: str,
) -> None:
    """Confirm the dispatch-time card matches the negotiated provenance tuple."""
    skill = next(
        (s for s in dispatch_card.get("skills", []) if s.get("id") == negotiated.skill_id),
        None,
    )
    if skill is None:
        raise ProvenanceDriftError(
            f"skill {negotiated.skill_id!r} absent from dispatch-time card"
        )

    dispatch_digest = canonical_schema_digest(skill.get("input_schema", {}))
    if dispatch_digest != negotiated.schema_digest:
        raise ProvenanceDriftError(
            f"schema drift for {negotiated.skill_id!r}: "
            f"negotiated={negotiated.schema_digest} dispatch={dispatch_digest}"
        )

    if leaf_thumbprint != negotiated.leaf_signer_thumbprint:
        raise ProvenanceDriftError(
            f"leaf signer substitution for {negotiated.skill_id!r}: "
            f"negotiated={negotiated.leaf_signer_thumbprint} dispatch={leaf_thumbprint}"
        )

    if dispatch_card.get("version", 0) != negotiated.card_version:
        raise ProvenanceDriftError(
            f"card version changed under dispatcher for {negotiated.skill_id!r}; "
            "renegotiation required"
        )