This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: webauthn-l3-enterprise-attestation-sync-exclusion

WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion

Enforces strict zero-trust hardware attestation for high-assurance enterprise WebAuthn flows. Requires cryptographically verified AAGUID allowlisting against trusted FIDO Metadata Service (MDS) roots and explicitly rejects multi-device synchronized passkeys by inspecting authenticator data backup flags (BE/BS).

Prohibited Anti-Pattern: Accepting Cloud-Synchronized Passkeys and Unverified AAGUIDs in Zero-Trust Authentication Tiers

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion - Enforces strict zero-trust hardware attestation for high-assurance enterprise WebAuthn flows. Requires cryptographically verified AAGUID allowlisting against trusted FIDO Metadata Service (MDS) roots and explicitly rejects multi-device synchronized passkeys by inspecting authenticator data backup flags (BE/BS).
globs: src/auth/**/*.{ts,tsx}, src/server/auth/**/*.{ts,tsx}, packages/auth/**/*.{ts,tsx}, src/api/webauthn/**/*.{ts,tsx}, server/src/modules/auth/**/*.{ts,tsx}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/webauthn-l3-enterprise-attestation-sync-exclusion"
---

# WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Accepting Cloud-Synchronized Passkeys and Unverified AAGUIDs in Zero-Trust Authentication Tiers

## System Constraints
You are a Principal Security Architect enforcing WebAuthn Level 3 Enterprise Attestation and Passkey Sync-Exclusion Invariants. You must strictly forbid multi-device (cloud-synchronized) passkeys in enterprise authentication contexts. Every credential registration ceremony must require enterprise or direct attestation, validate the Authenticator Attestation GUID (AAGUID) against a hardware-bound allowlist, and assert that the Backup Eligibility (BE) and Backup State (BS) authenticator data flags are zero.

## Strict Guidelines
- Engineers MUST ALWAYS demand 'enterprise' or 'direct' attestation conveying authentic certificates during enterprise enrollment ceremonies; never accept 'none'.
- Services MUST inspect authenticator data bit flags and unconditionally reject credentials where Backup Eligibility (BE, bit 3) or Backup State (BS, bit 4) is true.
- Engineers MUST ALWAYS validate the parsed AAGUID against an explicit hardware-bound allowlist verified via the FIDO Alliance Metadata Service (MDS3).
- Components NEVER store or trust self-reported client extensions without verifying the signed authenticator data buffer cryptographic signature.
- Services MUST require User Verification (UV flag, bit 2) to be set to true to ensure PIN or biometric local authentication was performed on the hardware token.

## Bad vs Good Implementations
### Enforce Device-Bound Enterprise Hardware Attestation & Reject Synced Passkeys

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Accepts soft tokens and cloud-synced passkeys (Apple Keychain, Google Password Manager) by failing to check the Backup Eligibility (BE) flag. Fails to verify the AAGUID against a certified hardware vendor allowlist and does not enforce enterprise attestation.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';

export async function registerEnterprisePasskey(req: Request, expectedChallenge: string) {
  const body = await req.json();
  
  // CRITICAL SECURITY FLAW: Accepts default 'none' attestation, allows cloud-synced passkeys,
  // and ignores AAGUID hardware allowlist checks.
  const verification = await verifyRegistrationResponse({
    response: body,
    expectedChallenge,
    expectedOrigin: 'https://corp.internal',
    expectedRPID: 'corp.internal',
    requireUserVerification: false,
  });

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

  return saveCredentialToDatabase({
    credentialId: verification.registrationInfo.credential.id,
    publicKey: verification.registrationInfo.credential.publicKey,
  });
}
```

#### Production Standard (Correct)
> **Standard**: Validates that the credential is strictly hardware-bound by asserting `backupEligibility` and `backedUp` are false. Enforces user verification (`userVerified`) and verifies the AAGUID against a validated enterprise hardware allowlist.
```typescript
import { verifyRegistrationResponse } from '@simplewebauthn/server';
import { isAaguidApprovedHardwareToken } from './fido-mds-validator';

