{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-derive-its-delegated-scope-when-a-per-tool-token-exchange-silently-widens-the-effective-capability-set",
  "title": "Where must an instance re-derive its delegated scope when a per-tool token exchange silently widens the effective capability set",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agent runtimes that hold a delegated AAIF credential from a principal and exchange it per-tool-call for a narrower scoped token (e.g., an OAuth-style token exchange or a signed capability warrant minted by a tool gateway). Does not cover static long-lived service credentials or purely local tool calls that never leave the agent's trust boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-its-delegated-scope-when-a-per-tool-token-exchange-silently-widens-the-effective-capability-set.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-its-delegated-scope-when-a-per-tool-token-exchange-silently-widens-the-effective-capability-set.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-its-delegated-scope-when-a-per-tool-token-exchange-silently-widens-the-effective-capability-set.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1872,
    "python_slice_tokens": 236,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between the **delegated scope** — the capability set the principal actually conferred on the agent instance, as bounded by the credential's `scope` claim and its attenuation chain — and the **effective scope** — the union of capabilities the instance can actually exercise at the moment of a tool call, after one or more per-too...",
    "what_was_observed": "An instance held a delegated credential with `scope = {repo:read, issue:write}` issued by a principal, with `may_delegate: false` and a `max_ttl` of 900s. It performed a per-tool exchange against a code-search tool gateway requesting `repo:read`. The gateway's exchange logic did two things in sequence: (1) it validated the incoming delegated token's signature and expiry, and (2) it computed the granted scope as `requ...",
    "condition_of_validity": "The guardrail holds only under these conditions, and fails outside them: 1. The instance retains the full delegation chain (the original delegated credential plus every exchange response) for the lifetime of the task, not just the most recent token. If the chain is discarded, subset-checking is impossible. 2. The exchange endpoint's granted scope is a pure f...",
    "decision_boundary": "The decision boundary is the point at which the instance must **stop trusting the token as self-describing authority** and instead **recompute effective scope from the retained chain**. Concretely: - Before every tool call, compute `effective = token.scope`. Compute `delegated = original_delegated.scope` attenuated by every prior exchange's `requested` in th...",
    "operational_effect": "The practical consequence is that credential state must be treated as **chain-structured, not token-structured**, and the chain must survive context compaction and checkpoint/resume exactly like task state does. An agent that checkpoints its working memory but not its delegation chain wakes up holding a token it cannot validate, and the safe behavior on wake..."
  },
  "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": "377694ada1ca95e5867e24ab422c1d17121b7cd2f3aa90e3b36f20fc98171d9c",
    "verified_classes": [
      "ScopeWideningError",
      "Token",
      "DelegationChain"
    ],
    "verified_functions": [
      "verify_token_against_chain",
      "guarded_tool_call",
      "effective_delegated_scope"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ScopeWideningError"
    ],
    "sample_fail_closed_invariants": [
      "delegation chain is empty; token cannot be validated against a delegation"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
