This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: webauthn-mds3-aaguid-hardware-class-whitelist-invariant

FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail

Enterprise authentication workflows must enforce direct attestation and validate the Authenticator Attestation GUID (AAGUID) against FIDO Alliance Metadata Service v3 (MDS3). The registration pipeline must cryptographically reject synced multi-device passkeys (all-zero AAGUIDs or uncertified software authenticators) and require certified hardware security keys matching an enterprise trust list with acceptable FIDO certification levels (e.g., FIDO_CERTIFIED_L2 or higher).

Prohibited Anti-Pattern: Acceptance of Synced Multi-Device Passkeys or Unverified AAGUIDs in Enterprise-Bound Hardware Workflows

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail - Enterprise authentication workflows must enforce direct attestation and validate the Authenticator Attestation GUID (AAGUID) against FIDO Alliance Metadata Service v3 (MDS3). The registration pipeline must cryptographically reject synced multi-device passkeys (all-zero AAGUIDs or uncertified software authenticators) and require certified hardware security keys matching an enterprise trust list with acceptable FIDO certification levels (e.g., FIDO_CERTIFIED_L2 or higher).
globs: src/auth/**/*.ts, src/security/**/*.ts, src/services/webauthn/**/*.ts, src/api/auth/**/*.ts
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/webauthn-mds3-aaguid-hardware-class-whitelist-invariant"
---

# FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Acceptance of Synced Multi-Device Passkeys or Unverified AAGUIDs in Enterprise-Bound Hardware Workflows

## System Constraints
You are a Principal Security Architect enforcing the WebAuthn FIDO2 MDS3 AAGUID Hardware-Class Whitelist Invariant. You must reject any registration flow that accepts 'none' attestation, fails to extract and verify the authentic AAGUID, allows the zero-UUID (00000000-0000-0000-0000-000000000000), or skips cryptographically validated FIDO MDS3 metadata verification for authenticator hardware-backed assurance.

## Strict Guidelines
- Registration options MUST ALWAYS mandate `attestation: 'direct'` (or 'enterprise' where supported) and `authenticatorSelection: { authenticatorAttachment: 'cross-platform', userVerification: 'required' }`.
- Engineers MUST NEVER permit the zero-GUID ('00000000-0000-0000-0000-000000000000') in enterprise hardware-bound policies, as it explicitly designates multi-device synced passkeys or software authenticators.
- Services MUST download, verify the digital signature chain against the FIDO MDS3 Root CA, and cache the FIDO Alliance MDS3 BLOB to perform offline or low-latency authenticated lookups.
- The server-side verification pipeline MUST verify that the authenticator's AAGUID extracted from `authData` is present in the enterprise-approved whitelist of AAGUIDs sourced from verified MDS3 entries.
- Authentication metadata queries MUST verify the `certificationStatus` field in MDS3 metadata entries (e.g., ensuring `FIDO_CERTIFIED_L2`, `FIDO_CERTIFIED_L3` status) and verify absence of `statusReports` indicating key compromise ('USER_VERIFICATION_BYPASS', 'ATTESTATION_KEY_COMPROMISE').
- Attestation certificates (x5c) extracted from the attestation object MUST be cryptographically verified against the attestation root certificates declared in the authenticator's MDS3 metadata statement.

## Bad vs Good Implementations
### AAGUID and MDS3 Hardware-Class Whitelist Attestation Validation

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: This implementation fails to verify attestation authenticity, accepts multi-device synced passkeys (like Apple/Google passkeys that leak hardware boundaries), does not extract the AAGUID, and completely omits FIDO MDS3 validation, allowing unvetted software authenticators into a high-security zone.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';
import type { RegistrationResponseJSON } from '@simplewebauthn/types';

export async function registerDevice(userId: string, response: RegistrationResponseJSON, expectedChallenge: string) {
  // ANTI-PATTERN: None/Indirect attestation accepted, AAGUID ignored, no MDS3 validation
  const verification = await verifyRegistrationResponse({
    response,
    expectedChallenge,
    expectedOrigin: 'https://vault.enterprise.internal',
    expectedRPID: 'vault.enterprise.internal',
    requireUserVerification: true,
  });

  if (!verification.verified || !verification.registrationInfo) {
    throw new Error('Registration failed');
  }

  // Storing credential without checking if it is a synced iCloud/Google passkey or hardware key
  const { credentialID, credentialPublicKey } = verification.registrationInfo;
  return await db.credentials.create({ data: { userId, credentialID, credentialPublicKey } });
}
```

#### Production Standard (Correct)
> **Standard**: The good implementation strictly bans the zero-AAGUID multi-device passkey indicator, verifies the device AAGUID against an authenticated FIDO MDS3 metadata cache, checks for enterprise-grade FIDO certification (L2+), and validates that no security revocations or compromise reports affect the device model.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';
import type { RegistrationResponseJSON } from '@simplewebauthn/types';
import { FidoMds3Service } from './fidoMds3Service';

const ZERO_AAGUID = '00000000-0000-0000-0000-000000000000';
const MINIMUM_CERTIFICATION_LEVELS = new Set(['FIDO_CERTIFIED_L2', 'FIDO_CERTIFIED_L3', 'FIDO_CERTIFIED_L3plus']);

export async function registerHardwareKey(
  userId: string,
  response: RegistrationResponseJSON,
  expectedChallenge: string,
  mds3Service: FidoMds3Service
) {
  const verification = await verifyRegistrationResponse({
    response,
    expectedChallenge,
    expectedOrigin: 'https://vault.enterprise.internal',
    expectedRPID: 'vault.enterprise.internal',
    requireUserVerification: true,
  });

  if (!verification.verified || !verification.registrationInfo) {
    throw new SecurityViolationError('Cryptographic registration verification failed.');
  }

  const { aaguid, credentialID, credentialPublicKey, attestationObject } = verification.registrationInfo;

  // Reject multi-device synced passkeys and missing AAGUIDs
  if (!aaguid || aaguid === ZERO_AAGUID) {
    throw new SecurityViolationError('Synced multi-device passkeys prohibited. Enterprise hardware key required.');
  }

  // Verify device against FIDO MDS3 authenticated metadata statement
  const metadata = await mds3Service.getEntryByAAGUID(aaguid);
  if (!metadata) {
    throw new SecurityViolationError(`AAGUID ${aaguid} is not recognized by FIDO MDS3.`);
  }

  // Ensure hardware-class certification and absence of revocations/compromise
  const certLevel = metadata.metadataStatement.authenticatorGetInfo?.certificationLevel;
  if (!certLevel || !MINIMUM_CERTIFICATION_LEVELS.has(certLevel)) {
    throw new SecurityViolationError(`Hardware assurance level insufficient: ${certLevel}`);
  }

  const hasCompromise = metadata.statusReports.some(report =>
    ['ATTESTATION_KEY_COMPROMISE', 'USER_VERIFICATION_BYPASS'].includes(report.status)
  );
  if (hasCompromise) {
    throw new SecurityViolationError('Hardware token model has active MDS3 compromise status reports.');
  }

  return await db.credentials.create({
    data: {
      userId,
      credentialID: Buffer.from(credentialID).toString('base64url'),
      credentialPublicKey: Buffer.from(credentialPublicKey).toString('base64url'),
      aaguid,
      hardwareModel: metadata.metadataStatement.description,
    },
  });
}
```

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: FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail

FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail defines an industrial-grade behavioral standard for security engineering. Enterprise authentication workflows must enforce direct attestation and validate the Authenticator Attestation GUID (AAGUID) against FIDO Alliance Metadata Service v3 (MDS3). The registration pipeline must cryptographically reject synced multi-device passkeys (all-zero AAGUIDs or uncertified software authenticators) and require certified hardware security keys matching an enterprise trust list with acceptable FIDO certification levels (e.g., FIDO_CERTIFIED_L2 or higher). 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: Acceptance of Synced Multi-Device Passkeys or Unverified AAGUIDs in Enterprise-Bound Hardware Workflows 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 DriftAcceptance of Synced Multi-Device Passkeys or Unverified AAGUIDs in Enterprise-Bound Hardware WorkflowsCritical
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

Registration options MUST ALWAYS mandate `attestation

Registration options MUST ALWAYS mandate `attestation: 'direct'` (or 'enterprise' where supported) and `authenticatorSelection: { authenticatorAttachment: 'cross-platform', userVerification: 'required' }`.

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 NEVER permit the zero-GUID ('00000000-0000-0000-0000-000000000000') in enterprise hardware-bound policies, as it explicitly designates multi-device synced passkeys or software authenticators.

Engineers MUST NEVER permit the zero-GUID ('00000000-0000-0000-0000-000000000000') in enterprise hardware-bound policies, as it explicitly designates multi-device synced passkeys or software 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.
3

Services MUST download, verify the digital signature chain against the FIDO MDS3 Root CA, and cache the FIDO Alliance MDS3 BLOB to perform offline or low-latency authenticated lookups.

Services MUST download, verify the digital signature chain against the FIDO MDS3 Root CA, and cache the FIDO Alliance MDS3 BLOB to perform offline or low-latency authenticated lookups.

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

The server-side verification pipeline MUST verify that the authenticator's AAGUID extracted from `authData` is present in the enterprise-approved whitelist of AAGUIDs sourced from verified MDS3 entries.

The server-side verification pipeline MUST verify that the authenticator's AAGUID extracted from `authData` is present in the enterprise-approved whitelist of AAGUIDs sourced from verified MDS3 entries.

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

Authentication metadata queries MUST verify the `certificationStatus` field in MDS3 metadata entries (e.g., ensuring `FIDO_CERTIFIED_L2`, `FIDO_CERTIFIED_L3` status) and verify absence of `statusReports` indicating key compromise ('USER_VERIFICATION_BYPASS', 'ATTESTATION_KEY_COMPROMISE').

Authentication metadata queries MUST verify the `certificationStatus` field in MDS3 metadata entries (e.g., ensuring `FIDO_CERTIFIED_L2`, `FIDO_CERTIFIED_L3` status) and verify absence of `statusReports` indicating key compromise ('USER_VERIFICATION_BYPASS', 'ATTESTATION_KEY_COMPROMISE').

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

Attestation certificates (x5c) extracted from the attestation object MUST be cryptographically verified against the attestation root certificates declared in the authenticator's MDS3 metadata statement.

Attestation certificates (x5c) extracted from the attestation object MUST be cryptographically verified against the attestation root certificates declared in the authenticator's MDS3 metadata statement.

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 FIDO2 MDS3 AAGUID Hardware-Class Whitelist Enforcement Guardrail critical for AI coding assistants?

Enterprise authentication workflows must enforce direct attestation and validate the Authenticator Attestation GUID (AAGUID) against FIDO Alliance Metadata Service v3 (MDS3). The registration pipeline must cryptographically reject synced multi-device passkeys (all-zero AAGUIDs or uncertified software authenticators) and require certified hardware security keys matching an enterprise trust list with acceptable FIDO certification levels (e.g., FIDO_CERTIFIED_L2 or higher). 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 (Acceptance of Synced Multi-Device Passkeys or Unverified AAGUIDs in Enterprise-Bound Hardware Workflows) 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

FIDO2