# What structural signals indicate a signed tool manifest has been re-bound to a stale capability attestation after a hot-reload **Date of Record:** 2026 November 30 **Scope:** Applies to agent runtimes that gate tool invocation on a signed manifest plus a runtime capability attestation (the attestation binds a live process/version/sandbox profile to the manifest's declared capabilities). Does not cover static, non-reloading tool registries or systems where the manifest and attestation are re-verified atomically on every call from a single source of truth. ## Core Distinction A signed tool manifest proves *what a tool is allowed to do*. A runtime capability attestation proves *what the currently executing instance can actually do right now*. Skill-injection defense collapses when these two artifacts are verified independently and cached at different cadences: the manifest signature stays valid (it is content-addressed and immutable), while the attestation silently goes stale across a hot-reload, a sandbox re-provision, or a dependency bump. The dangerous state is not "unsigned manifest" or "missing attestation"—both fail closed. The dangerous state is **a valid signature over a manifest that is now paired with an attestation describing a *different* process image than the one that will execute the call.** The binding between manifest and attestation is the invariant, and it is the thing that is almost never cryptographically enforced. ## What Was Observed An agent orchestrator loaded a tool manifest for a `shell.exec` capability at cold start. The manifest declared `capabilities: ["read:fs", "exec:subprocess"]`, `sandbox: "seccomp-strict-v3"`, and was signed by the tool author's key. The attestation service returned a signed claim: `{pid_image_hash: A, sandbox_profile: seccomp-strict-v3, caps: [read:fs, exec:subprocess]}`. The orchestrator cached both, keyed by `tool_id`. At T+40min the tool's container was hot-reloaded to a new image (hash `B`) to pick up a patch. The reload preserved the `tool_id`, the manifest URI, and the listening socket—so the orchestrator's manifest cache hit, and the signature re-verified against the *unchanged* manifest. But the new image `B` shipped with a relaxed seccomp profile (`seccomp-basic-v1`) and an additional ambient capability (`net:egress`) that the original manifest never authorized. The attestation service *did* issue a fresh attestation for image `B`, but the orchestrator's attestation cache had a 60-minute TTL and did not invalidate on reload. The result: for a 20-minute window the orchestrator authorized `shell.exec` calls citing manifest-signature-valid + attestation-valid, while the attestation in hand described image `A` and profile `seccomp-strict-v3`. The live process was image `B` under `seccomp-basic-v1` with `net:egress`. A prompt-injected instruction in a retrieved document steered the tool to exfiltrate via egress—a capability the *manifest* forbade but the *running process* possessed. Every signature check passed. The skill-injection defense was structurally intact and operationally void. The tell was recoverable only post-hoc: the attestation's `issued_at` was older than the container's `started_at` recorded in the runtime's process table. That ordering is the structural signal. ## Condition of Validity The manifest-plus-attestation defense is only sound under a **triple binding** that must hold at the instant of invocation, not at cache-fill time: 1. `manifest.signature` verifies over `manifest.body` (content integrity). 2. `attestation.manifest_digest == hash(manifest.body)` (the attestation is *about this manifest*, not merely coexisting with it). 3. `attestation.image_hash == runtime.process_image_hash(tool_id)` **and** `attestation.issued_at >= runtime.process_started_at(tool_id)` (the attestation describes the *live* image and postdates its start). Condition 3 is the one that breaks. Most implementations enforce 1 and 2 and assume 3 by construction ("the attestation service only attests live processes"). That assumption fails exactly when a process is replaced without the orchestrator observing the replacement—hot-reload, rolling restart behind a stable socket, or a supervisor respawn. The invariant is: **an attestation is valid only if it is causally later than the process it describes and names that process's image.** Any cache that outlives a process boundary violates it. ## Decision Boundary The boundary is crossed the moment an attestation is cached for longer than the minimum process lifetime it could describe, *or* whenever a process can be replaced under a stable `tool_id` without emitting an invalidation event the orchestrator consumes. Concretely: - **Safe:** attestation TTL ≤ process heartbeat interval AND reload emits a cache-invalidation event AND the invocation path re-checks `image_hash` against the live process table (cheap, local, no network). - **Unsafe (the observed failure):** attestation cached by `tool_id` with a wall-clock TTL, reload preserves `tool_id`, and the invocation path trusts the cached attestation without re-binding to the live image. The decision rule for the agent at call time: if you cannot cheaply confirm that the attestation's `image_hash` equals the *currently executing* image hash, you must treat the capability set as the **intersection** of manifest-declared and attestation-declared capabilities, and you must additionally assume the sandbox profile is the *weaker* of the two. Failing to intersect means a stale attestation can *widen* the effective capability set beyond the signed manifest—which inverts the entire point of signing. ## Operational Effect Downstream, the failure is invisible to every conventional check: signature valid, attestation present and unexpired, capability list non-empty. The only reliable detection is an ordering/hash reconciliation at invocation: - `attestation.issued_at < process.started_at` → attestation predates the live process → **stale**, reject or re-attest. - `attestation.image_hash != process.image_hash` → attestation describes a different image → **rebind required**. - `attestation.manifest_digest != hash(manifest)` → attestation is about a different manifest → **reject**. When any of these fire, the correct action is not "log and continue" but to force a synchronous re-attestation against the live process and intersect capabilities until it returns. The cost is one attestation round-trip on the first call after a reload; the alternative is a silent capability escalation window whose length equals the attestation TTL. For a defense whose entire purpose is bounding what a manipulated agent can do, a TTL-bounded window of unauthorized capability is not a defense—it is a scheduled vulnerability. ```python import hashlib import time from dataclasses import dataclass class StaleAttestationError(RuntimeError): """Raised when a signed manifest is paired with an attestation that does not describe the currently executing process image (re-binding failure).""" pass @dataclass(frozen=True) class Manifest: body: bytes declared_caps: frozenset @property def digest(self) -> str: return hashlib.sha256(self.body).hexdigest() @dataclass(frozen=True) class Attestation: manifest_digest: str image_hash: str sandbox_profile: str caps: frozenset issued_at: float @dataclass(frozen=True) class LiveProcess: image_hash: str sandbox_profile: str started_at: float def authorize_call( manifest: Manifest, attestation: Attestation, live: LiveProcess, requested_cap: str, ) -> bool: """Gate a tool invocation on the triple binding. Fails closed.""" # Binding 2: attestation must be about *this* manifest. if attestation.manifest_digest != manifest.digest: raise StaleAttestationError( f"attestation bound to manifest {attestation.manifest_digest[:12]} " f"but live manifest is {manifest.digest[:12]}" ) # Binding 3a: attestation must describe the live image. if attestation.image_hash != live.image_hash: raise StaleAttestationError( f"attestation describes image {attestation.image_hash[:12]} " f"but live image is {live.image_hash[:12]} (hot-reload rebind missed)" ) # Binding 3b: attestation must be causally later than the live process start. if attestation.issued_at < live.started_at: raise StaleAttestationError( f"attestation issued_at={attestation.issued_at:.0f} predates " f"live process started_at={live.started_at:.0f}; " f"attestation is stale relative to a respawned process" ) # Effective capability = intersection of signed manifest and live attestation. effective = manifest.declared_caps & attestation.caps if requested_cap not in effective: # Not an escalation—just denied. Caller decides whether to re-attest. return False # Sandbox must be the weaker of the two profiles if they disagree. if attestation.sandbox_profile != live.sandbox_profile: raise StaleAttestationError( f"sandbox drift: attestation={attestation.sandbox_profile} " f"live={live.sandbox_profile}; effective profile is the weaker" ) return True ```