Architectural Invariant Design: Mandatory DPoP Proof-Key Binding for Passkey Conditional UI Sessions
Mandatory DPoP Proof-Key Binding for Passkey Conditional UI Sessions defines an industrial-grade behavioral standard for security engineering. Enforces strict cryptographic binding between WebAuthn Passkey Conditional UI assertions and ephemeral, non-extractable client-side DPoP (RFC 9449) key pairs. Eliminates enterprise token theft, session hijacking, and adversary-in-the-middle (AiTM) proxying by ensuring access tokens cannot be issued as bearer tokens or replayed outside the initiating browser context. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
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 Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Issuing Unconstrained Bearer Tokens from Unbound Passkey Conditional Autofill Assertions | 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 Inconsistency | AI 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. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Engineers MUST generate an ephemeral, non-extractable ECDSA (P-256) or Ed25519 CryptoKey pair via `crypto.subtle` prior to invoking Passkey Conditional UI.
Engineers MUST generate an ephemeral, non-extractable ECDSA (P-256) or Ed25519 CryptoKey pair via `crypto.subtle` prior to invoking Passkey Conditional UI.
Engineers MUST compute the SHA-256 JWK Thumbprint (`jkt`) of the DPoP public key and transmit it to the server during authentication challenge negotiation.
Engineers MUST compute the SHA-256 JWK Thumbprint (`jkt`) of the DPoP public key and transmit it to the server during authentication challenge negotiation.
The server MUST cryptographically bind the WebAuthn challenge to the client's `jkt` thumbprint (e.g., `challenge = HMAC-SHA256(server_secret, session_id || jkt)`).
The server MUST cryptographically bind the WebAuthn challenge to the client's `jkt` thumbprint (e.g., `challenge = HMAC-SHA256(server_secret, session_id || jkt)`).
Clients MUST invoke `navigator.credentials.get` using `mediation
Clients MUST invoke `navigator.credentials.get` using `mediation: 'conditional'` alongside an `AbortController` signal to support autocomplete autofill safely.
Authentication and token exchange requests MUST include a valid `DPoP` proof JWT signed by the private key matching the `jkt`, containing accurate `htm`, `htu`, `iat`, and unique `jti` claims.
Authentication and token exchange requests MUST include a valid `DPoP` proof JWT signed by the private key matching the `jkt`, containing accurate `htm`, `htu`, `iat`, and unique `jti` claims.
Engineers MUST NEVER persist DPoP private keys to `localStorage`, `sessionStorage`, or unencrypted cookies
Engineers MUST NEVER persist DPoP private keys to `localStorage`, `sessionStorage`, or unencrypted cookies; keys MUST remain in-memory or in restricted IndexedDB contexts.
The authorization server MUST issue tokens with a `cnf.jkt` confirmation claim and verify that API requests provide fresh DPoP proofs corresponding strictly to the bound token thumbprint.
The authorization server MUST issue tokens with a `cnf.jkt` confirmation claim and verify that API requests provide fresh DPoP proofs corresponding strictly to the bound token thumbprint.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is Mandatory DPoP Proof-Key Binding for Passkey Conditional UI Sessions critical for AI coding assistants?
Enforces strict cryptographic binding between WebAuthn Passkey Conditional UI assertions and ephemeral, non-extractable client-side DPoP (RFC 9449) key pairs. Eliminates enterprise token theft, session hijacking, and adversary-in-the-middle (AiTM) proxying by ensuring access tokens cannot be issued as bearer tokens or replayed outside the initiating browser context. 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 (Issuing Unconstrained Bearer Tokens from Unbound Passkey Conditional Autofill Assertions) 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.