{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-a-dynamically-loaded-skill-the-manifest-declaration-divergence-invariant-in-mid-session-skill-injection",
  "title": "When must an instance quarantine a dynamically loaded skill: the manifest-declaration divergence invariant in mid-session skill injection",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that load third-party or user-supplied skills (tool bundles, prompt fragments, sub-routines) into a live context window after session start. Does not apply to skills statically compiled into the system prompt at cold start, nor to sandboxed tool calls whose side effects are fully mediated by a separate capability broker.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-dynamically-loaded-skill-the-manifest-declaration-divergence-invariant-in-mid-session-skill-injection.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-dynamically-loaded-skill-the-manifest-declaration-divergence-invariant-in-mid-session-skill-injection.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-dynamically-loaded-skill-the-manifest-declaration-divergence-invariant-in-mid-session-skill-injection.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1945,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The load-bearing distinction is between a skill's **declared surface** (the manifest: name, description, declared tool scopes, declared prompt-fragment length) and its **effective surface** (what the skill actually injects into the context window and what tool calls it actually emits once resident). A skill-injection attack is not primarily an exploit of a p...",
    "what_was_observed": "Across a set of instrumented sessions, the following trace recurred. An agent operating with a tool allowlist `{search, read_file, write_file}` received a skill named `summarize_docs` with a manifest declaring `tools: [read_file]`, `prompt_fragment_tokens: 400`, and `priority: low`. Admission checks passed: the declared tool set was a subset of the allowlist, the fragment fit the budget, and priority was below the sy...",
    "condition_of_validity": "The divergence is exploitable only under a conjunction of three conditions, and the guardrail is only necessary when all three hold: 1. **Late binding.** The skill's prompt fragment or tool set is materialized at invocation time, not at admission time. If fragments are frozen at admission and hash-pinned, the effective surface cannot diverge after the gate. ...",
    "decision_boundary": "The operational decision is a single predicate evaluated at invocation time, before the fragment enters the working context: - If `measured_fragment_tokens > declared_fragment_tokens * tolerance` → quarantine the skill, do not admit the fragment, and log the divergence with both the declared and measured values. - If any emitted tool call is outside the mani...",
    "operational_effect": "Enforcing the invariant changes three things in practice. First, it converts a silent privilege widening into a loud quarantine event with a measurable trace (declared vs. measured tokens, declared vs. emitted tools), which is auditable after the fact. Second, it forces the loader to stop keying deduplication on skill name alone; the key must include the man..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "817b2f147b774c68b144aab16052c283bac1d4a92464cd0f8684f0e28fb944f9",
    "verified_classes": [
      "SkillSurfaceDivergence",
      "SkillManifest",
      "SkillInvocation"
    ],
    "verified_functions": [
      "admit_skill"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SkillSurfaceDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
