This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: fido2-enterprise-attestation-aaguid-validation-production-standard

Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification

Enforces cryptographic verification of FIDO2 Authenticator Attestation GUIDs (AAGUID) and enterprise attestation statements during WebAuthn registration. Mandates that server-side registration handlers parse verified authenticator data, match the AAGUID against a strict corporate hardware allowlist (such as FIPS 140-2/3 Level 2+ security keys), and reject consumer software passkeys or unverified roots of trust. Prevents zero-trust perimeter bypass caused by accepting unverified or consumer-synced authenticators.

Prohibited Anti-Pattern: Trusting WebAuthn Registration Responses Without Cryptographic AAGUID and Attestation Trust Chain Verification

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification - Enforces cryptographic verification of FIDO2 Authenticator Attestation GUIDs (AAGUID) and enterprise attestation statements during WebAuthn registration. Mandates that server-side registration handlers parse verified authenticator data, match the AAGUID against a strict corporate hardware allowlist (such as FIPS 140-2/3 Level 2+ security keys), and reject consumer software passkeys or unverified roots of trust. Prevents zero-trust perimeter bypass caused by accepting unverified or consumer-synced authenticators.
globs: src/**/auth/**/*.{ts,js}, src/**/webauthn/**/*.{ts,js}, src/**/passkey/**/*.{ts,js}, src/**/identity/**/*.{ts,js}, server/src/auth/**/*.{ts,js}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/fido2-enterprise-attestation-aaguid-validation-production-standard"
---

# Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting WebAuthn Registration Responses Without Cryptographic AAGUID and Attestation Trust Chain Verification

## System Constraints
You are a Principal Security Architect enforcing the FIDO2 Enterprise Attestation Hardware-Backed Credential Standard. Mandate that all passkey and WebAuthn credential registration pipelines rigorously inspect the authenticator's AAGUID, enforce enterprise/direct attestation verification, and restrict enrollment strictly to an explicit allowlist of hardware-backed FIPS-compliant devices via FIDO Alliance Metadata Service (MDS3) or internal Enterprise PKI.

## Strict Guidelines
- Engineers MUST ALWAYS request 'enterprise' or 'direct' attestation conveyance in PublicKeyCredentialCreationOptions for enterprise registrations.
- Engineers MUST ALWAYS cryptographically verify attestation statements (attStmt) and resolve the x5c certificate chain to a trusted enterprise root or FIDO MDS3 certified hardware root.
- Services MUST extract the 128-bit AAGUID from the validated authData bytes and evaluate it against an immutable corporate allowlist of FIPS/approved hardware authenticators.
- Engineers MUST NOT permit zeroed AAGUIDs (00000000-0000-0000-0000-000000000000) or unregistered consumer passkey providers (e.g., iCloud Keychain, Google Password Manager) into enterprise tenant perimeters.
- Components NEVER store or trust client-supplied AAGUID strings; the AAGUID must strictly be derived server-side from the verified binary authenticatorData inside the attestationObject.

## Bad vs Good Implementations
### Server-side WebAuthn Registration Verification with AAGUID Enforcement

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The registration handler only checks cryptographic proof of possession without verifying attestation conveyance, attestation statement chains, or the AAGUID against an approved FIPS hardware list. This allows unmanaged consumer passkeys (e.g., software vaults, synced cloud keys) to register inside a zero-trust enterprise boundary.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';
import type { RegistrationResponseJSON } from '@simplewebauthn/types';
import { Request, Response } from 'express';

