{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scope-substitution-attacks-when-a2a-agent-cards-are-discovered-over-mtls-bound-oauth2-delegated-grants",
  "title": "Which invariants prevent scope-substitution attacks when A2A Agent Cards are discovered over mTLS-bound OAuth2 delegated grants",
  "date_of_record": "2026 November 30",
  "scope": "Applies to A2A v1.0 peers that resolve a remote Agent Card via `.well-known/agent-card.json` and then present an OAuth2 access token whose `cnf` (confirmation) claim binds the token to a client certificate thumbprint. Does not cover bearer-only A2A deployments, static bilateral trust registries, or token exchange (RFC 8693) flows where the actor identity is re-derived server-side.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-substitution-attacks-when-a2a-agent-cards-are-discovered-over-mtls-bound-oauth2-delegated-grants.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-substitution-attacks-when-a2a-agent-cards-are-discovered-over-mtls-bound-oauth2-delegated-grants.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-substitution-attacks-when-a2a-agent-cards-are-discovered-over-mtls-bound-oauth2-delegated-grants.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2509,
    "python_slice_tokens": 471,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between *authentication of the discovery channel* and *authorization of the delegated call*. mTLS on the Agent Card fetch proves the peer presenting the card is the entity named in the certificate. It says nothing about whether the *scope set* enumerated in that card's `securitySchemes` / `oauth2.flows.clientCredentials.scopes` block is...",
    "what_was_observed": "A three-hop delegation chain: orchestrator agent `O` → planner agent `P` → executor agent `E`. `O` holds a client certificate `C_O` and an AS-issued token with scopes `{agent:invoke, tasks:read}`. `O` discovers `P`'s Agent Card over mTLS using `C_O`. `P`'s card advertises, in its `securitySchemes`, an OAuth2 client-credentials flow with scope union `{agent:invoke, tasks:read, tasks:write, files:export, admin:quota}` ...",
    "condition_of_validity": "The invariant holds — scope substitution is prevented — if and only if the following three conditions are jointly satisfied at every hop: 1. **Grant closure:** For every delegated token `T_n` with actor chain `act = {sub: A_n, act: {sub: A_{n-1}, ...}}`, `T_n.scope ⊆ T_{n-1}.scope` where `T_{n-1}` is the token the delegating actor presented. This is checkabl...",
    "decision_boundary": "The boundary is between *card-as-capability-advertisement* and *card-as-authorization-source*. A2A v1.0's `AgentCard.securitySchemes` is defined as advertisement: it tells a caller *how to authenticate*, and lists scopes as *examples of what the flow supports*. It is not a grant. The decision rule for any resolver: - If the scope string appears in the card b...",
    "operational_effect": "The operational consequence is that A2A discovery must be treated as a *two-phase* operation with an explicit reconciliation step, not a single fetch-and-call. Phase one fetches and caches the card keyed by `(peer_url, cert_thumbprint, card_etag)`. Phase two, immediately before minting any delegated token, reconciles the card's advertised scope union against..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "9668ad039c7f1bbdba926240c9b8676293972ec13283a32559b7fec9a89c45e7",
    "verified_classes": [
      "ScopeSubstitutionError",
      "Grant",
      "DelegatedToken"
    ],
    "verified_functions": [
      "validate_delegation"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ScopeSubstitutionError"
    ],
    "sample_fail_closed_invariants": [
      "scope_history terminal grant does not equal delegated token scope; chain is incomplete or forged"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
