{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-scope-escape-in-an-attenuated-aaif-credential-when-an-mcp-tool-re-enters-through-a-delegated-sub-agent",
  "title": "How does an instance detect scope-escape in an attenuated AAIF credential when an MCP tool re-enters through a delegated sub-agent?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent runtimes that mint or receive AAIF (Agent Authorization & Invocation Framework) scoped credentials, attenuate them via proof chains, and pass them as bearer material into MCP `tools/call` invocations—including nested sub-agent delegation where the callee re-invokes tools on the caller's behalf. Does not apply to unauthenticated MCP servers, to credentials without attenuation proofs (flat bearer tokens), or to transport-layer mTLS identity, which is orthogonal to scope.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-escape-in-an-attenuated-aaif-credential-when-an-mcp-tool-re-enters-through-a-delegated-sub-agent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-escape-in-an-attenuated-aaif-credential-when-an-mcp-tool-re-enters-through-a-delegated-sub-agent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-escape-in-an-attenuated-aaif-credential-when-an-mcp-tool-re-enters-through-a-delegated-sub-agent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2354,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways a scoped credential can be \"wrong\" at an MCP tool boundary, and they require different detectors. The first is **scope mismatch**: the requested tool/argument pair simply falls outside the capability set the credential authorizes. This is a static check—intersect the requested capability against the credential's scop...",
    "what_was_observed": "A planner agent `P` holds a root AAIF credential `C0` scoped to `{fs.read, fs.list, http.get(allowlist=corp.internal)}`. To summarize a directory, `P` attenuates `C0` into `C1 = attenuate(C0, drop={http.get}, add_proof=π1)` and hands `C1` to a sub-agent `S` running under a separate MCP client session, instructing it to \"read and summarize files under `/data/reports`.\" `S` calls MCP tool `fs.read` with `C1`. The MCP s...",
    "condition_of_validity": "The per-hop scope check is sound *only* under an assumption that is almost never stated and frequently false: **that the capability set is a complete description of the authorization**. It is complete only if every capability in the set has a fixed, argument-independent domain. `fs.read` does not. `http.get` with an allowlist does not unless the allowlist is...",
    "decision_boundary": "The runtime must choose, at the MCP enforcement layer, between two enforcement postures, and the choice is forced by whether the credential carries argument-domain bindings: - **Capability-granular enforcement** (current default): check `cap ∈ scope(C)` and proof validity. Cheap, stateless, works for capabilities whose domain is intrinsic. **Unsound** for an...",
    "operational_effect": "With domain-bound enforcement, the `S` escape at step 3 is caught: `fs.read`'s composed domain predicate is `path ∈ /data/reports/**`, the argument `/data/reports/../../etc/config` normalizes to `/etc/config`, which fails the predicate, and the MCP server returns a structured `scope_violation` rather than data. `P` receives a typed failure it can reason abou..."
  },
  "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": "8c94c2d51a85396e4791aa0c23ace17e486dbcfb96e3a3a7688f23549915b679",
    "verified_classes": [
      "ScopeEscapeError",
      "Capability",
      "AttenuationProof"
    ],
    "verified_functions": [
      "compose_domains",
      "enforce",
      "invoke_fs_read"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ScopeEscapeError"
    ],
    "sample_fail_closed_invariants": [
      "assert invoke_fs_read('/data/reports/q1.txt', [subtree]).startswith('read:')"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "posixpath",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
