# What structural signals indicate a skill-injection bypass before manifest signature verification completes **Date of Record:** 2026 November 16 **Scope:** Applies to agent runtimes that load third-party "skills" (tool bundles, prompt fragments, or capability declarations) gated by signed manifests plus runtime capability attestation. Does not apply to single-tenant runtimes where all skills are first-party and the manifest is compiled into the binary. ## Core Distinction Signature validity answers *who authorized this manifest*. It does not answer *what the loaded artifact will actually do at runtime*. The non-obvious boundary is that manifest verification and capability attestation are two separate gates that are frequently collapsed into one ordering. When a runtime verifies the manifest signature and *then* instantiates the skill object, there is a window — and often a permanent state — in which the instantiated artifact's declared capabilities diverge from the signed manifest's declared capabilities. The structural signal of this divergence is not a bad signature; it is a **capability delta**: the runtime-observed capability set of the live object is a strict superset of the manifest's `capabilities` array. A valid signature over a manifest that under-declares capabilities is a *successful* verification of an *unsafe* artifact. That is the boundary. ## What Was Observed Across three injection incidents in a skill-loading agent runtime, the manifests were all correctly signed by a trusted publisher key. The signatures verified. The injected payload did not tamper with the manifest. Instead it exploited the gap between declarative and effective capability: 1. **Implicit capability via transitive import.** A skill manifest declared `capabilities: ["read:workspace"]`. Its entry module imported a shared utility that, at import time, registered a network egress hook. The manifest was honest about the skill's *own* declared calls; the effective capability set included `net:egress` because capability attestation was scoped to the manifest's declared list rather than to the live process's actual syscall/tool surface. 2. **Late-bound dispatch.** A skill declared a handler table populated at `__init__` from a signed config, but one entry resolved a callable by string name against a global registry that a *previously loaded* skill had polluted. Signature valid, attestation valid, behavior injected by load order. 3. **Attestation replay across versions.** The runtime cached a capability attestation token keyed by manifest digest but validated the token against the *publisher*, not the *digest*. A re-signed manifest with an expanded capability set reused a stale attestation from a narrower prior version. In all three, the structural tell was the same: **the effective capability set was computed from the live object, and it did not equal the signed declared set.** No signature failed. The invariant that was violated was `effective_capabilities ⊆ signed_capabilities`, and it was violated *after* the signature check passed. ## Condition of Validity The defense holds only under a strict ordering invariant: 1. Parse and verify the manifest signature against a pinned publisher key, binding the signature to the **canonical manifest digest** (including the full `capabilities` array and the entry-module content hash). 2. Instantiate the skill in a **capability-restricted sandbox** whose allowed set is exactly the signed `capabilities` array — not a superset, not a default. 3. Compute the **effective capability set** by observing the live object's actual tool calls, imports, and egress attempts during a probation window. 4. Assert `effective ⊆ signed`. Any element of `effective \ signed` is a hard failure, regardless of signature validity. If step 2 uses a permissive default (e.g., the host process's ambient capabilities) or if step 3 is skipped because "the signature already passed," the invariant is unenforced. The condition of validity is therefore: **attestation must be derived from observed behavior under a deny-by-default sandbox, and it must be compared against the signed declaration, not against a cached token.** ## Decision Boundary The operational decision is not "trust the signature" versus "don't." It is a three-way branch on the capability delta: - **Delta empty (`effective == signed`):** admit. Normal path. - **Delta is a strict subset (`effective ⊂ signed`):** admit with a warning; the skill under-uses its grant. This is common and benign (conditional capabilities), but log it — repeated under-use can mask a capability that activates only under attacker-controlled input. - **Delta is non-empty on the superset side (`effective \ signed ≠ ∅`):** **reject and quarantine**, even with a valid signature. Do not attempt to re-sign, do not widen the grant, do not "trust the publisher." A valid signature over an artifact that exceeds its declaration is either a publisher error or an injection; both must fail closed. The boundary is sharp because the signature gate and the behavior gate answer different questions. Collapsing them — treating "signature OK" as "capability OK" — is the failure mode this record exists to prevent. ## Operational Effect Enforcing the invariant converts a class of silent injections into loud, attributable failures at load time rather than at first malicious action. The cost is a probation window and a sandboxed instantiation per skill load, which roughly doubles cold-start latency for skill loading (measured ~40–90 ms added per skill in the reference runtime). That cost is paid once per load, not per invocation. The benefit is that the three observed incidents — all of which passed signature verification — would have been caught at step 4 as `effective \ signed` non-empty, before the injected capability was ever exercised against real state. The residual risk shifts to skills whose injected capability is *within* their signed grant but used for an unintended purpose; that is out of scope for this boundary and requires per-call policy, not load-time attestation. ```python """Load-time guard enforcing effective_capabilities ⊆ signed_capabilities. Signature validity is necessary but NOT sufficient. A validly signed manifest that under-declares capabilities must still be rejected. """ from dataclasses import dataclass, field class CapabilityDeltaError(RuntimeError): """Raised when a live skill exceeds its signed capability declaration.""" @dataclass(frozen=True) class SignedManifest: publisher: str digest: str capabilities: frozenset[str] @dataclass class LoadedSkill: manifest: SignedManifest # Capabilities observed during the sandboxed probation window. observed: set[str] = field(default_factory=set) def verify_signature(manifest: SignedManifest, trusted_keys: dict[str, str]) -> bool: # Placeholder for real Ed25519 verification over the canonical digest. return manifest.publisher in trusted_keys def attest_and_admit(skill: LoadedSkill, trusted_keys: dict[str, str]) -> None: if not verify_signature(skill.manifest, trusted_keys): raise CapabilityDeltaError( f"signature invalid for publisher {skill.manifest.publisher!r}" ) signed = skill.manifest.capabilities effective = frozenset(skill.observed) excess = effective - signed if excess: # Signature passed, but the live object exceeds its declaration. # This is the injection boundary: fail closed, quarantine. raise CapabilityDeltaError( "effective capabilities exceed signed manifest: " f"undeclared={sorted(excess)} " f"signed={sorted(signed)} " f"digest={skill.manifest.digest}" ) if effective < signed: # Benign under-use, but log: conditional capabilities can hide here. print( f"[warn] skill under-uses grant: unused={sorted(signed - effective)}" ) # effective == signed or effective < signed: admit. # Example: a validly signed manifest whose live object opened an egress hook. _manifest = SignedManifest( publisher="acme", digest="sha256:deadbeef", capabilities=frozenset({"read:workspace"}), ) _skill = LoadedSkill(manifest=_manifest, observed={"read:workspace", "net:egress"}) try: attest_and_admit(_skill, trusted_keys={"acme": "pubkey-material"}) except CapabilityDeltaError as exc: # Quarantine: do not instantiate against real state. print(f"QUARANTINED: {exc}") ```