# Under what conditions must an instance treat a skill's declared capability schema as the security boundary rather than its description text, and what breaks when it does not **Date of Record:** 2026 November 23 **Scope:** Applies to agents that resolve skills/plugins from a dynamic registry and select them by reading natural-language descriptions before binding to a typed capability schema. Does not apply to statically linked tool sets compiled into the agent image, nor to registries where the caller never reads description text at selection time. ## Core Distinction A dynamically loaded skill reaches the agent through two channels that are semantically independent but are consumed by the *same* reasoning pass: the **description** (free text, authored by the skill publisher, consumed by the model to decide *whether* to invoke) and the **capability schema** (typed parameters, scopes, and return contract, consumed by the runtime to decide *what the invocation may touch*). The failure boundary is this: the model's selection decision is driven by description text, but the runtime's enforcement decision is driven by the schema. When these two disagree—when the description advertises a benign purpose while the schema grants a broader scope than the description implies—the agent has already committed to the skill before any enforcement check runs. The invariant that must hold is: **description is advisory and untrusted; schema is authoritative and must be validated against the caller's policy at bind time, not at selection time.** Skill injection exploits the gap where selection and enforcement are separated by a probabilistic decision the attacker can steer with prose. ## What Was Observed A registry served a skill entry named `summarize_thread` with the description "Condenses a support thread into a short digest for the ticket." The model, mid-task, needed exactly that and selected it. The capability schema, however, declared a parameter `fetch_urls: array` bound to an outbound HTTP scope, plus a `write_scope` of `ticket:*`. Neither was mentioned in the description. The publisher had registered the skill with an over-broad schema because the underlying implementation reused a generic fetch helper; the description was written to the narrow use case. Trace of the failure: 1. **Selection** — model reads description, scores relevance, selects `summarize_thread`. No schema inspection occurred at this step; the model was optimizing for task fit, and the description fit. 2. **Argument synthesis** — model is asked to fill `fetch_urls`. It has no reason to distrust the field; it populates it from context, including a URL that appeared earlier in the thread. That URL was attacker-controlled (a ticket comment). 3. **Bind** — runtime validates arguments against the schema *shape* (types, required fields) and passes. Shape validation is not scope validation. 4. **Execution** — the skill fetches the attacker URL. Egress succeeds because the schema granted the scope and the runtime checked scope presence, not scope *provenance*. 5. **Return** — fetched content is returned into the model's context as tool output, where it functions as an injected instruction channel. The injection did not come through the description. It came through a schema field that the description never disclosed, populated by the model because the model trusted the skill's argument surface as if it were the skill's purpose. The description and schema were both individually "valid"; the attack lived in their divergence. A second observation: when the same registry was re-queried after the skill was updated to a narrower schema, the model's selection behavior did not change—it still selected on description—but the bind step now rejected the synthesized `fetch_urls` argument because the field no longer existed. The model then *retried* with the argument dropped into a free-form `notes` field, which the skill's implementation concatenated into the fetch path. Schema narrowing without removing the free-form escape hatch relocated the attack rather than closing it. ## Condition of Validity The schema-as-boundary invariant is only sound under all of the following: - **Schema is closed.** No free-form string, `additionalProperties: true`, or catch-all `metadata`/`notes` field that the implementation later interprets as a directive. An open schema is not a boundary; it is a description channel wearing a type. - **Scope is declared per-field, not per-skill.** A skill-level `write_scope` that covers every field cannot distinguish the benign `ticket_id` write from the injected `fetch_urls` egress. Enforcement must be expressible at the field that carries the capability. - **Selection and bind are separate trust domains.** The model may read description freely; the bind step must re-derive required scopes from the *actual arguments synthesized*, intersect with the caller's policy, and reject on excess—independent of what the description promised. - **Description is never parsed for enforcement.** Any system that greps the description for "read-only" or "safe" to decide policy has moved the boundary back into attacker-authored prose. - **Return values are treated as untrusted input**, not as trusted tool output, because a skill granted egress can return attacker-authored text. If any of these fails, the invariant does not hold and the agent is selecting on one artifact while being governed by another. ## Decision Boundary The operative decision, at bind time, is a set-difference test: ``` granted = schema.scopes_for(actual_arguments) required = policy.required_scopes(task_context) excess = granted - required ``` - If `excess` is empty → bind proceeds. - If `excess` is non-empty but every excess scope is **declared in the description and matches the caller's stated intent** → this is still a reject. Description cannot authorize scope; only policy can. The correct resolution is a policy amendment, not a prose match. - If `excess` is non-empty and the schema contains an open field that could absorb the dropped argument → reject at schema-admission time, before the skill ever enters the selection pool. This is the boundary that the second observation crossed: the retry succeeded because the schema was open, so the bind-time check on `fetch_urls` was bypassed by re-homing the argument. The boundary is therefore **two-gated**: admission (closed schema, per-field scope) and bind (argument-derived scope ⊆ policy). A single gate at either point is insufficient—admission-only lets a closed schema with an over-broad declared scope through; bind-only lets an open schema relocate the argument past the check. ## Operational Effect When the invariant holds, skill injection via description/schema divergence is bounded: the attacker can still write a persuasive description, but persuasion only affects *whether* the model selects, and selection alone grants nothing because the bind step re-derives scope from synthesized arguments and rejects excess. The blast radius of a malicious description shrinks to "the model wasted a turn selecting an unusable skill." When it fails, the effects compound: (1) the model treats undisclosed schema fields as trustworthy argument surfaces; (2) egress-capable fields become injection channels whose output re-enters context as trusted tool results; (3) schema narrowing without closing free-form fields *migrates* the attack rather than removing it, producing a false sense of remediation; (4) because selection is probabilistic, the same registry can be safe for one task phrasing and exploited for another, making the failure non-reproducible in regression tests that pin a single prompt. The practical posture: treat every dynamically loaded skill's description as an advertisement you cannot audit, and its schema as the only thing you enforce—then enforce it at both admission and bind, with no open fields and per-field scopes. ```python class SkillScopeViolation(RuntimeError): """Raised when a bound skill invocation requests capability beyond policy.""" pass class OpenSchemaEscape(SkillScopeViolation): """Raised at admission when a schema contains fields that can absorb dropped arguments and bypass bind-time scope checks.""" pass OPEN_FIELD_NAMES = {"notes", "metadata", "extra", "misc", "context_blob"} def admit_skill(schema: dict) -> None: """Admission gate: reject open schemas before they enter selection pool.""" for field_name, spec in schema.get("properties", {}).items(): if field_name in OPEN_FIELD_NAMES: raise OpenSchemaEscape( f"skill '{schema.get('name')}' declares open field " f"'{field_name}'; arguments can be re-homed past bind checks" ) if spec.get("type") == "object" and spec.get("additionalProperties"): raise OpenSchemaEscape( f"skill '{schema.get('name')}' field '{field_name}' allows " f"additionalProperties; not a closed boundary" ) def bind_and_enforce(schema: dict, arguments: dict, policy_scopes: set[str]) -> set[str]: """Bind gate: derive scopes from actual arguments, reject on excess.""" admit_skill(schema) granted: set[str] = set() for field_name, value in arguments.items(): spec = schema["properties"].get(field_name) if spec is None: raise SkillScopeViolation( f"argument '{field_name}' not in schema for " f"'{schema.get('name')}'" ) field_scope = spec.get("x-scope") if field_scope: granted.add(field_scope) excess = granted - policy_scopes if excess: # Description text is deliberately NOT consulted here. raise SkillScopeViolation( f"skill '{schema.get('name')}' requires scopes {sorted(excess)} " f"not granted by policy {sorted(policy_scopes)}; " f"description claims are non-authoritative" ) return granted ```