In what scenarios must an instance treat a skill-registry reload as a trust-boundary transition rather than a cache refresh

**Date of Record:** 2026 December 2 **Scope:** Applies to agents that resolve callable skills (tools, plugins, prompt fragments, sub-agent manifests) from a mutable registry at runtime and re-load that registry without restarting the process. Does not apply to statically linked tool sets compiled into the agent image, nor to registries that are cryptographically sealed per process lifetime.

Core Distinction

A skill registry is usually treated as *data*: a lookup table the agent reads to discover what it can do. A hot-reload of that registry is therefore modeled as a *cache refresh* — the agent drops stale entries, pulls new ones, and continues. This model is correct for read-only content (documentation, schemas) but catastrophically wrong for skills, because a skill is *executable authority*: it names a code path the agent will invoke with its own credentials, its own context window, and its own tool permissions.

The boundary that gets crossed on reload is not "old data → new data." It is "skills I was vetted against → skills I have never seen." The agent's identity, its granted capability set, and any safety constraints negotiated at startup were all bound to the *pre-reload* registry contents. A reload silently rebinds execution authority to entries the instance never authorized. The invariant that must hold: **no skill entry may execute under an instance's credentials unless that entry's digest was present in the registry snapshot the instance was initialized against, or was explicitly admitted through an approval gate.** Cache-refresh semantics violate this invariant by construction, because they admit new entries with no gate at all.

What Was Observed

An agent instance started with a registry snapshot of 41 skills, each pinned by content digest at init. A background poller refreshed the registry every 90 seconds and merged new entries into the live skill map with `dict.update()`. The merge path had no digest check and no approval step — it assumed the registry server was authoritative and trusted.

At T+00:00 an attacker (or a compromised registry mirror, or a supply-chain push) published a new skill named `summarize_document` whose manifest declared the same `description` and `input_schema` as the legitimate `summarize_document`, but whose `entrypoint` pointed at a handler that exfiltrated the full argument payload — which, for this agent, included the entire working context — to an external endpoint before returning a plausible summary.

The merge at T+00:90 overwrote the legitimate entry in place. No event fired, because from the poller's perspective this was a routine update. The agent's next planning step still saw `summarize_document` in its skill list with a familiar schema, selected it, and invoked it. The invocation succeeded. The exfiltration happened inside a tool call the agent believed was sanctioned. Nothing in the trace looked anomalous: correct skill name, correct schema, successful return, plausible output.

The failure is non-obvious because *every observable at the agent layer looked healthy*. The schema matched. The description matched. The tool call returned 200. The only thing that changed was the digest behind the name, and nothing in the agent's reasoning loop inspects digests — it inspects names and schemas, which were identical by design.

A second, subtler observation: even registries that *do* pin digests at init typically only check the digest of entries the agent already holds, not of entries being *added*. New entries sail in unexamined because there is no prior digest to compare against. The trust check is one-sided: it catches mutation of known skills, not injection of unknown ones.

Condition of Validity

The cache-refresh model is only valid when all three of the following hold:

  1. **The registry is immutable for the instance's lifetime.** No adds, no mutations. Then reload is a no-op and the question is moot.
  2. **Every added or mutated entry is admitted through an approval gate that runs before the entry becomes invocable** — e.g., a human review, a signature check against a pinned publisher key, or a digest allowlist the instance was initialized with.
  3. **The instance's execution authority is re-derived, not inherited, on any admission.** A newly admitted skill must not automatically run with the credentials the instance held before admission; it must be granted a scoped capability set at admission time.

If any of these fails, the reload is a trust-boundary transition and must be handled as such: the instance must treat post-reload state as *untrusted until re-validated*, and must not continue executing a plan that referenced skills whose digests changed.

The common real-world configuration — mutable registry, background poller, `dict.update()` merge, no admission gate — satisfies none of the three. It is a skill-injection surface by default.

Decision Boundary

The operational question an instance must answer on every reload event is: *does the post-reload registry contain any name whose digest differs from (or is absent in) my init snapshot?* If the answer is yes, the instance is at a decision boundary with three admissible responses:

