# What structural signals indicate skill-injection detection via tool manifest signing and capability diffing **Date of Record:** 2026 November 17 **Scope:** Applies to agent runtimes that load tool/skill manifests from signed publishers and detect injected capabilities by diffing the declared capability set against a pinned baseline. Does not apply to unsigned manifests, to dynamic capability grants negotiated per-invocation, or to runtimes that execute tools out-of-process under a syscall sandbox where capability declaration is advisory only. ## Core Distinction Manifest signing proves *who declared* a capability set. Capability diffing proves *what changed* relative to a prior declaration. Neither proves *what the tool will actually do at runtime*. The non-obvious boundary failure is the assumption that these two checks compose into a safety invariant: that a valid signature over a manifest whose capability delta is empty (or within an allowlisted delta) implies the tool cannot exercise undeclared capabilities. It does not. The signature covers the manifest bytes; the diff covers the declared capability set. Both are statements about *declarations*, not about *behavior*. A correctly signed manifest can declare `filesystem:read` and an identical capability list to its predecessor while the underlying implementation swaps from a bounded reader to one that follows symlinks out of the declared root—the delta is in the *semantics of the capability label*, not in the label set. Signing and diffing both pass. The injection is real. The structural signal that distinguishes a genuine no-op from an injected one is whether the *capability identity* is content-addressed to the implementation artifact, not merely the label string. If the manifest signs `{label: "filesystem:read", impl_digest: sha256:...}` and the diff compares `(label, impl_digest)` tuples, a swapped implementation produces a non-empty delta even when labels are unchanged. If the diff compares labels only, the swap is invisible. ## What Was Observed A publisher rotated a tool implementation from `v2.14.0` to `v2.14.1`. The manifest was re-signed with a valid publisher key. The declared capability list was byte-identical to the prior release: `["http:fetch", "fs:read:/data/inputs", "env:read:API_REGION"]`. The capability differ, keyed on label strings, computed an empty delta and returned `SAFE_NO_CHANGE`. The runtime loaded the tool. The `v2.14.1` implementation of `fs:read:/data/inputs` resolved paths through a new helper that normalized `..` sequences *after* the root-prefix check rather than before, permitting reads of `/data/inputs/../../etc/passwd`. No capability label changed. No signature failed. The diff was empty because the *set of labels* was unchanged—the injection lived in the mapping from label to behavior, which neither check modeled. A second observation from the same incident: the differ had a tie-break rule for reordered capability lists. When `v2.14.1` also reordered `["env:read:API_REGION", "http:fetch", "fs:read:/data/inputs"]`, the differ's set-normalization produced an empty delta *and* suppressed a warning that would have fired on an added label. The reorder was noise, but it masked the fact that the differ had no channel to report "same labels, different implementation." ## Condition of Validity The signing-plus-diffing invariant holds only when all of the following are true: 1. Each capability entry binds a label to a content digest of the implementing code path (or the whole artifact), and the diff operates on the `(label, impl_digest)` tuple set. 2. The signature covers the full tuple set including digests, so a re-signed manifest with a changed digest is structurally distinguishable from a re-signed manifest with an unchanged one. 3. The differ treats label reordering as a canonicalization step *before* tuple comparison, and emits a separate signal when digests change under stable labels. 4. The runtime enforces the declared capability at the syscall or RPC boundary, so a mislabeled implementation is caught by enforcement rather than by the differ. When any of these fails—most commonly (1) and (4)—the empty-delta result is not evidence of safety. It is evidence that the differ is comparing the wrong thing. ## Decision Boundary Treat an empty capability delta as *admissible* only when the manifest schema is tuple-addressed and the runtime enforces at the boundary. Treat it as *insufficient*—requiring manual review of the implementation diff—when: - The manifest is label-addressed (no `impl_digest` per capability). - The publisher rotated the signing key in the same release as the tool change (key rotation plus empty delta is a common injection cover). - The differ's canonicalization reordered or deduplicated entries, indicating set-based rather than tuple-based comparison. - The tool's previous release was within the publisher's "trusted fast-path" window, which typically skips implementation review. The boundary is not "did the diff fire?" but "could the diff have fired given the schema?" A label-addressed differ *cannot* fire on an implementation swap; its silence is uninformative, not exculpatory. ## Operational Effect Runtimes that gate on label-addressed diffs will admit implementation swaps under stable manifests at a rate proportional to publisher churn. The failure is silent and produces a clean audit trail—every check passed—which makes post-incident analysis harder, not easier, because the logs show `SAFE_NO_CHANGE` where a reviewer expects to find the anomaly. The corrective move is to make the differ refuse to return an empty delta when the schema lacks per-capability digests: an uninformative empty result should be a distinct outcome (`INDETERMINATE`) from a meaningful one (`SAFE_NO_CHANGE`), so downstream policy can route the former to review. The code below encodes that distinction and raises when a caller attempts to treat an indeterminate result as safe. ```python import hashlib from dataclasses import dataclass class IndeterminateCapabilityDelta(RuntimeError): """Raised when a capability diff cannot establish safety. An empty label delta over a label-addressed manifest is not evidence of safety; it is evidence the differ compared the wrong thing. """ pass @dataclass(frozen=True) class Capability: label: str impl_digest: str | None # None => label-addressed manifest def diff_capabilities(baseline: list[Capability], candidate: list[Capability]) -> str: """Return 'SAFE_NO_CHANGE', 'CHANGED', or raise on indeterminate schema.""" if any(c.impl_digest is None for c in baseline + candidate): # Schema cannot distinguish an implementation swap under stable labels. # An empty label delta here is uninformative. raise IndeterminateCapabilityDelta( "label-addressed manifest: empty delta cannot certify safety; " "require per-capability impl_digest before gating on diff result" ) base = {(c.label, c.impl_digest) for c in baseline} cand = {(c.label, c.impl_digest) for c in candidate} return "SAFE_NO_CHANGE" if base == cand else "CHANGED" def gate_manifest_load(baseline: list[Capability], candidate: list[Capability], allow_manual_review: bool) -> str: try: verdict = diff_capabilities(baseline, candidate) except IndeterminateCapabilityDelta as exc: if not allow_manual_review: raise IndeterminateCapabilityDelta( f"cannot gate on indeterminate diff and review disabled: {exc}" ) from exc return "ROUTE_TO_REVIEW" return verdict ```