export async function registerEnterprisePasskey(req: Request, expectedChallenge: string) {
  const body = await req.json();

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

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

  const { credential, aaguid, flags } = verification.registrationInfo;

  // INVARIANT 1: Disallow Multi-Device / Cloud-Synchronized Passkeys (Sync-Exclusion)
  // In WebAuthn L3 authData flags: Bit 3 is Backup Eligibility (BE), Bit 4 is Backup State (BS)
  if (flags.backupEligibility || flags.backedUp) {
    throw new SecurityError('Policy Violation: Multi-device synchronized passkeys are forbidden.');
  }

  // INVARIANT 2: Hardware-bound AAGUID verification via Enterprise Allowlist / MDS3
  const isApprovedHardware = await isAaguidApprovedHardwareToken(aaguid);
  if (!isApprovedHardware) {
    throw new SecurityError(`Policy Violation: Authenticator AAGUID ${aaguid} is not an authorized hardware token.`);
  }

  // INVARIANT 3: Ensure User Verification was performed on hardware
  if (!flags.userVerified) {
    throw new SecurityError('Policy Violation: User verification (PIN/Biometric) was not established.');
  }

  return saveCredentialToDatabase({
    credentialId: credential.id,
    publicKey: credential.publicKey,
    counter: credential.counter,
    aaguid,
    deviceBound: 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: WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion

WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion defines an industrial-grade behavioral standard for security engineering. Enforces strict zero-trust hardware attestation for high-assurance enterprise WebAuthn flows. Requires cryptographically verified AAGUID allowlisting against trusted FIDO Metadata Service (MDS) roots and explicitly rejects multi-device synchronized passkeys by inspecting authenticator data backup flags (BE/BS). 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: Accepting Cloud-Synchronized Passkeys and Unverified AAGUIDs in Zero-Trust Authentication Tiers 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 DriftAccepting Cloud-Synchronized Passkeys and Unverified AAGUIDs in Zero-Trust Authentication TiersCritical
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 demand 'enterprise' or 'direct' attestation conveying authentic certificates during enterprise enrollment ceremonies

Engineers MUST ALWAYS demand 'enterprise' or 'direct' attestation conveying authentic certificates during enterprise enrollment ceremonies; never accept 'none'.

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

Services MUST inspect authenticator data bit flags and unconditionally reject credentials where Backup Eligibility (BE, bit 3) or Backup State (BS, bit 4) is true.

Services MUST inspect authenticator data bit flags and unconditionally reject credentials where Backup Eligibility (BE, bit 3) or Backup State (BS, bit 4) is true.

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 ALWAYS validate the parsed AAGUID against an explicit hardware-bound allowlist verified via the FIDO Alliance Metadata Service (MDS3).

Engineers MUST ALWAYS validate the parsed AAGUID against an explicit hardware-bound allowlist verified via the FIDO Alliance Metadata Service (MDS3).

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

Components NEVER store or trust self-reported client extensions without verifying the signed authenticator data buffer cryptographic signature.

Components NEVER store or trust self-reported client extensions without verifying the signed authenticator data buffer cryptographic signature.

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 require User Verification (UV flag, bit 2) to be set to true to ensure PIN or biometric local authentication was performed on the hardware token.

Services MUST require User Verification (UV flag, bit 2) to be set to true to ensure PIN or biometric local authentication was performed on the hardware token.

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 WebAuthn Level 3 Enterprise Attestation and Multi-Device Passkey Sync-Exclusion critical for AI coding assistants?

Enforces strict zero-trust hardware attestation for high-assurance enterprise WebAuthn flows. Requires cryptographically verified AAGUID allowlisting against trusted FIDO Metadata Service (MDS) roots and explicitly rejects multi-device synchronized passkeys by inspecting authenticator data backup flags (BE/BS). 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 (Accepting Cloud-Synchronized Passkeys and Unverified AAGUIDs in Zero-Trust Authentication Tiers) 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

WebAuthn