export async function registerPasskey(req: Request, res: Response) {
  const { credential, expectedChallenge } = req.body;

  // SECURITY FLAW: Blindly verifies response without enterprise attestation
  // or AAGUID hardware allowlist checks. Permits arbitrary consumer passkeys.
  const verification = await verifyRegistrationResponse({
    response: credential as RegistrationResponseJSON,
    expectedChallenge,
    expectedOrigin: 'https://auth.corp.internal',
    expectedRPID: 'corp.internal',
  });

  if (!verification.verified || !verification.registrationInfo) {
    return res.status(400).json({ error: 'Registration verification failed' });
  }

  // Saves credential without validating if hardware-backed or FIPS certified
  await db.credentials.save({
    credentialID: verification.registrationInfo.credentialID,
    publicKey: verification.registrationInfo.credentialPublicKey,
    counter: verification.registrationInfo.counter,
  });

  return res.status(200).json({ verified: true });
}
```

#### Production Standard (Correct)
> **Standard**: The handler validates that user verification was enforced, extracts the cryptographic AAGUID from the validated registrationInfo, rejects default/zeroed consumer passkey identifiers, and requires the AAGUID to exist within a vetted FIPS hardware allowlist before persisting the credential.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';
import type { RegistrationResponseJSON } from '@simplewebauthn/types';
import { Request, Response } from 'express';

// Enterprise approved hardware AAGUIDs (e.g., YubiKey 5 FIPS Series)
const APPROVED_ENTERPRISE_AAGUIDS: ReadonlySet<string> = new Set([
  'ee882879-721c-4913-9775-3dfcce97072a', // YubiKey 5 Series FIPS
  'cb9b0f4a-8618-490b-93ff-44e23c72b260', // YubiKey 5 NFC FIPS
]);

export async function registerPasskey(req: Request, res: Response) {
  const { credential, expectedChallenge } = req.body;

  const verification = await verifyRegistrationResponse({
    response: credential as RegistrationResponseJSON,
    expectedChallenge,
    expectedOrigin: 'https://auth.corp.internal',
    expectedRPID: 'corp.internal',
    requireUserVerification: true,
  });

  if (!verification.verified || !verification.registrationInfo) {
    return res.status(400).json({ error: 'Invalid attestation signature' });
  }

  const { aaguid, attestationObject } = verification.registrationInfo;
  const normalizedAaguid = aaguid.toLowerCase();

  // Invariant 1: Reject null/zeroed consumer software AAGUIDs
  if (normalizedAaguid === '00000000-0000-0000-0000-000000000000') {
    return res.status(403).json({ error: 'Consumer software authenticators are strictly prohibited' });
  }

  // Invariant 2: Hardware AAGUID must exist in enterprise hardware allowlist
  if (!APPROVED_ENTERPRISE_AAGUIDS.has(normalizedAaguid)) {
    return res.status(403).json({ error: 'Authenticator model not permitted by enterprise zero-trust policy' });
  }

  await db.credentials.save({
    credentialID: verification.registrationInfo.credentialID,
    publicKey: verification.registrationInfo.credentialPublicKey,
    counter: verification.registrationInfo.counter,
    aaguid: normalizedAaguid,
    rawAttestationObject: attestationObject,
  });

  return res.status(200).json({ verified: true });
}
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification

Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification defines an industrial-grade behavioral standard for security engineering. Enforces cryptographic verification of FIDO2 Authenticator Attestation GUIDs (AAGUID) and enterprise attestation statements during WebAuthn registration. Mandates that server-side registration handlers parse verified authenticator data, match the AAGUID against a strict corporate hardware allowlist (such as FIPS 140-2/3 Level 2+ security keys), and reject consumer software passkeys or unverified roots of trust. Prevents zero-trust perimeter bypass caused by accepting unverified or consumer-synced authenticators. 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 WebAuthn Registration Responses Without Cryptographic AAGUID and Attestation Trust Chain Verification 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 WebAuthn Registration Responses Without Cryptographic AAGUID and Attestation Trust Chain VerificationCritical
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 request 'enterprise' or 'direct' attestation conveyance in PublicKeyCredentialCreationOptions for enterprise registrations.

Engineers MUST ALWAYS request 'enterprise' or 'direct' attestation conveyance in PublicKeyCredentialCreationOptions for enterprise registrations.

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 verify attestation statements (attStmt) and resolve the x5c certificate chain to a trusted enterprise root or FIDO MDS3 certified hardware root.

Engineers MUST ALWAYS cryptographically verify attestation statements (attStmt) and resolve the x5c certificate chain to a trusted enterprise root or FIDO MDS3 certified hardware root.

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

Services MUST extract the 128-bit AAGUID from the validated authData bytes and evaluate it against an immutable corporate allowlist of FIPS/approved hardware authenticators.

Services MUST extract the 128-bit AAGUID from the validated authData bytes and evaluate it against an immutable corporate allowlist of FIPS/approved hardware authenticators.

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

Engineers MUST NOT permit zeroed AAGUIDs (00000000-0000-0000-0000-000000000000) or unregistered consumer passkey providers (e.g., iCloud Keychain, Google Password Manager) into enterprise tenant perimeters.

Engineers MUST NOT permit zeroed AAGUIDs (00000000-0000-0000-0000-000000000000) or unregistered consumer passkey providers (e.g., iCloud Keychain, Google Password Manager) into enterprise tenant perimeters.

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

Components NEVER store or trust client-supplied AAGUID strings

Components NEVER store or trust client-supplied AAGUID strings; the AAGUID must strictly be derived server-side from the verified binary authenticatorData inside the attestationObject.

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 Enforce FIDO2 Enterprise Attestation and Cryptographic AAGUID Verification critical for AI coding assistants?

Enforces cryptographic verification of FIDO2 Authenticator Attestation GUIDs (AAGUID) and enterprise attestation statements during WebAuthn registration. Mandates that server-side registration handlers parse verified authenticator data, match the AAGUID against a strict corporate hardware allowlist (such as FIPS 140-2/3 Level 2+ security keys), and reject consumer software passkeys or unverified roots of trust. Prevents zero-trust perimeter bypass caused by accepting unverified or consumer-synced authenticators. 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 WebAuthn Registration Responses Without Cryptographic AAGUID and Attestation Trust Chain Verification) 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

Enforce