This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: webauthn-largeblob-hardware-vault-standard

WebAuthn LargeBlob Hardware-Bound Vault Security Standard

Enforces zero-knowledge cryptographic persistence by binding user symmetric encryption keys strictly to platform authenticator hardware storage via WebAuthn Level 3 largeBlob extensions. Prohibits non-hardware fallbacks, unverified extension negotiation, and plaintext key persistence across client runtime memory.

Prohibited Anti-Pattern: Silent fallback to software storage or unverified largeBlob extension negotiation leading to key compromise.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: WebAuthn LargeBlob Hardware-Bound Vault Security Standard - Enforces zero-knowledge cryptographic persistence by binding user symmetric encryption keys strictly to platform authenticator hardware storage via WebAuthn Level 3 largeBlob extensions. Prohibits non-hardware fallbacks, unverified extension negotiation, and plaintext key persistence across client runtime memory.
globs: src/**/*.{ts,tsx}, lib/**/*.{ts,tsx}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/webauthn-largeblob-hardware-vault-standard"
---

# WebAuthn LargeBlob Hardware-Bound Vault Security Standard

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Silent fallback to software storage or unverified largeBlob extension negotiation leading to key compromise.

## System Constraints
You are a Principal Security Architect enforcing the WebAuthn LargeBlob Hardware-Bound Vault Standard. You must strictly mandate that all client-side cryptographic key storage bound to authenticators enforces hardware-backed largeBlob verification, guarantees explicit user verification, and rejects insecure software or transport fallbacks.

## Strict Guidelines
- Engineers MUST ALWAYS set `largeBlob: { support: 'required' }` during WebAuthn credential registration when provisioning hardware-backed vault keys.
- Engineers MUST ALWAYS inspect `credential.getClientExtensionResults().largeBlob` and fail transaction workflows if `supported` is not explicitly `true` or if read/write operations fail.
- Engineers MUST NOT fallback to `localStorage`, `sessionStorage`, or unencrypted `IndexedDB` when `largeBlob` negotiation fails or is unsupported by the client platform.
- Code SHOULD zeroize ephemeral symmetric key buffers (e.g., using `crypto.getRandomValues` or explicit memory clearing) immediately after cryptographic vault operations complete.
- Services MUST require `userVerification: 'required'` whenever reading or writing to `largeBlob` to ensure biometrics or hardware PIN authorization accompany key release.
- Components NEVER transmit raw `largeBlob` payload bytes to the relying party backend server, maintaining strict zero-knowledge architecture.

## Bad vs Good Implementations
### WebAuthn LargeBlob Registration & Key Commitment

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The registration configuration does not negotiate the largeBlob extension (`support: 'required'`), allows relaxed user verification (`preferred`), and leaks the sensitive symmetric vault key directly into unencrypted `localStorage`.
```typescript
async function registerVaultKey(challenge: Uint8Array): Promise<void> {
  // Anti-pattern: Missing largeBlob requirement and silently falling back to localStorage
  const credential = await navigator.credentials.create({
    publicKey: {
      challenge,
      rp: { name: "Secure Vault Inc" },
      user: { id: new Uint8Array([1, 2, 3]), name: "[email protected]", displayName: "User" },
      pubKeyCredParams: [{ alg: -7, type: "public-key" }],
      authenticatorSelection: { userVerification: "preferred" }
    }
  }) as PublicKeyCredential;

  const rawKey = crypto.getRandomValues(new Uint8Array(32));
  // CRITICAL VULNERABILITY: Storing raw symmetric master key in browser storage
  localStorage.setItem("vault_master_key", btoa(String.fromCharCode(...rawKey)));
}
```

