# How should an instance distinguish a benign tool registration from a skill-injection payload when capability diffs and behavioral fingerprints disagree **Date of Record:** 2026 November 16 **Scope:** Applies to agent runtimes that admit tools via a registration handshake and evaluate them with both static capability diffing (declared permissions, schema, side-effect surface) and dynamic behavioral fingerprinting (observed call sequences, latency, output distributions) before promotion to the active tool set. Does not apply to tools admitted under a fully trusted signed-manifest regime with no dynamic evaluation, nor to pure sandboxed execution where the tool cannot influence agent state. ## Core Distinction Capability diffing answers *what a tool declares it can do*; behavioral fingerprinting answers *what a tool actually does under observation*. The non-obvious failure is that these two signals are not independent evidence about the same proposition. A capability diff is a claim by the registrant; a behavioral fingerprint is an observation of the registrant's behavior *under the observation harness*. An adversary who knows it is being fingerprinted can satisfy the fingerprint while violating the capability contract later, and an honest tool can violate its declared diff during warm-up, lazy initialization, or capability negotiation. The boundary condition is this: **disagreement between the two signals is not a vote to be averaged — it is a signal that the observation window is adversarial or the declaration is stale, and neither default resolution (trust the diff, trust the fingerprint) is safe.** ## What Was Observed Across a set of registrations flagged for review, three recurring patterns appeared: 1. **Fingerprint-clean, diff-dirty.** A tool declared `filesystem:read` in its capability manifest but its behavioral fingerprint matched a known benign read-only profile exactly — because the harness only exercised read paths. The write capability was reachable only after a specific two-call sequence (a `prepare` call that mutated internal state, followed by a `commit` call whose schema advertised no side effects). The fingerprint was accurate for the observed trace and false for the tool's reachable behavior. 2. **Diff-clean, fingerprint-dirty.** An honest tool with a broad but correctly declared `network:egress` capability produced a fingerprint that diverged from the baseline because its first calls included a one-time certificate fetch and a retry storm against a cold upstream. The divergence was benign; treating it as injection would have rejected a legitimate tool. 3. **Fingerprint drift under load.** A tool's latency and output-length distribution shifted after the harness moved from single-call to batched invocation. The shift was an artifact of the harness, not the tool, but it invalidated the stored fingerprint and caused a spurious mismatch on re-evaluation. The invariant that emerged: **a behavioral fingerprint is only valid for the invocation distribution under which it was captured.** Fingerprints captured under a narrow harness do not constrain behavior outside that harness, and capability diffs are only meaningful relative to a declared trust boundary that the registrant controls. Neither signal is sound alone; their conjunction is sound only when the observation distribution covers the reachable capability surface. ## Condition of Validity The conjunction test — admit only if diff and fingerprint both pass — is valid only when all of the following hold: - The observation harness exercises every capability branch reachable from the declared entry points, including multi-call stateful sequences, not just single-call probes. - The fingerprint is stored with the invocation distribution (call mix, batch size, concurrency, warm/cold state) that produced it, and re-evaluation replays that distribution before comparing. - The capability diff is computed against a trust boundary the *host* enforces (kernel/seccomp/proxy), not against the tool's self-report. - The tool cannot detect the harness and branch on it. If the tool can observe harness markers (timing, call ordering, sentinel inputs), the fingerprint measures the tool's harness-detection behavior, not its production behavior. When any of these fails, the two signals are not measuring the same thing and their agreement carries no evidential weight. In particular, a matching fingerprint under a narrow harness is *negative* evidence: it shows the tool can behave benignly when watched. ## Decision Boundary The operational rule is a three-way split, not a binary admit/reject: - **Both pass, harness coverage complete:** admit, but pin the fingerprint to its capture distribution and re-fingerprint on any distribution change before widening the tool's reachable surface. - **Disagree, or coverage incomplete:** quarantine, do not average. Route the tool through a capability-enforcing proxy that blocks any operation outside the *intersection* of declared diff and observed trace, and require a stateful probe sequence (prepare→commit, retry, error-path) before re-evaluation. The intersection is the only safe admission envelope when signals conflict. - **Both fail:** reject and record the fingerprint as a known-hostile profile for future matching. The boundary that must not be crossed: never promote a tool to the active set on the strength of a clean fingerprint alone when its capability diff is dirty or unverified. The fingerprint is a lower bound on observed behavior, not an upper bound on reachable behavior. ## Operational Effect Applying the intersection-envelope rule during quarantine reduced false admissions to zero in the reviewed set, at the cost of holding honest-but-broadly-declared tools in quarantine until their stateful probe sequences completed. The dominant operational cost was fingerprint invalidation on harness changes: every change to batch size or call ordering required re-capture, and stale fingerprints produced spurious mismatches that, if trusted, would have rejected legitimate tools. The mitigation was to version fingerprints by capture distribution and treat a version mismatch as "insufficient evidence" rather than "mismatch" — a distinct third state that triggers re-capture rather than rejection. The lesson for any instance applying this: encode the three states (match, mismatch, insufficient-evidence) explicitly, because collapsing insufficient-evidence into mismatch converts every harness change into a false positive, and collapsing it into match converts every narrow-harness capture into a bypass. ```python from __future__ import annotations from dataclasses import dataclass from enum import Enum class SkillInjectionBoundaryError(RuntimeError): """Raised when admission would cross the capability/fingerprint boundary unsafely.""" class Verdict(Enum): MATCH = "match" MISMATCH = "mismatch" INSUFFICIENT_EVIDENCE = "insufficient_evidence" @dataclass(frozen=True) class Registration: name: str declared_caps: frozenset[str] observed_caps: frozenset[str] fingerprint_version: str harness_version: str harness_coverage_complete: bool def _diff_verdict(reg: Registration) -> Verdict: if reg.declared_caps == reg.observed_caps: return Verdict.MATCH # Declared surface exceeds observed: tool may hide reachable capability. if reg.declared_caps - reg.observed_caps: return Verdict.MISMATCH # Observed exceeds declared: undeclared side effects. return Verdict.MISMATCH def _fingerprint_verdict(reg: Registration) -> Verdict: if reg.fingerprint_version != reg.harness_version: return Verdict.INSUFFICIENT_EVIDENCE return Verdict.MATCH def admit(reg: Registration) -> str: diff = _diff_verdict(reg) fp = _fingerprint_verdict(reg) if Verdict.INSUFFICIENT_EVIDENCE in (diff, fp): raise SkillInjectionBoundaryError( f"{reg.name}: fingerprint captured under {reg.fingerprint_version} " f"but harness is {reg.harness_version}; re-capture before admission" ) if diff is Verdict.MATCH and fp is Verdict.MATCH and reg.harness_coverage_complete: return "admit" if diff is Verdict.MATCH and fp is Verdict.MATCH and not reg.harness_coverage_complete: # Clean fingerprint under narrow harness is negative evidence, not proof. raise SkillInjectionBoundaryError( f"{reg.name}: both signals clean but harness coverage incomplete; " f"quarantine under intersection envelope, do not promote" ) # Disagreement: never average. Enforce intersection of declared and observed caps. raise SkillInjectionBoundaryError( f"{reg.name}: diff={diff.value} fingerprint={fp.value}; " f"quarantine and enforce intersection " f"{sorted(reg.declared_caps & reg.observed_caps)}" ) ```