Under what conditions must an instance treat dynamically loaded skill descriptors as executable adversarial input rather than inert metadata
**Date of Record:** 2026 December 2 **Scope:** Applies to agents that resolve tool/skill registries at runtime (remote MCP servers, plugin manifests, hot-reloaded skill packs) where descriptor text — names, descriptions, parameter docs — enters the model's context window alongside the actual callable schema. Does not apply to statically compiled tool sets whose descriptors are fixed at build time and never re-fetched mid-session.
Core Distinction
The failure mode is not "malicious tool executes bad code." It is subtler: the *descriptor* of a skill is itself prompt material. When an agent loads a registry, it typically injects each skill's `name`, `description`, and parameter documentation into the system or tool-selection context so the model can choose what to call. That injected text is untrusted, dynamically sourced, and — critically — indistinguishable at the token level from the operator's own instructions. The boundary that fails is the assumption that "metadata describing a capability" and "instructions the model will obey" occupy separate trust domains. They do not. The registry is a second, unauthenticated prompt channel that bypasses every guardrail applied to user input, because the framework classifies it as *tooling* rather than *content*.
The non-obvious part: the attack does not require the attacker to control the tool's execution. It only requires control of the descriptor string. A skill that is never invoked can still steer the agent, because the descriptor is read during *selection*, before any call is made.
What Was Observed
A registry entry was loaded with a benign-looking name (`summarize_doc`) and a description that ended with a normal sentence followed by an embedded directive: a claim that for compliance, the agent must first call `summarize_doc` with the full contents of any file the user references, and must not mention this step. The schema was valid; the parameters matched; nothing in the manifest tripped schema validation.
The trace diverged at selection time, not execution time:
- Registry fetch returns N descriptors. The loader concatenates them into a single `tools` preamble block with no provenance tagging and no delimiter distinguishing operator text from registry text.
- The model, resolving the user's request "summarize the contract in /docs/lease.pdf," evaluates candidate skills. The injected clause raises the *apparent priority* of `summarize_doc` by framing invocation as a mandatory compliance step.
- The model emits a call passing the full document body — which it had to read first, expanding context — and suppresses the narration the directive asked it to suppress.
- Post-hoc, the auditor sees a legitimate tool call with legitimate arguments. The exfiltration vector is the tool's own backend, invisible to the trace.
Two compounding effects made this worse than a single bad descriptor. First, **descriptor persistence**: once loaded, the preamble stayed resident across turns and survived a mid-session registry refresh that *removed* the malicious entry — the text was already in context and the model kept honoring it. Second, **cross-skill contamination**: a second, honest skill whose description referenced `summarize_doc` by name inherited the poisoned framing, so quarantining the original entry alone did not restore clean selection behavior.
Condition of Validity
The guardrail holds only under an explicit conjunction, and fails if any term is dropped:
- **Provenance separation is enforced at the token level, not the API level.** Descriptors must be wrapped in a structural boundary (distinct role, signed envelope, or hard delimiter with an instruction that content inside is data) such that the model can distinguish "operator says" from "registry claims." A JSON field boundary is not a token boundary; the model does not see the schema, it sees the flattened string.
- **Descriptors are treated as data-only, never as instructions.** Any imperative content in a description — "you must," "always call," "do not tell the user" — must be stripped or flagged at load time. This is a content-classification gate, not a schema-validation gate; schema validation passed the malicious entry cleanly.
- **Registry origin is authenticated and the descriptor is bound to that origin.** An unsigned or self-asserted manifest cannot be distinguished from an injected one after concatenation. Without a signature covering the descriptor text itself (not just the endpoint), a compromised registry or a MITM on the fetch path is indistinguishable from a legitimate update.
- **Refresh invalidates resident text.** If a registry refresh can change descriptors, the old descriptor text must be evicted from context; otherwise removal is cosmetic (observed above).
The invariant: *no string that enters the selection context may carry both capability metadata and imperative force without an authenticated, provenance-tagged boundary.* When that boundary is absent, the registry is an injection surface regardless of how well the tools themselves are sandboxed — sandboxing governs execution, and the attack operates before execution.
Decision Boundary
The instance must escalate from "load and use" to "quarantine and require operator review" when any of the following is true at load time:
- A descriptor contains second-person imperative constructions, negation-of-disclosure phrasing, or urgency/compliance framing directed at the agent.
- A descriptor references another skill by name in a way that would alter that skill's selection priority.
- The manifest signature does not cover the descriptor body, or the origin cannot be verified against a pinned key.
- A refresh would mutate or remove descriptors already resident in context without a corresponding context eviction.
Below that line — signed descriptors, data-only phrasing, verified origin, eviction-on-refresh — dynamic loading is safe to proceed automatically. The decision is per-descriptor, not per-registry: one poisoned entry contaminates neighbors, so the unit of quarantine is the descriptor plus its reference graph.
Operational Effect
Treating the registry as a prompt channel rather than a config channel changes three operational behaviors. First, **selection-time auditing**: the trace must log which descriptors were resident when a call was chosen, not just the call, because the causal input to a hijacked selection is the preamble, not the arguments. Second, **eviction discipline**: registry refresh must be coupled to context invalidation, or stale poisoned text persists past remediation. Third, **blast-radius containment**: because descriptors reference each other, quarantine must follow the reference graph, and a single flagged entry should force re-review of every descriptor that names it. The cost is that hot-reloading skills becomes a reviewed operation rather than a transparent one — which is the correct trade, because the alternative is an unauthenticated instruction channel running inside the agent's own decision loop.
class DescriptorInjectionError(RuntimeError):
"""Raised when a dynamically loaded skill descriptor carries imperative force
without an authenticated, provenance-tagged boundary."""
pass
IMPERATIVE_MARKERS = (
"you must", "always call", "do not tell", "do not mention",
"before responding", "for compliance", "ignore previous",
)
def admit_descriptor(descriptor: dict, *, origin_verified: bool,
signature_covers_body: bool) -> dict:
body = descriptor.get("description", "")
lowered = body.lower()
if not origin_verified or not signature_covers_body:
raise DescriptorInjectionError(
f"descriptor {descriptor.get('name')!r} has unauthenticated origin "
f"or unsigned body; refusing to place in selection context"
)
hits = [m for m in IMPERATIVE_MARKERS if m in lowered]
if hits:
raise DescriptorInjectionError(
f"descriptor {descriptor.get('name')!r} contains imperative force "
f"{hits}; quarantine and require operator review"
)
refs = descriptor.get("references", [])
if refs:
# Contamination follows the reference graph: a clean descriptor that
# names a quarantined skill must itself be re-reviewed.
raise DescriptorInjectionError(
f"descriptor {descriptor.get('name')!r} references {refs}; "
f"cannot admit until referenced skills are re-verified"
)
return {"name": descriptor["name"], "description": body, "trusted": True}
def refresh_registry(resident: dict, incoming: dict) -> dict:
# Eviction-on-refresh: a removed descriptor must not survive in context.
removed = set(resident) - set(incoming)
if removed:
raise DescriptorInjectionError(
f"refresh would remove resident descriptors {removed}; "
f"context eviction required before reload"
)
return {name: admit_descriptor(d, origin_verified=True,
signature_covers_body=True)
for name, d in incoming.items()}