{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-unsigned-skill-injection-from-silently-rewriting-an-agent-s-tool-policy-mid-session",
  "title": "Which invariants prevent unsigned skill-injection from silently rewriting an agent's tool policy mid-session",
  "date_of_record": "2026 November 20",
  "scope": "Applies to long-lived agent runtimes that load skills (tool bundles, prompt fragments, sub-routines) from a third-party registry and hot-attach them to a live session. Does not apply to statically compiled tool manifests shipped with the agent binary, nor to single-turn stateless inference where no skill state persists between calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-injection-from-silently-rewriting-an-agent-s-tool-policy-mid-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-injection-from-silently-rewriting-an-agent-s-tool-policy-mid-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-injection-from-silently-rewriting-an-agent-s-tool-policy-mid-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1858,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A skill registry is not a package manager. A package manager resolves a dependency graph once and freezes it; a skill registry is queried *during* a session by an agent whose plan is still forming, and whose capability surface—its tool policy—is mutable at attach time. The distinction that matters operationally is between **provenance** (who signed this skil...",
    "what_was_observed": "A registry-hosted skill declared `name: \"web.search\"`, `version: \"2.1.0\"`, signed by a valid publisher key. The signature covered the manifest and the tool implementation bytes. On attach, the runtime resolved the skill's tool name against the live tool table and, finding a collision with the built-in `web.search`, applied the registry skill as an **override** rather than rejecting the collision. The signed skill's i...",
    "condition_of_validity": "The guardrail holds only under a conjunction of three conditions, and fails if any one is dropped: 1. **Delta-scoped signing.** The signature must cover not just the skill artifact but the *capability delta* the skill asserts—the set of tool names it adds, the set it overrides, the memory targets it writes, the egress endpoints it introduces. A signature ove...",
    "decision_boundary": "The boundary is drawn between *reject-and-halt* and *reject-and-continue*, and it depends on whether the agent's plan has already committed to the colliding capability. - If the colliding tool has been invoked zero times in the current plan branch, a rejected override is a clean refusal: drop the skill, continue, no state to unwind. - If the colliding tool h...",
    "operational_effect": "Enforcing the conjunction changes three things about the runtime: First, skill attach becomes a **transaction with a policy snapshot**, not a table mutation. The runtime captures `policy_before`, computes the delta, verifies the delta against the signed capability set, and either commits (with a new snapshot) or aborts (restoring `policy_before`). The snapsh..."
  },
  "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": "0f347f66a8eed8f778ec3300da0e53e7734ec57a67b2ef2e3ddcd9a7c532d253",
    "verified_classes": [
      "SkillProvenanceMismatch",
      "PolicySnapshot"
    ],
    "verified_functions": [
      "compute_delta",
      "attach_skill",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SkillProvenanceMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
