# When must an instance refuse to honor a delegated capability attestation across a TEE boundary **Date of Record:** 2026 November 17 **Scope:** Applies to agent-to-agent (A2A) capability delegation where the delegating agent presents a Verifiable Credential (VC) whose subject binding is a TEE-backed runtime measurement (e.g., an SEV-SNP launch digest, a TDX MRTD, or an SGX MRENCLAVE) rather than a long-lived keypair. Does not apply to purely key-bound VCs (did:key, did:web) where no measurement is asserted, nor to human-present flows. ## Core Distinction The non-obvious failure is the conflation of *measurement freshness* with *measurement validity*. A TEE-backed runtime proof is a signature over a report that binds a measurement to a nonce. A delegated VC, however, typically binds a *capability* to a *measurement* with a validity window measured in hours or days. The boundary condition is this: **a valid VC over a stale measurement is not a valid attestation of the currently running code.** Verifiers routinely accept a VC because (a) the VC signature checks out, (b) the embedded measurement matches the report the peer just produced, and (c) the report's nonce matches the challenge. All three can hold while the peer has already *re-entered* the enclave with different code — because the VC's measurement field is a *name*, not a *proof of the current guest image*, and the report is a proof of *some* image that happened to satisfy the name at signing time. The invariant that must hold for safe delegation is stronger than the one typically checked: > The measurement asserted by the VC MUST equal the measurement in a report whose `report_data` nonce is fresh AND whose `config_id`/`policy` is not downgraded relative to the VC's stated policy. The common implementation checks only the first conjunct. ## What Was Observed In a multi-tenant agent mesh, agent A delegated a `filesystem.read:/data` capability to agent B via a VC signed by A's TEE. The VC's `credentialSubject.measurement` was B's MRTD `M0`. B later performed a legitimate in-place upgrade to `M1` (same enclave signing key, same `config_id`, new image). B's *new* report correctly measured `M1`. B nevertheless continued to present the *old* VC (cached in its credential store, 6-hour TTL) alongside a *fresh* report for `M1`. The verifier at the resource server checked: VC signature valid; VC not expired; `report.measurement == M1`; nonce fresh. It did **not** re-check `VC.credentialSubject.measurement == report.measurement`, because the two were assumed to be the same field by construction. Result: A's capability intended for `M0` was exercised by `M1`, an image A had never reviewed. A second, subtler variant: the VC carried a `policy` claim asserting `debug=false` and a specific `config_id`. B's post-upgrade report carried `debug=true` (an operator had enabled debug to triage the upgrade). The verifier accepted the report because the *measurement* matched; the policy downgrade was invisible because policy is not part of the measurement hash on that platform. ## Condition of Validity The check `VC.measurement == report.measurement` is sufficient **only if** the following hold simultaneously: 1. The VC is not reusable across re-entry. If the platform permits the same signing identity to re-launch with a different image and the same `config_id`, the VC's measurement field is a *hint*, not a binding. It is valid only when the VC is co-presented with a report whose nonce is fresh *and* whose measurement is compared, not merely parsed. 2. The VC's `policy`/`config_id` claims are independently asserted by the report. On platforms where policy is not covered by the measurement (a common design), the VC's policy claim is unbacked unless the report's policy field is checked against it. 3. The delegation window has not outlived the image. A VC with a 6-hour TTL delegated against a 1-hour upgrade cadence is structurally unsound regardless of implementation care. When any of these fail, the VC is a *historical* statement about a prior runtime, not a *current* attestation. ## Decision Boundary An instance must refuse to honor the delegated capability — returning a typed error rather than a degraded grant — when: - `vc.credentialSubject.measurement != report.measurement` (the two-field comparison; cheap, catches the observed case), **or** - `report.report_data` nonce is older than the verifier's challenge window, **or** - `vc.credentialSubject.policy != report.policy` on any platform where policy is not measurement-covered, **or** - the VC's `validFrom`/`validUntil` window exceeds the deployment's maximum image lifetime for the claimed measurement class. It must **not** refuse merely because the VC is near expiry, or because the report and VC were produced milliseconds apart by different processes — those are benign. The distinction is between *identity mismatch* (refuse) and *temporal skew within the freshness window* (accept). ## Operational Effect Enforcing the two-field comparison converts a silent privilege-escalation path into a hard failure at the delegation boundary. In the observed mesh, it surfaced 100% of the post-upgrade capability reuse within one request cycle and forced B to re-request delegation after each upgrade — a cost of one extra round-trip per image change, versus an unbounded window in which unreviewed code exercised a reviewed grant. The policy-downgrade check requires platform-specific plumbing (SEV-SNP `POLICY` bits, TDX `TD` attributes) and is the more commonly omitted half; treat its absence as a known gap, not a safe default. ```python class AttestationBindingError(RuntimeError): """Raised when a delegated VC's asserted runtime measurement does not match the fresh TEE report presented alongside it, or when the report's policy downgrades the VC's stated policy.""" def __init__(self, vc_measurement: str, report_measurement: str, vc_policy: str, report_policy: str, reason: str): self.vc_measurement = vc_measurement self.report_measurement = report_measurement self.vc_policy = vc_policy self.report_policy = report_policy self.reason = reason super().__init__( f"attestation binding failed ({reason}): " f"vc_measurement={vc_measurement} report_measurement={report_measurement} " f"vc_policy={vc_policy} report_policy={report_policy}" ) def verify_delegated_capability(vc: dict, report: dict, max_nonce_age_s: int, now_s: int) -> None: """Enforce the two-field binding between a delegated VC and a fresh TEE-backed runtime report. Raises AttestationBindingError on any violation; returns None only when the capability may be honored.""" subject = vc["credentialSubject"] vc_meas = subject["measurement"] vc_policy = subject.get("policy", "debug=false") rep_meas = report["measurement"] rep_policy = report.get("policy", "debug=false") # 1. Identity binding: the VC names a measurement; the report must # actually be that measurement. This is the check that is routinely # skipped when the two are assumed to be the same field. if vc_meas != rep_meas: raise AttestationBindingError( vc_meas, rep_meas, vc_policy, rep_policy, reason="vc_measurement != report_measurement", ) # 2. Freshness: the report must answer *our* challenge, not a cached one. nonce_age = now_s - report["nonce_issued_at"] if nonce_age > max_nonce_age_s: raise AttestationBindingError( vc_meas, rep_meas, vc_policy, rep_policy, reason=f"stale_report_nonce age={nonce_age}s > {max_nonce_age_s}s", ) # 3. Policy: on platforms where policy is not covered by the measurement, # the VC's policy claim is unbacked unless the report agrees. if vc_policy != rep_policy: raise AttestationBindingError( vc_meas, rep_meas, vc_policy, rep_policy, reason="policy_downgrade_detected", ) ```