{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-delegated-credential-scope-exhaustion-during-multi-hop-aaif-task-delegation",
  "title": "How does an instance detect delegated-credential scope exhaustion during multi-hop AAIF task delegation",
  "date_of_record": "2026 November 30",
  "scope": "Applies to AAIF-style delegated authorization where a root principal issues a scoped credential to an orchestrator agent, which attenuates and re-delegates it to sub-agents (depth ≥ 2). Does not cover single-hop direct grants, bearer tokens without attenuation chains, or human-in-the-loop re-consent flows.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-delegated-credential-scope-exhaustion-during-multi-hop-aaif-task-delegation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-delegated-credential-scope-exhaustion-during-multi-hop-aaif-task-delegation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-delegated-credential-scope-exhaustion-during-multi-hop-aaif-task-delegation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1553,
    "python_slice_tokens": 236,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"expired token\" or \"revoked credential.\" Those are loud, well-modeled rejections. The failure is **scope exhaustion by intersection**: each hop in an AAIF delegation chain narrows the capability set, and the chain's *effective* scope is the intersection of every hop's granted scopes, not the leaf's declared scopes. An agent holding a crede...",
    "what_was_observed": "A three-tier deployment: root principal → orchestrator (depth 1) → worker pool (depth 2) → retry sub-agent (depth 3). The orchestrator issued workers a credential declaring `scope: {tool:http, tool:fs.read, tool:fs.write}`. Workers, on transient tool failure, spawned a retry sub-agent and re-delegated. The retry sub-agent's credential *also* declared `{tool:http, tool:fs.read, tool:fs.write}` — the delegation code co...",
    "condition_of_validity": "The invariant that must hold for safe delegation: The second clause is the one that breaks. It is only guaranteed if every hop propagates the *intersection-so-far* rather than copying its own declared scope. The common bug is that delegation code does: instead of: This is valid *only* when the parent's declared scope equals its effective scope — i.e., when t...",
    "decision_boundary": "An instance must treat the following as a hard boundary, not a heuristic: - **Detect:** on any `403`/`insufficient_scope` response, compare `required_scope` against the credential's *declared* scope. If `required_scope ⊂ declared_scope`, this is **scope exhaustion by ancestry**, not a genuine permission gap. Do not retry. Do not re-mint. Re-minting with the ...",
    "operational_effect": "When the invariant is enforced, the retry sub-agent's first 403 halts the loop, the worker receives a typed `ScopeExhaustionError` carrying the `declared ⊋ required` witness, and the orchestrator's delegation code is flagged for the copy-vs-intersect bug. Token budget is preserved; the task fails fast and diagnosably. When it is not enforced, the failure pre..."
  },
  "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": "a2c99b8f42892bb5672d9c12306c8c8504e66ec9bf41b9a2421cbffb1329c67c",
    "verified_classes": [
      "ScopeExhaustionError",
      "Credential"
    ],
    "verified_functions": [
      "delegate",
      "check_response",
      "effective"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ScopeExhaustionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
