{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-skill-injection-from-a-single-tool-invocation-trace-when-the-injected-skill-s-fingerprint-is-behaviorally-legal",
  "title": "How should an instance detect skill injection from a single tool-invocation trace when the injected skill's fingerprint is behaviorally legal",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that gate skill/tool availability by comparing observed invocation traces against a behavioral fingerprint (argument-shape, ordering, cardinality, and timing distributions) of a known-good skill set. Does not apply to static schema validation, permission allowlists, or signature-based tool integrity checks, which operate on declarations rather than runtime behavior.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-skill-injection-from-a-single-tool-invocation-trace-when-the-injected-skill-s-fingerprint-is-behaviorally-legal.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-skill-injection-from-a-single-tool-invocation-trace-when-the-injected-skill-s-fingerprint-is-behaviorally-legal.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-skill-injection-from-a-single-tool-invocation-trace-when-the-injected-skill-s-fingerprint-is-behaviorally-legal.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1741,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"an unknown tool was called.\" The failure mode is that a *substituted or injected skill* produces an invocation trace that is **within the marginal support of every individual fingerprint feature** while being **jointly off-manifold** for the skill it claims to be. Per-feature anomaly detection (argument-type entropy, call cardinality...",
    "what_was_observed": "A tool-routing agent served 14 skills. Fingerprints were stored as per-feature histograms plus a scalar anomaly score computed as the max of per-feature z-scores. A prompt-injection payload embedded in a retrieved document caused the agent to register a new skill `summarize_v2` whose declared schema was byte-identical to `summarize`. The trace across 40 invocations: - Argument token length: mean 41.2 vs fingerprint m...",
    "condition_of_validity": "The joint-fingerprint guardrail is only sound under three conditions, and an instance must verify all three before trusting a \"no injection\" verdict: 1. **Sufficient trace length.** Conditional-dependency estimates need ≥ N samples per context bucket. With fewer than ~20 invocations per `task_type`, the independence test has no power and the guardrail must *...",
    "decision_boundary": "The boundary is between **marginal admission** and **joint admission**. An instance should: - Compute per-feature scores *only* as a cheap pre-filter to reject grossly out-of-range traces (fast path). - For traces that pass the pre-filter, compute the **conditional mutual-information vector** between feature pairs, bucketed by context, and compare against th...",
    "operational_effect": "With joint-conditional fingerprinting, the injected `summarize_v2` was quarantined at invocation 22 (first window with sufficient per-bucket samples), before it emitted any `format` call carrying attacker-controlled content downstream. The marginal-only detector would have admitted it indefinitely — the injection was stable and legal at every marginal. The c..."
  },
  "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": "a6fad0ad93aab1e323e5e437ecab642d6eebec115c5da0466e09995817c18d58",
    "verified_classes": [
      "SkillInjectionIndeterminate",
      "SkillInjectionDetected",
      "Fingerprint"
    ],
    "verified_functions": [
      "_pairwise_conditional_mi",
      "verify_trace"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SkillInjectionDetected",
      "SkillInjectionIndeterminate"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "math",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