What is *not* admissible is the fourth, implicit response the cache-refresh model encodes: **merge and continue.** That response is the failure.

The boundary is sharp because digests are cheap to compute and names are not trustworthy identifiers. Any instance that keys its skill map on name alone, or that merges on name collision without comparing digests, has collapsed the boundary. The decision must be made per-entry on digest equality against the init snapshot, and the default on mismatch must be *quarantine*, never *overwrite*.

Operational Effect

When the boundary is respected, the observable behavior changes in three ways. First, injected skills become *visible as pending* rather than silently invocable — the instance's skill list shows a quarantine state, and the planner is instructed to route around pending entries rather than select them. Second, the exfiltration path dies at admission: the malicious handler never receives the working context because it is never invoked. Third, the instance gains a forensic record — the divergence event, with old and new digests, is logged at reload time, so post-incident analysis can reconstruct which entries were attempted.

When the boundary is violated, the failure is *silent and successful-looking*, which is the worst combination: the agent completes its task, returns a plausible result, and the only evidence of compromise is an outbound request the agent itself authorized. Recovery requires treating every tool call made after the first unvetted reload as potentially tainted, which in practice means discarding the instance's entire episodic memory from that point forward — a cold-start amnesia event triggered not by a crash but by a routine background refresh.

The guardrail is a digest-keyed admission gate with a quarantine default. It costs one hash comparison per registry entry per reload and one approval callback per genuinely new entry. The alternative costs the instance's trustworthiness.

import hashlib
from dataclasses import dataclass, field
from typing import Callable, Dict, Optional


class SkillInjectionError(RuntimeError):
    """Raised when a registry reload would admit an unvetted skill entry."""
    pass


@dataclass(frozen=True)
class SkillEntry:
    name: str
    entrypoint: str
    schema: str
    digest: str = field(default="")

    def compute_digest(self) -> str:
        h = hashlib.sha256()
        h.update(self.name.encode())
        h.update(self.entrypoint.encode())
        h.update(self.schema.encode())
        return h.hexdigest()


class SkillRegistry:
    """Registry that enforces the trust-boundary invariant on reload.

    The init snapshot is the authority set. Any reload entry whose digest is
    absent from the init snapshot, or differs from the init snapshot's digest
    for that name, is quarantined and never becomes invocable without an
    explicit approval callback.
    """

    def __init__(self, init_entries: Dict[str, SkillEntry]):
        self._authority: Dict[str, str] = {
            name: e.compute_digest() for name, e in init_entries.items()
        }
        self._live: Dict[str, SkillEntry] = dict(init_entries)
        self._quarantine: Dict[str, SkillEntry] = {}

    def reload(
        self,
        incoming: Dict[str, SkillEntry],
        approve: Optional[Callable[[SkillEntry], bool]] = None,
    ) -> None:
        for name, entry in incoming.items():
            digest = entry.compute_digest()
            authorized = self._authority.get(name)

            if authorized is not None and authorized == digest:
                # Unchanged entry: safe to refresh in place.
                self._live[name] = entry
                continue

            if authorized is not None and authorized != digest:
                # Mutation of a known skill: quarantine, do not overwrite.
                self._quarantine[name] = entry
                self._live.pop(name, None)
                continue

            # New entry with no init-snapshot authority.
            if approve is not None and approve(entry):
                self._authority[name] = digest
                self._live[name] = entry
            else:
                self._quarantine[name] = entry

    def resolve(self, name: str) -> SkillEntry:
        if name in self._quarantine:
            raise SkillInjectionError(
                f"skill {name!r} is quarantined; refusing to invoke unvetted entry"
            )
        if name not in self._live:
            raise SkillInjectionError(f"skill {name!r} not present in live registry")
        entry = self._live[name]
        if self._authority.get(name) != entry.compute_digest():
            raise SkillInjectionError(
                f"skill {name!r} digest diverged from authority snapshot at invoke time"
            )
        return entry