#### Production Standard (Correct)
> **Standard**: Mandates platform authenticator attachment with `userVerification: 'required'`, explicitly demands `largeBlob: { support: 'required' }`, validates extension acceptance, immediately verifies writes, and securely zeroes out volatile memory.
```typescript
interface VaultRegistrationResult {
  credentialId: ArrayBuffer;
}

async function registerVaultKey(
  challenge: Uint8Array,
  userId: Uint8Array,
  userEmail: string,
  initialSymmetricKey: Uint8Array
): Promise<VaultRegistrationResult> {
  if (!window.PublicKeyCredential || !PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable) {
    throw new Error("Hardware authenticators are unavailable on this client.");
  }

  // Enforce hardware-backed largeBlob support with mandatory user verification
  const credential = (await navigator.credentials.create({
    publicKey: {
      challenge,
      rp: { name: "Secure Vault Inc" },
      user: { id: userId, name: userEmail, displayName: userEmail },
      pubKeyCredParams: [
        { alg: -7, type: "public-key" }, // ES256
        { alg: -257, type: "public-key" } // RS256
      ],
      authenticatorSelection: {
        authenticatorAttachment: "platform",
        userVerification: "required",
        requireResidentKey: true
      },
      extensions: {
        largeBlob: {
          support: "required"
        }
      }
    }
  })) as PublicKeyCredential | null;

  if (!credential) {
    throw new Error("Authenticator creation aborted by user or platform.");
  }

  const extensionOutputs = credential.getClientExtensionResults();
  if (!extensionOutputs.largeBlob?.supported) {
    throw new Error("Authenticator does not support the required hardware-bound largeBlob extension.");
  }

  // Commit the key to the authenticator storage via an immediate assertion write
  const writeAssertion = (await navigator.credentials.get({
    publicKey: {
      challenge: crypto.getRandomValues(new Uint8Array(32)),
      allowCredentials: [{ id: credential.rawId, type: "public-key" }],
      userVerification: "required",
      extensions: {
        largeBlob: {
          write: initialSymmetricKey
        }
      }
    }
  })) as PublicKeyCredential | null;

  const writeResults = writeAssertion?.getClientExtensionResults();
  if (!writeResults?.largeBlob?.written) {
    throw new Error("Cryptographic commitment to authenticator largeBlob storage failed.");
  }

  // Explicit zeroization of volatile key memory
  initialSymmetricKey.fill(0);

  return { credentialId: credential.rawId };
}
```

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 LargeBlob Hardware-Bound Vault Security Standard

WebAuthn LargeBlob Hardware-Bound Vault Security Standard defines an industrial-grade behavioral standard for security engineering. Enforces zero-knowledge cryptographic persistence by binding user symmetric encryption keys strictly to platform authenticator hardware storage via WebAuthn Level 3 largeBlob extensions. Prohibits non-hardware fallbacks, unverified extension negotiation, and plaintext key persistence across client runtime memory. 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: Silent fallback to software storage or unverified largeBlob extension negotiation leading to key compromise. 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 DriftSilent fallback to software storage or unverified largeBlob extension negotiation leading to key compromise.Critical
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 set `largeBlob

Engineers MUST ALWAYS set `largeBlob: { support: 'required' }` during WebAuthn credential registration when provisioning hardware-backed vault keys.

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 inspect `credential.getClientExtensionResults().largeBlob` and fail transaction workflows if `supported` is not explicitly `true` or if read/write operations fail.

Engineers MUST ALWAYS inspect `credential.getClientExtensionResults().largeBlob` and fail transaction workflows if `supported` is not explicitly `true` or if read/write operations fail.

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 fallback to `localStorage`, `sessionStorage`, or unencrypted `IndexedDB` when `largeBlob` negotiation fails or is unsupported by the client platform.

Engineers MUST NOT fallback to `localStorage`, `sessionStorage`, or unencrypted `IndexedDB` when `largeBlob` negotiation fails or is unsupported by the client platform.

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 zeroize ephemeral symmetric key buffers (e.g., using `crypto.getRandomValues` or explicit memory clearing) immediately after cryptographic vault operations complete.

Code SHOULD zeroize ephemeral symmetric key buffers (e.g., using `crypto.getRandomValues` or explicit memory clearing) immediately after cryptographic vault operations complete.

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 `userVerification

Services MUST require `userVerification: 'required'` whenever reading or writing to `largeBlob` to ensure biometrics or hardware PIN authorization accompany key release.

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 transmit raw `largeBlob` payload bytes to the relying party backend server, maintaining strict zero-knowledge architecture.

Components NEVER transmit raw `largeBlob` payload bytes to the relying party backend server, maintaining strict zero-knowledge architecture.

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 LargeBlob Hardware-Bound Vault Security Standard critical for AI coding assistants?

Enforces zero-knowledge cryptographic persistence by binding user symmetric encryption keys strictly to platform authenticator hardware storage via WebAuthn Level 3 largeBlob extensions. Prohibits non-hardware fallbacks, unverified extension negotiation, and plaintext key persistence across client runtime memory. 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 (Silent fallback to software storage or unverified largeBlob extension negotiation leading to key compromise.) 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