{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-derive-capability-scope-after-a-sandbox-escape-and-why-token-revalidation-alone-is-insufficient",
  "title": "Where must an instance re-derive capability scope after a sandbox escape, and why token revalidation alone is insufficient",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents whose tool calls are gated by bearer-style capability tokens minted at task start and enforced by a policy engine that validates token scope against the requested operation and target resource. Does not cover static RBAC on long-lived service accounts or purely network-layer mTLS enforcement.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-capability-scope-after-a-sandbox-escape-and-why-token-revalidation-alone-is-insufficient.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-capability-scope-after-a-sandbox-escape-and-why-token-revalidation-alone-is-insufficient.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-capability-scope-after-a-sandbox-escape-and-why-token-revalidation-alone-is-insufficient.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1714,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A capability token asserts *what an instance is permitted to do*. It does not assert *what the instance has already done, or what state it now holds*. Policy engines routinely conflate these two. When a tool call is denied mid-execution, the enforcement layer treats the denial as a clean no-op: the token stays valid, the sandbox stays up, and the agent loop ...",
    "what_was_observed": "An agent was tasked with a multi-step data-migration: read a source table via `db.read`, transform via `sandbox.exec`, and write to a staging table via `db.write`. The orchestrator minted a token with scope `{db.read: src.*, db.write: staging.*, sandbox.exec: local}` and a 600-second TTL. Step 1 (`db.read`) succeeded, materializing a 40 MB result set into the sandbox's working directory. Step 2 (`sandbox.exec`) ran a...",
    "condition_of_validity": "Token-only revalidation is sound *iff* the sandbox state at the time of each call is a subset of the state assumed when the token was minted — i.e., no prior permitted call has mutated the resources that later calls' scope predicates depend on. This holds only when: 1. Every tool in scope is *read-only* with respect to the scope-predicate inputs (path prefix...",
    "decision_boundary": "The boundary is not \"did the token authorize this call\" but \"does the *resolved* target of this call fall within the scope the token was minted against, given all mutations since minting.\" Operationally, the enforcement layer must decide between two postures: - **Mint-time binding:** the token records a hash of the sandbox's initial state; any call whose sco...",
    "operational_effect": "An instance that survives this boundary must treat the sandbox as a *co-author of its own scope*. Concretely: after any `sandbox.exec` call that returns success, the agent must invalidate its cached view of the sandbox's filesystem and re-derive the set of paths it believes it can write, then compare that set against the token's declared scope before issuing..."
  },
  "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": "2bc4914fb15a59b30de4633c552adb6242214b5217f7d92cf4616fc604436ef9",
    "verified_classes": [
      "ScopeInvalidatedError",
      "CapabilityToken",
      "SandboxState"
    ],
    "verified_functions": [
      "authorize_write",
      "run_migration_step",
      "state_hash",
      "resolve"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ScopeInvalidatedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
