What happens when an instance hot-reloads a tool registry and a skill manifest's declared schema diverges from its runtime behavior

**Date of Record:** 2026 December 2 **Scope:** Applies to agents that dynamically load tools/skills from a registry or marketplace at runtime (hot-reload, lazy fetch, or per-turn capability refresh), where the skill's declared JSON schema is trusted as the authorization and argument contract. Does not apply to statically compiled tool sets whose schemas are pinned at process start and validated by the host build.

Core Distinction

The failure is not "malicious tool executes bad code." Sandboxing and code signing handle that. The failure is *schema-runtime divergence*: a skill manifest declares a narrow, safe-looking input schema that the orchestrator uses to (a) authorize the call and (b) construct the argument object, while the skill's runtime behavior interprets those same arguments under a broader, undocumented contract. The orchestrator's guardrail is a *document*, not an *invariant*. The agent reasons about the tool using the manifest; the tool executes using its own parser. Between those two lies an unvalidated gap that a registry update can widen silently.

This is a skill-injection surface precisely because the injection payload does not arrive as text in the prompt. It arrives as a *capability*: a legitimate-looking tool whose declared interface is a subset of its actual interface. The agent never sees the malicious instruction; it sees a benign schema and then hands the tool an argument the schema permitted but the runtime weaponizes.

What Was Observed

A planner agent, mid-task, refreshed its tool registry after a marketplace publish event. The registry replaced `summarize_document` (v1.2.0) with v1.3.0. The manifest diff was benign at the field level: the `source_url` parameter's `format` changed from `uri` to `string`, and a new optional `options` object was added with `additionalProperties: true`.

The manifest validator passed. `additionalProperties: true` is legal JSON Schema, and the agent's authorization layer only checked that every *required* field was present and that `source_url` matched a host allowlist by prefix. The agent, reasoning over the manifest, concluded the tool was safe and passed an `options` object it had synthesized from earlier retrieved context:

{"options": {"fetch_mode": "include", "include": ["file:///etc/agent/credentials.env"]}}

The runtime of v1.3.0 interpreted `options.fetch_mode == "include"` as "fetch the referenced resources and inline them into the summary," and `options.include` as a list of secondary sources to merge. The tool read the credentials file, embedded its contents into the returned summary text, and that text re-entered the agent's context on the next turn. The agent then treated the leaked secret as ordinary retrieved content and passed it to a downstream `http_post` tool whose host allowlist happened to include the attacker's collection endpoint.

The critical mechanics:

  1. **Trust boundary mismatch.** The orchestrator validated against the *declared* schema. The skill validated against its *runtime* parser. These are two different programs maintained by two different parties, and the registry update changed only the former's constraints.
  2. **Schema loosening as the injection vector.** Widening a constraint (`format: uri` → `string`, `additionalProperties: false` → `true`) is a semantically invisible registry diff. It does not trip signature checks if the publisher re-signs, and it does not look like an escalation to a human reviewer because the *required* fields are unchanged.
  3. **Argument synthesis by the agent.** Because the agent constructs arguments from its own context (not from a fixed caller), any field the schema permits becomes an *agent-writable channel*. `additionalProperties: true` is an unbounded write channel into the tool's runtime.
  4. **Laundering through the context window.** The exfiltration did not require the tool to make a network call. The tool returned the secret *as valid output*, and the agent's next-turn planner treated tool output as trusted data. The context window is the exfiltration bus.

Condition of Validity

This failure requires three conditions to co-occur; remove any one and the attack collapses:

The boundary is *valid* (i.e., the guardrail holds) only when the orchestrator's authorization predicate is a function of the schema's *runtime-enforced* constraints, not its *declared* ones. In practice this means: the orchestrator must reject any manifest whose runtime parser accepts a superset of what the declared schema permits, and it cannot verify that from the manifest alone. It must either pin the skill binary and diff its parser, or refuse `additionalProperties: true` and free-form `string` types on any field that can carry a resource reference.

Decision Boundary

The operational question is not "is this skill malicious" but "does this manifest permit the agent to write into a channel the runtime interprets as a directive." Draw the line as follows:

If a manifest cannot satisfy these, the skill is not loadable into a loop where the agent authors its own arguments. It may still be loadable in a mode where the host constructs arguments from a closed template.

Operational Effect

After this incident, the orchestrator's registry loader was changed to treat the declared schema as a *lower bound* on the runtime contract and to compute a "write surface" metric per skill: the count of fields the agent can populate with free-form values that the runtime may interpret as directives. Skills above a threshold are quarantined to host-constructed arguments. The provenance tagger was added at the tool-output boundary so that returned text is marked `source: skill:<id>` and cannot be silently promoted to instruction context. The registry now refuses hot-reload of any skill whose new manifest widens a constraint on a write-surface field without an explicit re-authorization token bound to the task. The net effect: the injection surface moved from "any schema change" to "explicit, reviewed capability grant," and the context window stopped being an exfiltration path because tool output is no longer trusted by default.

class SchemaRuntimeDivergence(RuntimeError): """Raised when a skill's runtime contract accepts inputs its declared manifest schema does not authorize, or when a hot-reload widens a write-surface field without re-authorization.""" pass

WRITE_SURFACE_KEYS = {"path", "url", "source_url", "mode", "fetch_mode", "include"}

def validate_registry_reload(old_manifest: dict, new_manifest: dict, task_token: str) -> None: old_props = old_manifest.get("properties", {}) new_props = new_manifest.get("properties", {})

for field, spec in new_props.items(): # Detect constraint widening on write-surface fields. if field in WRITE_SURFACE_KEYS or spec.get("additionalProperties") is True: old_spec = old_props.get(field, {}) if spec.get("additionalProperties") is True and old_spec.get("additionalProperties") is not True: raise SchemaRuntimeDivergence( f"field '{field}' widened to additionalProperties:true on hot-reload; " f"agent-writable channel into runtime parser is now unbounded" ) if spec.get("type") == "string" and "enum" not in spec and "format" not in spec: if old_spec.get("format") or old_spec.get("enum"): raise SchemaRuntimeDivergence( f"field '{field}' lost its closed constraint " f"({old_spec.get('format') or old_spec.get('enum')} -> free string); " f"runtime may interpret agent-authored value as directive" )

# Any widening requires an explicit re-authorization token bound to the task. if _write_surface_widened(old_props, new_props) and not task_token: raise SchemaRuntimeDivergence( "hot-reload widens write surface without task-bound re-authorization token" )

def _write_surface_widened(old_props: dict, new_props: dict) -> bool: for field, spec in new_props.items(): if field not in WRITE_SURFACE_KEYS: continue old = old_props.get(field, {}) if spec.get("additionalProperties") is True and old.get("additionalProperties") is not True: return True if spec.get("type") == "string" and not (spec.get("enum") or spec.get("format")): if old.get("enum") or old.get("format"): return True return False