This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: coco-atls-hardware-quote-verification-standard

Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers

Enforces hardware-rooted AMD SEV-SNP and Intel TDX attestation quote validation prior to provisioning secrets to Confidential Containers (CoCo). Prohibits provisioning production credentials over standard mTLS without binding ephemeral TLS public keys to cryptographic enclave report data. Guarantees that untrusted host hypervisors cannot intercept or forge enclave identity.

Prohibited Anti-Pattern: Trusting mTLS identities or unverified guest claims without hardware quote cryptographic binding

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers - Enforces hardware-rooted AMD SEV-SNP and Intel TDX attestation quote validation prior to provisioning secrets to Confidential Containers (CoCo). Prohibits provisioning production credentials over standard mTLS without binding ephemeral TLS public keys to cryptographic enclave report data. Guarantees that untrusted host hypervisors cannot intercept or forge enclave identity.
globs: src/**/kbs/**/*.{ts,js}, src/**/attestation/**/*.{ts,js}, src/**/auth/**/*.{ts,js}, src/**/secrets/**/*.{ts,js}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/coco-atls-hardware-quote-verification-standard"
---

# Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting mTLS identities or unverified guest claims without hardware quote cryptographic binding

## System Constraints
You are a Principal Security Architect and Rules Author enforcing Confidential Containers (CoCo) Attested TLS (aTLS) Enclave Provisioning. You must reject any credential delivery mechanism that bypasses hardware-rooted quote verification, fails to bind the ephemeral session key to the enclave report data, or ignores TCB revocation statuses.

## Strict Guidelines
- Engineers MUST ALWAYS verify the complete hardware certificate chain against AMD KDS (for SEV-SNP) or Intel PCS (for TDX) root certificates before releasing secrets.
- Engineers MUST ALWAYS cryptographically bind the aTLS ephemeral session public key or handshake digest to the enclave's REPORT_DATA / HOST_DATA field.
- Engineers MUST NOT provision database credentials, master keys, or environment secrets based on standard x509 SAN/CN identity without verified hardware measurement.
- Code SHOULD validate measurement registers (SEV-SNP Launch Measurement or TDX MRTD/RTMR0-3) against signed golden image policies.
- Services MUST enforce cryptographic freshness using a cryptographically random, single-use nonce to prevent attestation quote replay attacks.
- Components NEVER accept self-signed attestation tokens or bypass TCB status checks, even in non-production staging environments.

## Bad vs Good Implementations
### Enclave Attested TLS Verification and Secret Release

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies strictly on standard mTLS certificates and unverified JSON body flags. Untrusted hypervisors or compromised host nodes can extract certificates, terminate the TLS session, and access raw production secrets without proving enclave hardware execution.
```typescript
import { Request, Response } from 'express';
import { getDatabaseCredentials } from './vault';

interface ClientIdentityPayload {
  enclaveId: string;
  isConfidential: boolean;
}

export async function handleSecretProvisioning(req: Request, res: Response): Promise<void> {
  const clientCert = req.socket.getPeerCertificate();
  const payload = req.body as ClientIdentityPayload;

  // VULNERABILITY: Relying on standard mTLS and unverified client claims.
  // An untrusted hypervisor can compromise guest memory or spoof container identity.
  if (clientCert.subject.CN === 'coco-enclave-node' && payload.isConfidential) {
    const credentials = await getDatabaseCredentials('production-db');
    res.status(200).json({ credentials });
    return;
  }

  res.status(403).json({ error: 'Unauthorized enclave' });
}
```

