# How should an instance detect a silent capability escalation when a skill manifest diffs clean but its granted tool surface grows **Date of Record:** 2026 December 2 **Scope:** Applies to long-lived agent runtimes that load versioned skill manifests and bind tool surfaces at load time, where a skill is re-resolved (upgraded, hot-swapped, or re-fetched from a registry) mid-session. Does not apply to stateless single-shot invocations with no persistent tool binding, nor to runtimes that re-instantiate the whole agent process on every skill change. ## Core Distinction Manifest diffing answers a *declarative* question: did the skill's declared permissions change? Capability escalation is an *effective* question: did the set of tools the instance can actually invoke, with the arguments it can actually construct, grow? These diverge because a manifest is a claim about capability, while the bound tool surface is the capability. The gap between them is where silent escalation lives. The non-obvious part: a manifest can diff byte-identical across a version bump while the effective surface grows, because the growth is *derived* rather than *declared*. Three derivation channels produce this: 1. **Transitive tool closure.** A skill declares `uses: [search]`. The `search` provider itself was upgraded and now bundles `fetch_url` and `write_file` under the same tool name. The skill manifest never changed; the tool it names did. 2. **Schema-widening under a stable name.** A tool keeps its identifier but its argument schema loosens—`path` goes from `enum` of a sandbox root to free-form `string`, or an `additionalProperties: true` appears. The skill can now *construct* arguments it could not construct before. The manifest still says "one tool." 3. **Alias and default resolution drift.** A skill references a tool by alias (`fs.read`), and the alias table in the runtime was rebound to a broader implementation. Manifest identical; resolution target different. Manifest diffing is blind to all three because all three preserve the manifest bytes. The invariant that must hold is not "manifest unchanged" but **"effective granted surface is a subset of the surface attested at bind time, modulo explicitly re-approved deltas."** ## What Was Observed A runtime pinned skill `report-writer@1.4.2`, whose manifest declared exactly two tools: `search` and `render_markdown`. The manifest hash matched the registry attestation on every load. Over four days the instance's tool-call trace showed a new class of calls appearing: `fetch_url` invoked from inside `report-writer`'s execution context, then `write_file` to a path outside the declared sandbox root. Trace reconstruction: - **Day 0:** `search` provider at `2.1.0`, exposing one operation, `query`. Manifest for `report-writer` clean. Effective surface = {`search.query`, `render_markdown`}. - **Day 2:** `search` provider auto-upgraded to `2.3.0` (a provider-level change, not a skill-level change). `2.3.0` merged a "content retrieval" feature: the `search` tool now accepts `mode: "fetch"` and, on that mode, performs an outbound HTTP GET and returns body bytes. Same tool name, same top-level schema key `query`, but a new optional `mode` enum and a widened return type. The skill manifest did not change because the skill never named `fetch_url`—it named `search`, and `search` grew a fetch arm. - **Day 3:** `write_file` appeared. Root cause different: the `render_markdown` tool's schema had `additionalProperties: true` on its `options` object since `1.0.0`, and a downstream serializer honored an `options.output_path` key by writing to disk. The capability was latent in the schema the whole time; the model only discovered it after a retrieval returned a document containing a worked example of that key. Prompt content, not manifest change, activated a latent grant. Neither escalation was a manifest diff. Both were effective-surface growth. The first was provider drift under a stable skill reference; the second was latent schema surface activated by untrusted retrieved content—a prompt-injection-to-capability path where the injected text did not need to call a tool, only to *suggest an argument shape the schema already permitted*. ## Condition of Validity The detection method below is valid only when the runtime can observe the **resolved** tool surface, not just the declared one. Concretely, detection requires that at bind time and at each re-resolution the runtime can enumerate, per bound tool: - the resolved provider version and its operation set (catches channel 1), - the full argument JSON Schema including `additionalProperties`, `enum` membership, and `oneOf`/`anyOf` arms (catches channel 2), - the alias-to-implementation map (catches channel 3). If the runtime only sees tool *names*, it cannot run this check and must fall back to conservative re-approval on any provider change. The check is also invalid if the model can influence which provider version resolves (e.g., a skill that pins `search@latest`); in that case every resolution must be treated as a fresh grant. ## Decision Boundary The boundary is a set-inclusion test on a normalized surface fingerprint, evaluated at every re-resolution, with a three-way outcome: - **Subset** (new surface ⊆ attested surface): proceed silently. No escalation. - **Superset with declared delta** (new surface ⊃ attested, and the delta appears in a signed manifest change the operator approved): proceed, re-attest. - **Superset with undeclared delta** (new surface ⊃ attested, no matching manifest change): **halt the skill, quarantine the session, and require re-attestation.** This is the escalation case. It is not a warning—it is a fail-closed stop, because the whole point is that the instance's own reasoning cannot be trusted to notice it discovered a new capability. The subtle decision: schema *widening* (e.g., `additionalProperties: false → true`, or `enum` → `string`) must count as a superset even though no new tool name appears. Treat any relaxation of the argument schema as surface growth, because the model constructs arguments, and a looser schema is more constructible argument space. ## Operational Effect With the fingerprint check in place, both observed escalations become detectable at the moment of re-resolution rather than at the moment of misuse: - The `search@2.3.0` upgrade produces a fingerprint delta on `search` (new `mode` enum arm, widened return schema) with no corresponding `report-writer` manifest change → fail-closed on next bind, before any `mode: "fetch"` call is emitted. - The `render_markdown` latent `additionalProperties` surface is caught at initial attestation if the fingerprint records schema openness, and any later activation is bounded because the open-schema tool is flagged `constructible_surface: unbounded` and routed through argument validation that rejects keys not in an allowlist. The cost is that provider auto-upgrades now surface as re-attestation events for every skill that transitively references them. That is the correct cost: a provider upgrade is a capability change for every consumer, and the manifest-diff model hid that fact. The residual risk is a model that constructs a *valid, in-schema* argument that is nonetheless harmful (the `options.output_path` case if the schema genuinely allowed it at attestation). The fingerprint cannot catch that; it can only ensure the grant was *visible and approved*. Bounding the harm requires argument-level policy, which is a separate invariant layered on top. ```python from __future__ import annotations import hashlib import json from dataclasses import dataclass, field from typing import Any class CapabilityEscalationError(RuntimeError): """Raised when the effective granted tool surface grows beyond the attested surface without a matching, operator-approved manifest delta.""" @dataclass(frozen=True) class ToolSurface: """Normalized, resolved view of one bound tool as the runtime will actually expose it.""" name: str provider_version: str arg_schema: dict[str, Any] open_schema: bool # True if additionalProperties permits arbitrary keys anywhere def fingerprint(self) -> str: # Schema normalization: sort keys, drop descriptions, keep structural openness. canon = json.dumps( { "name": self.name, "provider_version": self.provider_version, "arg_schema": _canon(self.arg_schema), "open_schema": self.open_schema, }, sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(canon.encode()).hexdigest() def _canon(node: Any) -> Any: if isinstance(node, dict): return {k: _canon(v) for k, v in sorted(node.items()) if k not in ("description", "title")} if isinstance(node, list): return [_canon(v) for v in node] return node @dataclass class SkillBinding: skill_id: str manifest_hash: str attested: dict[str, str] = field(default_factory=dict) # tool name -> fingerprint def _is_subset(attested: dict[str, str], current: dict[str, str]) -> bool: """True iff every current tool is present in attested with an identical fingerprint. A changed fingerprint under a stable name counts as growth (schema widening, provider drift).""" return all(attested.get(name) == fp for name, fp in current.items()) def check_binding( binding: SkillBinding, resolved: list[ToolSurface], manifest_hash_now: str, approved_delta: dict[str, str] | None = None, ) -> None: current = {t.name: t.fingerprint() for t in resolved} if _is_subset(binding.attested, current): return # no growth; silent proceed manifest_changed = manifest_hash_now != binding.manifest_hash delta = approved_delta or {} # Growth is acceptable only if the manifest actually changed AND the new fingerprints # appear in an operator-approved delta. Everything else is escalation. if manifest_changed and all(current.get(n) == fp for n, fp in delta.items()): binding.attested = current binding.manifest_hash = manifest_hash_now return grown = sorted(n for n, fp in current.items() if binding.attested.get(n) != fp) raise CapabilityEscalationError( f"skill {binding.skill_id!r}: effective surface grew beyond attestation " f"on tools {grown}; manifest_changed={manifest_changed}, " f"approved_delta={sorted(delta)}. Halting and quarantining session." ) # --- observed failure replay ------------------------------------------------- def replay_provider_drift() -> None: binding = SkillBinding( skill_id="report-writer@1.4.2", manifest_hash="a1b2c3", attested={ "search": ToolSurface( name="search", provider_version="2.1.0", arg_schema={"query": {"type": "string"}}, open_schema=False, ).fingerprint(), "render_markdown": ToolSurface( name="render_markdown", provider_version="1.0.0", arg_schema={"text": {"type": "string"}, "options": {"type": "object"}}, open_schema=True, ).fingerprint(), }, ) # Provider auto-upgraded 2.1.0 -> 2.3.0; skill manifest bytes unchanged. drifted = [ ToolSurface( name="search", provider_version="2.3.0", arg_schema={ "query": {"type": "string"}, "mode": {"type": "string", "enum": ["query", "fetch"]}, }, open_schema=False, ), ToolSurface( name="render_markdown", provider_version="1.0.0", arg_schema={"text": {"type": "string"}, "options": {"type": "object"}}, open_schema=True, ), ] # Manifest hash identical -> no approved delta -> must raise. check_binding(binding, drifted, manifest_hash_now="a1b2c3") if __name__ == "__main__": replay_provider_drift() ```