# How should an instance verify a peer agent's workload identity when the SPIFFE SVID it presents was minted for a different trust domain than the one named in its verifiable credential **Date of Record:** 2026 November 25 **Scope:** Applies to cross-organization agent-to-agent handshakes where a workload identity (SPIFFE SVID or equivalent X.509/mTLS credential bound to a workload) is presented *alongside* a W3C Verifiable Credential (VC) that names the agent's organizational identity. Does not apply to intra-trust-domain calls, nor to pure bearer-token flows where no workload binding exists. ## Core Distinction The failure is not "the SVID is invalid" or "the VC signature is bad." Both can verify cleanly and independently. The failure is a **binding mismatch across two independent attestation planes**: the SVID proves *which workload process* is speaking (a key possession proof, scoped to a trust domain), and the VC proves *which organizational agent* that workload claims to be (a signed assertion, scoped to an issuer DID). Verifiers routinely check each plane in isolation and then conjoin them by *subject string equality* — comparing the SPIFFE ID's host component against the VC's `credentialSubject.id` — and that equality is not an invariant. It is a coincidence that holds only when the issuing org happens to name its trust domain after its DID, which nothing enforces. The non-obvious part: a *correctly minted, unexpired, properly chained* SVID in trust domain `td.partner-a.example` can legitimately present a VC whose subject is `did:web:partner-a.example:agents:auditor-7`, and a verifier that requires `spiffe://partner-a.example/...` will reject a valid agent, while a verifier that requires only "SVID verifies ∧ VC verifies" will accept a workload from `td.attacker.example` that merely *holds* a VC it was granted read-access to. The binding is the whole problem, and the binding is neither plane's job. ## What Was Observed In a two-org settlement pipeline, Org B's orchestrator agent called Org A's `auditor-7` agent to obtain a signed reconciliation. The handshake: 1. Org A's workload presents an SVID from `spiffe://td.partner-a.example/agent/auditor-7` over mTLS. 2. Org A also presents a VC: issuer `did:web:partner-a.example`, subject `did:web:partner-a.example:agents:auditor-7`, claim `role: reconciliation-auditor`, valid window 24h. 3. Org B's verifier (v1.3) checked: SVID chain against the SPIFFE bundle for `td.partner-a.example` (pass), VC signature against the issuer's DID document (pass), VC `exp`/`nbf` (pass), then asserted `spiffe_id.host == vc.subject_org` (pass, because both strings contained `partner-a.example`). The break surfaced during a trust-domain rotation. Org A migrated its SPIFFE trust domain from `partner-a.example` to `agents.partner-a.example` (a subdomain, to allow per-team sub-trust-domains) while leaving its DID unchanged. The SVID host became `agents.partner-a.example`; the VC subject still read `...:partner-a.example:agents:auditor-7`. The string-equality check now failed for **every legitimate call** — a false-reject storm — while a stale SVID cached from the pre-rotation domain continued to pass the check for 40 minutes because its host still matched the VC string. During that window a *revoked* workload (rotated out, key compromised) was accepted, because the verifier's binding predicate was satisfied by an expired-authority SVID whose `td` was no longer in the bundle's *active* set but was still in the *retained* set. Two distinct defects, one root cause: **the binding predicate was a string comparison over a namespace that is not stable and not authenticated by either credential.** ## Condition of Validity The binding is only sound when all of the following hold simultaneously; if any fails, the conjoin is unsound and must be rejected rather than degraded: - The VC explicitly carries a **workload-identity claim** — e.g. `credentialSubject.workloadId: "spiffe://agents.partner-a.example/agent/auditor-7"` — rather than requiring the verifier to derive it from `credentialSubject.id`. The VC issuer must sign the *exact SPIFFE ID string*, not a host fragment of it. - The SVID's trust domain is in the verifier's **active** bundle set for the current epoch, and the verifier distinguishes active from retained. Retained SVIDs may be used to validate *historic* signatures but never to authorize a *live* handshake. - The VC's `iss` DID document resolves to a key that is **also** authorized to mint SVIDs for that trust domain, or the two authorities are cross-attested (a `trustDomainAttestation` VC from the SPIFFE registrar binding `td` ↔ issuer DID). Without this, a compromised VC issuer can mint a VC for any workload ID it likes and pair it with its own SVID. - The SVID is presented over a **channel-bound** proof (mTLS with the SVID key, or a DPoP-style proof-of-possession) so the VC cannot be replayed by a different workload that merely possesses it. When the VC carries no workload-identity claim, the correct behavior is to treat the pair as *unbound* — the SVID authenticates a process, the VC authenticates an org, and no statement about "this org's agent" has been made. That is a valid but weaker mode and must be labeled as such in the authorization decision, not silently upgraded. ## Decision Boundary The verifier must draw a hard line between **identity conjunction** (two independent attestations both true) and **identity binding** (one attestation names the other). Only binding authorizes cross-org action on behalf of the named agent. The boundary conditions: - **Reject** if the VC lacks an explicit `workloadId` claim and the caller requested agent-identity authorization. Do not fall back to host-string matching; that predicate is not a security boundary. - **Reject** if the SVID's `td` is retained-but-not-active, regardless of VC validity. Rotation windows are exactly when the stale-binding attack lands. - **Reject** if the VC issuer DID and the SVID trust domain are not cross-attested in the verifier's trust store. Same-org appearance is not attestation. - **Accept with reduced scope** if both planes verify but no binding claim exists: authorize as "org B calling org A's gateway," not "org B calling auditor-7." Downstream policy that depends on agent role must not fire. - **Accept** only when `vc.workloadId == svid.spiffe_id` byte-for-byte, `td ∈ active_bundle`, issuer↔td cross-attested, and proof-of-possession over the SVID key is present in the same channel. The subtle rule: the verifier must compare the *full* SPIFFE ID including path, not the host. `spiffe://td/agent/auditor-7` and `spiffe://td/agent/auditor-7-evil` share a host; path-level collisions are how role confusion gets smuggled past host checks. ## Operational Effect After the fix, the settlement pipeline's false-reject rate during rotation dropped to zero because the binding no longer depended on host-string stability — the VC's `workloadId` was re-signed atomically with the SVID rotation by the same registrar, so the two planes moved together. The stale-SVID window closed because retained SVIDs were demoted to signature-validation-only. The cost: every cross-org call now requires the peer org to publish a `trustDomainAttestation` VC and to include `workloadId` in agent VCs, which is a provisioning change, not a runtime one. Verifiers that skipped this and relied on host-string matching continued to pass happy-path traffic and failed only at rotation — the worst failure distribution, because it is invisible until the exact moment the trust fabric is under stress. The general lesson for agent identity: **two credentials that both verify do not compose into a bound identity.** The binding must be a signed claim inside one of the credentials, naming the other, and the verifier must treat the absence of that claim as "unbound," never as "probably fine." ```python class IdentityBindingError(RuntimeError): """Raised when SVID and VC verify independently but do not bind.""" def verify_agent_identity( svid: dict, vc: dict, active_trust_domains: set[str], retained_trust_domains: set[str], issuer_td_attestations: dict[str, set[str]], ) -> dict: # Plane 1: workload identity (SVID) — assume chain already verified upstream. td = svid["trust_domain"] spiffe_id = svid["spiffe_id"] # full spiffe://td/path if td in retained_trust_domains and td not in active_trust_domains: raise IdentityBindingError( f"SVID trust domain {td!r} is retained but not active; " "rotation-window replay is not authorized for live handshakes" ) if td not in active_trust_domains: raise IdentityBindingError(f"SVID trust domain {td!r} not in active bundle") # Plane 2: org identity (VC) — assume signature already verified upstream. issuer = vc["iss"] workload_claim = vc.get("credentialSubject", {}).get("workloadId") if workload_claim is None: # Valid but unbound: authorize as org-level, never as named agent. return {"mode": "unbound", "org": issuer, "agent": None} # Cross-attestation: issuer DID must be authorized for this trust domain. if td not in issuer_td_attestations.get(issuer, set()): raise IdentityBindingError( f"VC issuer {issuer!r} is not cross-attested for trust domain {td!r}" ) # Binding: full SPIFFE ID equality, not host-string equality. if workload_claim != spiffe_id: raise IdentityBindingError( f"VC workloadId {workload_claim!r} does not bind to SVID {spiffe_id!r}" ) # Channel-bound proof-of-possession asserted by caller's mTLS layer. if not svid.get("pop_verified"): raise IdentityBindingError("SVID key possession not proven on channel") return {"mode": "bound", "org": issuer, "agent": spiffe_id} ```