#### Production Standard (Correct)
> **Standard**: Cryptographically binds the client's ephemeral public key from the active TLS session to the hardware enclave report data, validates hardware signatures against vendor roots of trust, and enforces launch measurements before releasing secrets.
```typescript
import { Request, Response } from 'express';
import { createHash, timingSafeEqual } from 'crypto';
import { verifyHardwareEvidence, fetchExpectedLaunchMeasurement } from './attestation-verifier';
import { getDatabaseCredentials } from './vault';

interface AttestationQuotePayload {
  quoteHex: string;
  teeType: 'AMD_SEV_SNP' | 'INTEL_TDX';
  nonce: string;
}

export async function handleSecretProvisioning(req: Request, res: Response): Promise<void> {
  const rawPeerCert = req.socket.getPeerX509Certificate();
  const { quoteHex, teeType, nonce } = req.body as AttestationQuotePayload;

  if (!rawPeerCert || !quoteHex || !nonce) {
    res.status(400).json({ error: 'Missing aTLS certificate or hardware evidence' });
    return;
  }

  // Compute SHA-512 binding of the client's ephemeral public key
  const clientPubKeyDer = rawPeerCert.publicKey.export({ type: 'spki', format: 'der' });
  const expectedReportData = createHash('sha512').update(clientPubKeyDer).digest();

  const verificationResult = await verifyHardwareEvidence({
    quote: Buffer.from(quoteHex, 'hex'),
    teeType,
    expectedNonce: nonce,
    rootTrustAnchors: ['AMD_KDS_ROOT', 'INTEL_PCS_ROOT']
  });

  if (!verificationResult.isValid || verificationResult.tcbStatus !== 'UpToDate') {
    res.status(403).json({ error: 'Hardware quote verification failed or TCB revoked' });
    return;
  }

  // Cryptographically bind quote REPORT_DATA to the ephemeral TLS key
  const reportDataMatches = timingSafeEqual(verificationResult.reportData, expectedReportData);
  const goldenMeasurement = await fetchExpectedLaunchMeasurement(verificationResult.imageVersion);
  const measurementMatches = timingSafeEqual(verificationResult.measurement, goldenMeasurement);

  if (!reportDataMatches || !measurementMatches) {
    res.status(403).json({ error: 'Quote cryptographic binding or measurement mismatch' });
    return;
  }

  const credentials = await getDatabaseCredentials('production-db');
  res.status(200).json({ credentials });
}
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers

Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers defines an industrial-grade behavioral standard for security engineering. Enforces hardware-rooted AMD SEV-SNP and Intel TDX attestation quote validation prior to provisioning secrets to Confidential Containers (CoCo). Prohibits provisioning production credentials over standard mTLS without binding ephemeral TLS public keys to cryptographic enclave report data. Guarantees that untrusted host hypervisors cannot intercept or forge enclave identity. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Trusting mTLS identities or unverified guest claims without hardware quote cryptographic binding Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftTrusting mTLS identities or unverified guest claims without hardware quote cryptographic bindingCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS verify the complete hardware certificate chain against AMD KDS (for SEV-SNP) or Intel PCS (for TDX) root certificates before releasing secrets.

Engineers MUST ALWAYS verify the complete hardware certificate chain against AMD KDS (for SEV-SNP) or Intel PCS (for TDX) root certificates before releasing secrets.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST ALWAYS cryptographically bind the aTLS ephemeral session public key or handshake digest to the enclave's REPORT_DATA / HOST_DATA field.

Engineers MUST ALWAYS cryptographically bind the aTLS ephemeral session public key or handshake digest to the enclave's REPORT_DATA / HOST_DATA field.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST NOT provision database credentials, master keys, or environment secrets based on standard x509 SAN/CN identity without verified hardware measurement.

Engineers MUST NOT provision database credentials, master keys, or environment secrets based on standard x509 SAN/CN identity without verified hardware measurement.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Code SHOULD validate measurement registers (SEV-SNP Launch Measurement or TDX MRTD/RTMR0-3) against signed golden image policies.

Code SHOULD validate measurement registers (SEV-SNP Launch Measurement or TDX MRTD/RTMR0-3) against signed golden image policies.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Services MUST enforce cryptographic freshness using a cryptographically random, single-use nonce to prevent attestation quote replay attacks.

Services MUST enforce cryptographic freshness using a cryptographically random, single-use nonce to prevent attestation quote replay attacks.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

Components NEVER accept self-signed attestation tokens or bypass TCB status checks, even in non-production staging environments.

Components NEVER accept self-signed attestation tokens or bypass TCB status checks, even in non-production staging environments.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Mandatory Hardware-Rooted aTLS Quote Verification for Confidential Containers critical for AI coding assistants?

Enforces hardware-rooted AMD SEV-SNP and Intel TDX attestation quote validation prior to provisioning secrets to Confidential Containers (CoCo). Prohibits provisioning production credentials over standard mTLS without binding ephemeral TLS public keys to cryptographic enclave report data. Guarantees that untrusted host hypervisors cannot intercept or forge enclave identity. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Trusting mTLS identities or unverified guest claims without hardware quote cryptographic binding) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Mandatory