/security-principles:confidential-ai-inferencefrom security-principles
Use when designing, reviewing or explaining confidential AI inference: serving models so that prompts, outputs and weights stay protected from the cloud operator and host, verifiably. Covers the threat model and what TEEs do not stop, CPU confidential VMs (AMD SEV-SNP, Intel TDX, Arm CCA), NVIDIA GPU confidential computing and the bounce-buffer path, IETF RATS remote attestation (RFC 9334), attested TLS and channel binding, Oblivious HTTP relays (RFC 9458), transparency logs and reproducible builds (RFC 6962, RFC 9162, Sigstore Rekor), zkML and redundant execution, attestation-gated key release, a reference architecture, a deployment checklist and common failure modes. Companion to threat-modeling-playbook and ai-security-practices.
Ships in security-principles. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part of the
security-principlesplugin. Sibling skills:threat-modeling-playbook(STRIDE, trust boundaries, data flow diagrams — run it on the architecture in §12),ai-security-practices(prompt injection, output handling, secrets, SLSA/Sigstore supply chain — everything inside the enclave still needs it),ai-era-security(OWASP LLM/Agentic Top 10, post-quantum cryptography — relevant to the HPKE keys in §7),cybersecurity-principles(least privilege, open design, complete mediation — the principles this skill applies to hardware trust).Currency: compiled October 2026 from public specifications, RFCs and vendor documentation. The IETF RFCs cited are stable. Vendor product names, GPU confidential-computing modes, cloud SKUs, verifier services and every attack paper move quickly: anything marked ⚠️ verify was believed accurate at compilation but must be re-checked against the vendor's current documentation before you rely on it.
Not a certification or compliance claim. This is an engineering reference; a production system needs its own threat model, an independent review and the hardware vendors' current security guidance.
The three ideas that organize this document:
- ATTESTATION PROVES IDENTITY, NOT VIRTUE. A valid attestation proves you are talking to exactly the code that was measured — including its bugs and its logging statements. Confidentiality comes from what that code does, so the code must be published, reproducible and reviewed.
- EVERY MECHANISM MOVES TRUST; NONE REMOVES IT. TEEs move trust from the cloud operator to the hardware vendor; OHTTP moves it to a non-colluding relay; transparency logs move it to witnesses and auditors. Write down who is left in the trusted set and why.
- THE CLIENT IS THE ENFORCEMENT POINT. Nothing is verifiable if the client does not verify. A server that attests to nobody, or a client that continues on a failed check, is ordinary hosting with extra steps.
Confidential inference is serving a model so that the parties operating the infrastructure — the cloud provider, its administrators, the host OS and hypervisor, and ideally the service operator's own staff — cannot read user prompts, model outputs, or (optionally) the model weights, and so that a client can verify this before sending data, rather than trusting a policy document.
It combines four layers, each answering a different question:
| Layer | Question it answers | Primary mechanism |
|---|---|---|
| Isolation | Can the host read or tamper with memory in use? | TEE: confidential VM or enclave, confidential GPU (§3, §4) |
| Attestation | Is the thing I am talking to the genuine, expected TEE and software? | Remote attestation, IETF RATS (§5, §6) |
| Unlinkability | Can the service tie what I asked to who I am? | Oblivious HTTP relays, anonymous credentials (§7) |
| Accountability | Is the software that runs the same software everyone else can inspect? | Transparency logs, reproducible builds (§8) |
What it is not:
ai-security-practices.Assets: prompts and attachments; outputs (including streamed tokens); per-user state (conversation history, KV cache); model weights and adapters; request metadata (identity, IP, timing, sizes); and the signing and decryption keys that protect all of the above.
| Party | What they could do without controls | What constrains them | What you still trust them for |
|---|---|---|---|
| Client (device + app) | Nothing against itself, but it runs the verification code | Open client code; client binary transparency | Correctly verifying evidence; not leaking locally |
| Model provider / service operator | Write serving code that logs or exfiltrates prompts | Published, reproducible, transparency-logged code; attestation pins it | Authoring honest code — mitigated only by public audit, never by the TEE |
| Cloud / host operator | Read guest memory, snapshot VMs, tamper with disk and network, inject interrupts | CPU memory encryption and integrity (SEV-SNP, TDX, CCA); GPU CC mode | Availability; not mounting physical or side-channel attacks beyond the vendor's threat model |
| Hardware vendor (CPU, GPU) | Sign false endorsements; ship flawed firmware or microcode | Very little — public scrutiny, published TCB recovery | Root keys, firmware (AMD Secure Processor, Intel TDX module, NVIDIA GPU firmware), honest endorsement |
| Verifier service (if third party) | Issue false attestation results | Running verification yourself; multiple verifiers | Correct appraisal, if you delegate to it |
| OHTTP relay operator | Link IP to timing and size; collude with the gateway | Operated by an independent organization; contractual non-collusion | Not colluding; stripping identifying headers |
| Transparency log operator | Show different log views to different clients (split view) | Witness cosigning, gossip, independent monitors | Availability; the witness set not colluding |
| KMS / key-release administrator | Relax a release policy so keys go to unattested code | Policy under multi-party control; logged policy changes | Not changing the policy silently |
Note: the service operator is the hardest party to exclude. A TEE cannot tell whether the measured code is honest — it only guarantees that the code is the code that was measured. Exclusion of the operator therefore rests on §8 (public, reproducible, logged releases that someone actually audits).
| Mechanism | Confidentiality | Integrity | Verifiability | Unlinkability |
|---|---|---|---|---|
| Confidential VM / enclave | Yes, against host software and admins | Yes, of memory against host software | No, not by itself | No |
| Confidential GPU mode | Yes, for data in GPU memory and on the PCIe path | Yes, of transfers (authenticated encryption) | Via GPU attestation | No |
| Remote attestation | No (it is a signed statement) | Proves initial state and measured changes | Yes — of identity and configuration, at a point in time | No |
| Channel binding (attested TLS, HPKE) | Yes — ensures you encrypt to the TEE | Prevents relay and diversion | Ties evidence to the session | No |
| OHTTP + relay | No (gateway sees plaintext request) | Request integrity via AEAD | No | Yes, given relay and gateway do not collude |
| Transparency log | No | Append-only history of releases | Yes — non-equivocation, after-the-fact detection | No |
| Reproducible build | No | Links source to binary to measurement | Yes, for anyone who rebuilds | No |
| zkML proof | No (the prover sees the input) | Yes, cryptographically | Yes, without trusting hardware | No |
#VC/#VE exception handlers) is part of your TCB.MEASUREMENT (launch digest of the initial guest memory — firmware and, with measured direct boot, hashes of kernel, initrd and command line), REPORT_DATA (64 bytes chosen by the guest — put your nonce and key hash here), HOST_DATA (set by the host, so untrusted unless pinned), POLICY (including whether debug is allowed), TCB version fields and CHIP_ID.MRTD (build-time measurement of initial TD contents, typically the TD virtual firmware), four runtime-extendable registers RTMR[0..3] (firmware configuration, kernel and initrd, command line, application — analogous to TPM PCRs), plus host-supplied MRCONFIGID, MROWNER and MROWNERCONFIG (untrusted unless your policy pins them). REPORTDATA is 64 guest-chosen bytes.TDREPORT is converted into a signed Quote by an SGX-based quoting enclave using DCAP (Data Center Attestation Primitives). The PCK certificate chain roots at the Intel SGX Root CA; collateral (TCB Info, QE Identity, CRLs) comes from the Intel Provisioning Certification Service (PCS) or a caching service. Appraisal yields a TCB status such as UpToDate, SWHardeningNeeded or OutOfDate — decide in policy which statuses you accept.| Process enclave (Intel SGX) | Confidential VM (SEV-SNP, TDX, CCA) | Hypervisor-isolated enclave (AWS Nitro Enclaves) | |
|---|---|---|---|
| Isolation boundary | Part of one process | Whole guest VM | Carved-out VM with no network, no storage, vsock only |
| TCB | Smallest — your enclave code plus CPU | Guest firmware, kernel, userland plus CPU | Your image plus the AWS Nitro hypervisor and cards |
| Root of trust | CPU vendor | CPU vendor | Cloud provider (AWS Nitro PKI), not a CPU vendor |
| Porting | Partition the app or use a library OS (Gramine, Occlum) | Lift and shift | Repackage as an enclave image |
| GPU access | No | Yes, with a CC-capable GPU (§4) | No |
For GPU inference in 2026 the confidential VM is the practical route. Its weakness is the large guest TCB, so shrink it: a minimal immutable image, no SSH or interactive shell, a read-only root filesystem verified by dm-verity whose root hash is in the measured kernel command line (or a measured Unified Kernel Image), and no package manager at runtime.
Note: SGX was removed from Intel client processors from the 11th/12th generation but remains on Xeon server parts ⚠️ verify. It remains useful for small key-handling or gateway components, not for model execution.
nvtrust tooling or via the NVIDIA Remote Attestation Service (NRAS).Composite attestation is mandatory. The client must verify CPU evidence and GPU evidence and the binding between them. The usual pattern: code inside the measured CVM attests the GPU with a fresh nonce, refuses to use a GPU that fails (NVIDIA's flow gates the GPU's ready state on attestation ⚠️ verify), and folds the GPU evidence hash into an RTMR, PCR or REPORT_DATA. Because that gating logic is in the measured image, the client learns the policy was enforced.
RFC 9334 (Remote ATtestation procedureS (RATS) Architecture, January 2023) gives the vocabulary every design review should use.
| Role | In a confidential inference deployment |
|---|---|
| Attester | The confidential VM plus GPU, producing evidence |
| Verifier | Appraises evidence against policy — a client library, your service, or a SaaS verifier |
| Relying Party | Acts on the result — the client deciding to send a prompt; the KMS deciding to release a key |
| Endorser | Vouches for the attester's signing capability — AMD (VCEK chain), Intel (PCK chain), NVIDIA (device CA) |
| Reference Value Provider | Publishes expected measurements — your reproducible release pipeline, NVIDIA RIMs |
| Verifier Owner / Relying Party Owner | Set the appraisal policies |
Topologies: in the passport model the attester obtains an attestation result and presents it to the relying party; in the background-check model the relying party forwards raw evidence to a verifier. CPU-plus-GPU is a composite attester — each component's evidence must be appraised and linked.
MEASUREMENT, TDX MRTD, CCA Realm Initial Measurement. Covers only what was loaded at launch — everything later must be chained.RTMRs, CCA extensible measurements, and TPM PCRs (including a vTPM inside the CVM, hosted by a paravisor or SVSM). A vTPM is only meaningful if its attestation key is bound to the hardware report (for example, its public key hash in REPORT_DATA).RFC 9334 discusses nonces, timestamps and epoch identifiers. For interactive inference, use a client-chosen nonce in REPORT_DATA or the equivalent, or a short-lived signed attestation result whose validity window your policy bounds. Cached evidence without freshness invites replay of a report from a since-revoked TCB.
draft-ietf-rats-corim) for reference values and endorsements ⚠️ verify status.draft-ietf-rats-ar4si and related) ⚠️ verify status.Intel Trust Authority; Microsoft Azure Attestation; Google Cloud Attestation (used by Confidential Space); NVIDIA Remote Attestation Service; AWS Nitro Enclaves attestation documents verified directly or by AWS KMS ⚠️ verify current product names. Delegating appraisal adds the verifier to the trusted set; verifying on the client removes it but means shipping collateral, revocation data and policy updates to every client.
An attestation report by itself proves that some genuine TEE produced it. It does not prove that the bytes you are about to encrypt will reach that TEE. An attacker can relay your challenge to a genuine TEE and serve you from elsewhere (a relay or diversion attack). The fix is to bind a key generated inside the TEE to the evidence: put hash(public key ‖ nonce) into REPORT_DATA (SNP), REPORTDATA (TDX), the realm challenge (CCA) or the public_key/user_data fields (Nitro).
Binding patterns:
tls-exporter, RFC 9266), proving the evidence belongs to this session.draft-fossati-tls-attestation and the SEAT working group) ⚠️ verify current names and status.Terminate TLS or HPKE inside the TEE. A load balancer or API gateway outside the TEE that terminates TLS defeats everything above it.
OutOfDate TDX statuses and SNP reported TCBs below policy.HOST_DATA, MRCONFIGID, MROWNER) treated as untrusted unless pinned.RFC 9458 (Oblivious HTTP, January 2024) splits a request across two parties that must not collude.
| OHTTP resource | Sees | Does not see |
|---|---|---|
| Client | Everything about its own request | — |
| Oblivious Relay Resource | Client IP address, timing, encapsulated size | Request or response content |
| Oblivious Gateway Resource | Decrypted request and response | Client IP (only the relay's) |
| Target Resource | The request as forwarded by the gateway | Client IP |
application/ohttp-keys. Discovery via SVCB/HTTPS records is specified in RFC 9540 ⚠️ verify.draft-ietf-ohai-chunked-ohttp ⚠️ verify status — and padding to blunt the token-length side channel in §2.ai-era-security §7).Combining OHTTP with an attested gateway. Put the gateway inside a TEE, generate its HPKE key inside the TEE, publish the key configuration with evidence binding it (§6), and have the client verify before encapsulating. The cloud then sees only ciphertext, the relay sees only the IP, and the gateway's plaintext view is constrained to attested, published code.
Collusion assumptions to write down: relay and gateway run by different organizations; the relay does not log beyond operational need; no shared telemetry. OHTTP is not a mixnet — a global passive observer, or a low-volume service with a tiny anonymity set, can still correlate timing and sizes.
Attestation says which measurement is running. Transparency makes that measurement publicly committed, so that the operator cannot run a special build for one target without the world being able to see it.
tlog-checkpoint, tlog-cosignature, tlog-witness specifications ⚠️ verify names) and with independent monitors that watch for unexpected entries.sum.golang.org) and Android/Pixel binary transparency are working precedents for logging binaries that clients check.A signed release manifest per deployable image: source commit; build recipe and toolchain digests; image digest; expected launch measurement(s) for each supported CPU platform; expected RTMR/PCR reference values or the event-log policy; GPU driver and firmware expectations; model weight and tokenizer digests; and the version of the key-release policy. Clients and the KMS accept only manifests with valid inclusion proofs.
If the measurement can only be produced by your build farm, users must trust your build farm. Reproducible builds (reproducible-builds.org) let third parties rebuild from source and obtain the identical image and measurement. Pair them with SLSA provenance and in-toto attestations (see ai-security-practices). Launch measurements can be predicted offline — the SEV-SNP launch digest from the firmware binary plus kernel, initrd and command-line hashes; TDX MRTD from the TD firmware and RTMRs from the event log — with open-source measurement calculators ⚠️ verify tool names.
Note: transparency provides non-equivocation and after-the-fact detection, not safety. It only helps if someone audits the logged releases — independent researchers, a published research environment, bounties.
TEEs ask you to trust hardware vendors. The alternatives replace that with cryptography or redundancy, at a cost.
| Approach | What it proves | Confidentiality of the prompt | Practical status (October 2026) |
|---|---|---|---|
| zkML (SNARK/STARK proof of inference) | Output = model(committed weights, input) | No — the prover sees the input; weights can stay hidden from the verifier | Small models practical; LLM-scale proofs research-grade and orders of magnitude slower than inference ⚠️ verify |
| Optimistic / fraud-proof | Output is correct unless someone disputes in a window; bisection to a single step | No | Needs determinism and a challenge period; suited to on-chain or batch settings |
| Redundant execution | k independent providers agree | No — k parties now see the prompt | Simple; multiplies cost and data exposure unless each replica is itself a TEE |
| Sampled spot-checks / activation fingerprints | Statistical evidence the claimed model ran | No | Emerging (for example locality-sensitive hashes of activations) ⚠️ verify |
| FHE / MPC | Computation on encrypted data / secret shares | Yes, cryptographically | FHE far too slow for LLM-scale serving; MPC prototypes carry large communication overhead ⚠️ verify |
Every scheme that compares outputs needs reproducibility, and GPU inference is not deterministic by default: floating-point addition is not associative, kernels use atomics, and batch composition changes reduction order, so the same prompt can yield different tokens depending on server load. Thinking Machines' Defeating Nondeterminism in LLM Inference (September 2025) attributed much of this to lack of batch invariance ⚠️ verify. Mitigations: batch-invariant kernels, fixed seeds and greedy decoding for verification runs, pinned library and driver versions, identical GPU SKUs and parallelism layout, and tolerance-based (top-k or logit-distance) comparison rather than exact token equality.
Never bake secrets into images. The gateway's HPKE and TLS keys, weight-decryption keys and any log-encryption keys are released by a key broker only to evidence that satisfies policy:
kms:RecipientAttestation:ImageSha384 and kms:RecipientAttestation:PCR<n>.Policy content: pinned measurement or "signed by the release key and included in the transparency log"; minimum TCB; debug off; GPU in CC mode; freshness. The policy itself is a trust point — whoever can edit it can release keys to anything. Put it under multi-party control, log every change, and treat KMS audit logs (which record each release and the evidence presented) as security records.
Client app (open source, verifies) Transparency log <-- witnesses cosign checkpoints
| 1. fetch key config + evidence bundle <------ release manifests: image, measurements, weight digests
| 2. verify chain, TCB, debug, measurements, ^
| inclusion + consistency, nonce, key binding | published by reproducible build pipeline
| 3. HPKE-encapsulate request (Binary HTTP)
v
OHTTP relay (organization A) sees: client IP, timing, sizes not: content
v
Cloud load balancer / router sees: ciphertext, sizes, timing not: content, client IP
v
Attested gateway (CVM, organization B) HPKE private key released by KMS on attestation
| 4. decapsulate, check Privacy Pass token, pick node, re-encrypt to node's attested key
v
Confidential GPU node(s): CVM (SEV-SNP or TDX) + GPU in CC mode (SPDM session, encrypted bounce buffers)
| 5. weights decrypted inside with key from KMS; inference; padded streaming response
v
response encapsulated to the client's response key, back through relay
Key broker / KMS -- releases keys only to evidence matching policy (measurement + TCB + debug off + GPU CC + fresh)
Verifier -- client-side library, or a named third-party service (then it is in the trusted set)
| Component | Sees plaintext prompt? | Sees client identity? | Trusted for |
|---|---|---|---|
| Client | Yes | Yes | Verifying correctly |
| OHTTP relay | No | IP address | Not colluding with the gateway operator |
| Cloud network and hosts | No | No (relay IP only) | Availability |
| Attested gateway | Yes, inside the TEE | No | Running the published, logged code |
| GPU node | Yes, inside the TEE | No | Running the published, logged code |
| KMS / key broker | No | No | Enforcing the logged release policy |
| Hardware vendors | No (absent compromise) | No | Roots of trust, firmware, endorsements |
Run threat-modeling-playbook STRIDE over each arrow: every arrow is a trust boundary, and the two "trusted for" columns are your assumption register.
These summaries restate each organization's own public descriptions at a high level; they are not independent assessments, and product status changes quickly.
nvtrust repository, the attestation SDK and NRAS.Threat model and claims
threat-modeling-playbook.Platform
Attestation and binding
Transparency and supply chain
Keys and data
Privacy of identity
Operations
All references are public. Dates are publication dates; vendor documentation is cited by name because URLs move.
IETF RFCs and drafts
draft-ietf-rats-corim, draft-ietf-rats-ar4si, draft-ietf-ohai-chunked-ohttp, draft-fossati-tls-attestation, OHAI/Privacy Pass key-consistency draftsOther specifications
Vendor documentation (by name)
nvtrust repository; NVIDIA Attestation SDK and Remote Attestation Service documentationResearch cited (details ⚠️ verify where marked above)
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/ai-era-securityUse when securing AI systems, LLM applications, agentic AI, or evaluating AI security frameworks. Triggers on OWASP LLM Top 10, OWASP Agentic Top 10, MITRE ATLAS, NIST AI RMF, EU AI Act, prompt injection, agentic security, MCP security, post-quantum cryptography, or any AI/ML security question. Also use for modern security framework updates: NIST CSF 2.0, CIS Controls v8.1, FIDO2/passkeys, CNAPP, or software supply chain security (SLSA/Sigstore/SBOM)./ai-security-practicesAI security and cybersecurity best practices for software development (Python and TypeScript/Next.js) covering prompt injection defense, OWASP LLM Top 10 2025, agentic AI risks (OWASP ASI Top 10), MCP security, RAG attack vectors, output sanitization, guardrail architectures (NeMo Guardrails, LLM Guard), secrets management for AI APIs, Denial of Wallet prevention, supply-chain security (SLSA/Sigstore/SBOMs), critical Next.js/React CVEs, and NIST AI RMF. Use when advising on securing AI systems, LLM applications, agent architectures, or web application security in Python/TypeScript stacks./cybersecurity-principlesUse when explaining cybersecurity foundations, the Saltzer-Schroeder design principles, CIA triad, Zero Trust architecture, defense in depth, AAA model, threat intelligence, NIST CSF 2.0, CIS Controls, ISO 27001, modern IAM (FIDO2/passkeys/PAM), SASE, incident response, or building a security mental model. Use for any conceptual cybersecurity question, when grounding security decisions in first principles, when explaining why a security control exists, when evaluating security trade-offs, or when mapping principles to AI-era security challenges. Triggers on least privilege, fail-safe defaults, defense in depth, zero trust, CIA triad, authentication vs authorization, phishing-resistant MFA, NIST CSF, or "why do we need X security control" questions.npx claudepluginhub the-vibey-project/vibey --plugin security-principles