Security UX Pattern Library

April 14, 2026 ยท View on GitHub

Reviewed by PatchPilots

Live site: uxsec.dev โ€” 36 interactive patterns for designing secure user experiences.

Interactive patterns for designing secure user experiences.

$ ls ./patterns

๐Ÿ”’ auth/ (8)
   login_flow ............ OWASP A07, CWE-307
   multi_factor_auth ..... OWASP A07, CWE-308
   password_strength ..... OWASP A07, CWE-521
   session_timeout ....... OWASP A07, CWE-613
   account_recovery ...... OWASP A07, CWE-640
   passkeys .............. WebAuthn, FIDO2
   oauth_consent ......... OAuth 2.0, CWE-250
   accessible_auth ....... WCAG 2.2, SC 3.3.8

๐Ÿ”’ threat/ (3)
   breach_notification ... GDPR Art. 33/34, CWE-200
   phishing_warning ...... OWASP A07, CWE-601
   suspicious_activity ... OWASP A07, CWE-778

โš  dark_patterns/ (6)
   confirmshaming ........ EU DSA, Deceptive Design
   cookie_consent ........ GDPR Art. 7, ePrivacy
   hidden_unsubscribe .... GDPR Art. 17, Right to Erasure
   privacy_zuckering ..... GDPR Art. 5, Data Minimization
   bait_and_switch ....... FTC Act Section 5
   forced_continuity ..... FTC Negative Option Rule

๐Ÿ” data/ (4)
   encryption_indicators . OWASP A02, CWE-311
   secure_file_upload .... OWASP A03, CWE-434
   data_deletion ......... GDPR Art. 17, CWE-212
   activity_log .......... GDPR Art. 15, CWE-778

๐Ÿ›ก owasp/ (3)
   A01_access_control .... CWE-284, CWE-639
   A05_misconfiguration .. CWE-16, CWE-209
   A09_logging ........... CWE-778, CWE-223

๐Ÿค– ai/ (5)
   ai_disclosure ......... EU AI Act Art. 50
   content_labeling ...... EU AI Act Art. 50, C2PA
   decision_explanation .. GDPR Art. 22
   input_safety .......... OWASP LLM01, CWE-77
   human_override ........ EU AI Act Art. 14

๐Ÿญ industrial/ (4)
   operator_auth ......... IEC 62443
   safety_critical ....... IEC 61511
   alarm_fatigue ......... ISA-18.2, EEMUA 191
   navigation_levels ..... ISA-101

๐Ÿ“‹ governance/ (3)
   security_design_review  IEC 62443, ISO 27001
   change_management ..... IEC 62443, ITIL
   compliance_audit ...... NIS2, DORA, GDPR

$ get --score
๐Ÿ›ก Security UX Score: rate your app โ†’ A+ through F
$ get --compliance
๐Ÿ“‹ Compliance Mapper: 19 regulations including NIS2 + DORA + WCAG 2.2 + EU AI Act + ISO 42001 + EAA + IEC 62443
$ get --maturity
๐Ÿ“Š Maturity Model: assess your security UX โ†’ Level 1-4
$ get --report
๐Ÿ“„ Report Generator: 6 questions โ†’ exportable .md report
$ get --convince
๐ŸŽฏ Convince Your Team: enforcement data + ROI arguments for stakeholders
$ live --ripple
๐ŸŒŠ Ripple: paste a headline โ†’ structured analysis prompt through 3 lenses
$โ–ˆ

Gathered from 20 years of experience in safety-critical industries โ€” energy, maritime, drilling operations โ€” and a double M.Sc. in Cyber Security and Information Systems. The patterns comply to any domain.

36 Interactive Patterns + 5 Strategic Tools + 2 Operational CLI Tools

The most comprehensive interactive security UX pattern library. Each pattern has a live demo, do/don't guidelines, security rationale with OWASP/CWE/GDPR references, and accessibility notes.

Strategic Tools

ToolWhat it does
RipplePaste any headline โ†’ structured analysis prompt through 3 lenses: UX & Design Systems, Security & Compliance, AI & Emerging Risk. Powered by all 36 patterns.
Security UX ScoreChecklist across 8 categories โ†’ A+ through F grade. Industrial & Governance can be marked N/A for fair scoring.
Compliance MapperSelect from 19 regulations (GDPR, NIS2, DORA, CRA, EU AI Act, ISO 42001, EAA, IEC 62443...) โ†’ see which patterns you need
Maturity Model10-question assessment โ†’ current level, priority areas, roadmap to next level
Report GeneratorAnswer 6 questions โ†’ downloadable .md report with prioritized patterns
Convince Your TeamEnforcement data, ROI arguments, regulatory deadlines, and next steps โ€” designed to share with stakeholders

Authentication (8)

PatternWhat it covers
Login FlowRate limiting, social login, MFA challenge, remember me, success flow
Multi-Factor AuthTOTP/SMS/backup codes, paste support, progressive cooldown
Password StrengthReal-time meter, breach detection, confirm field, show/hide
Session TimeoutCountdown warning, auto-save, graceful expiry
Account RecoverySecure reset flow, one-time tokens, anti-enumeration
Passkeys / WebAuthnCreate passkey, sign in (0.8s, phishing-proof), manage across devices
OAuth ConsentOver-permissioned vs least privilege, granular control, explained permissions
Accessible AuthenticationCAPTCHA alternatives (passkey, magic link), screen reader MFA, timed actions with announcements (WCAG 2.2 SC 3.3.8)

Threat Response (3)

PatternWhat it covers
Breach NotificationIn-app banner, full-page with timeline, email with GDPR refs (3 variants)
Phishing WarningBlocked page, email annotations, link safety preview (3 variants)
Suspicious ActivitySign-in alerts, session management, new device approval (3 variants)

Dark Patterns โ€” Anti-Patterns (6)

Each shows the manipulative version side-by-side with the ethical alternative.

PatternWhat's wrongEthical alternative
ConfirmshamingGuilt-trip dismiss buttonsNeutral language with 3 options
Cookie Consent"Accept All" manipulationEqually prominent Accept/Reject
Hidden Unsubscribe4-step deletion maze2-step with data export
Privacy ZuckeringPre-enabled permissionsOpt-in with per-permission explanations
Bait & SwitchX button enables featuresX means close, always
Forced ContinuityFree trial auto-charge trapNo-card trial, pre-expiry reminder

Data Protection (4)

PatternWhat it covers
Encryption IndicatorsE2E messaging, connection security, at-rest dashboard (3 variants)
Secure File UploadFile type blocking, malware scanning, encryption status
Data DeletionGDPR-compliant deletion with export, confirmation, grace period
Activity & Audit LogAccount activity, active devices with session revoke, data access log (GDPR Art. 15)

OWASP Top 10 (3)

PatternWhat it covers
A01 Broken Access ControlRole-based UI, IDOR prevention, privilege escalation blocking
A05 Security MisconfigurationSecurity headers dashboard, debug mode, default credentials
A09 Logging & MonitoringLive event log, anomaly detection, per-user audit trails

AI Transparency (3) โ€” EU AI Act (August 2026)

PatternWhat it covers
AI Interaction DisclosureChatbot as human (non-compliant) vs labeled AI assistant
AI Content LabelingSocial feed labels, article transparency, image authenticity (C2PA)
AI Decision ExplanationLoan decisions, content moderation, hiring AI with human appeal

Industrial Security UX (4)

PatternWhat it covers
Operator AuthenticationBadge + PIN for gloves, adaptive biometrics, emergency override
Safety-Critical ConfirmationHold-to-confirm shutdown, graduated overrides, parameter ranges
Alarm Fatigue ManagementAlarm flood vs smart grouping, root cause, shelving (ISA-18.2)
Navigation & Levels of DetailISA-101 4-level HMI hierarchy โ€” plant overview to diagnostic detail

Governance (3)

PatternWhat it covers
Security Design ReviewChecklist with critical/non-critical items, approval workflow
Change ManagementPropose โ†’ Review โ†’ Approve โ†’ Rollout โ†’ Rollback with impact assessment
Compliance Audit WorkflowScope regulations โ†’ Assess requirements โ†’ Collect evidence โ†’ Gap analysis report

Recent Enforcement

CompanyFineReason
Amazon$30MManipulative subscription design
Epic Games$245MDeceptive in-game purchases
TikTokโ‚ฌ345MPublic-by-default dark pattern
Metaโ‚ฌ1.2BGDPR data transfer violations

Run locally

git clone https://github.com/alavesa/security-UX-pattern-library.git
cd security-UX-pattern-library
npm install
npm run dev

Adding a new pattern

Each pattern is a single React component. Follow these steps:

1. Create the component

src/patterns/<category>/MyPattern.tsx

Use the standard structure:

import { PatternHeader } from "../../components/PatternHeader";
import { DemoContainer } from "../../components/DemoContainer";
import { GuidelineSection } from "../../components/GuidelineSection";

function MyPatternDemo() {
  // Interactive demo with inline styles using CSS variables
  // Use category color for tabs/accents (see color system below)
  return <div>...</div>;
}

export function MyPattern() {
  return (
    <div>
      <PatternHeader
        title="My Pattern"
        description="What this pattern demonstrates"
        severity="high"          // critical | high | medium
        tags={["Category", "OWASP A01", "CWE-XXX"]}
      />
      <DemoContainer label="my pattern (N variants)">
        <MyPatternDemo />
      </DemoContainer>
      <GuidelineSection
        dos={["Do this", "And this"]}
        donts={["Don't do this"]}
        securityRationale="Why this matters..."
        accessibilityNotes={["a11y consideration"]}
      />
    </div>
  );
}

2. Wire it up โ€” add to these files:

  • src/App.tsx โ€” add a <Route>
  • src/layouts/Layout.tsx โ€” add to sidebar navigation
  • src/pages/HomePage.tsx โ€” add to terminal listing + pattern cards
  • src/data/patterns.ts โ€” add metadata
  • src/pages/CompliancePage.tsx โ€” map to relevant regulations
  • src/pages/ScorePage.tsx โ€” add a scoring item if applicable

3. Styling rules โ€” critical for the hacker terminal aesthetic:

  • All colors via inline style={{ }} with CSS variables โ€” no Tailwind color classes
  • Use font-mono on all text
  • Cards: background: "var(--bg-card)", border: "1px solid var(--border)"
  • Inputs: background: "var(--bg)", color: "var(--text-bright)"
  • Primary buttons: background: "var(--green)" (or your category color)
  • Text: var(--text-bright) headings, var(--text) body, var(--text-dim) metadata
  • Icons: always set explicit color โ€” don't rely on inheritance
  • Test on mobile โ€” add flex-wrap, break-words, min-w-0 where needed

Tech stack

  • React + TypeScript + Vite
  • Tailwind CSS (layout only) + CSS custom properties (colors) + Lucide Icons + React Router
  • Built with Claude Code by Anthropic

Design

Hacker terminal aesthetic โ€” black background, green glow, JetBrains Mono, scanlines, Matrix rain with katakana. Every interactive demo uses CSS custom properties for consistent dark theming โ€” no Tailwind color classes in demo components.

Category color system:

CategoryColorCSS VariableHex
Auth & ThreatGreen--green#00ff41
Dark PatternsRed--red#ff3333
Data ProtectionCyan--cyan#00e5ff
OWASP Top 10Amber--amber#ffaa00
AI TransparencyPurple--ai-color#c084fc
IndustrialOrange--industrial-color#f97316
GovernanceGray--governance-color#cccccc

Each color has --*-glow (15% opacity background) and --*-border (25% opacity border) variants for consistent tinted containers. Semantic colors (red for errors, green for success, amber for warnings) are used across all categories regardless of accent color.

Sources (46)

EU Regulation: GDPR, NIS2, DORA, CRA, EU AI Act, EU DSA, ePrivacy, EU Consumer Rights Directive, European Accessibility Act (EAA)

Standards & Compliance: OWASP, CWE, NIST SP 800-63B, NIST CSF, NIST SP 800-30, WCAG 2.2 (SC 3.3.8 Accessible Auth), ISO 27001, ISO 27005, ISO/IEC 42001, SOC 2, PCI DSS 4.0, WebAuthn/FIDO2, OAuth 2.0, CCPA, FTC, C2PA, AI Transparency Code, IAB Framework, US State AI Laws, Illinois AI Act, CMMI, OWASP SAMM, OWASP Risk Rating

Industrial: IEC 62443, IEC 61511, ISA-18.2, ISA-101, EEMUA 191

Research: Verizon DBIR, IBM Breach Report, Microsoft MFA Study, USEC 2026, Deceptive Design, Dark Patterns Enforcement, RFC 6238

Author

Piia Alavesa โ€” Senior UX Design Leader

  • M.Sc. Cyber Security (University of Jyvรคskylรค)
  • M.Sc. Information Systems (University of Oulu)
  • 20 years building design organisations for complex industrial systems
  • neversay.no | LinkedIn

Roadmap

Ripple โ€” live intelligence tool

  • Phase 1: Prompt generator โ€” paste a headline, get a structured prompt with all 36 patterns as context, copy into Claude or ChatGPT (shipped)
  • Phase 2: Claude API integration โ€” inline analysis via a thin proxy (Cloudflare Worker), no user API keys needed. Three-lens results rendered directly on the page with pattern links.
  • Phase 3: Adaptive lenses โ€” LLM picks the most relevant third lens per headline instead of fixed three. Could surface supply chain risk, industrial safety, dark patterns, or AI governance depending on context.
  • Related patterns from LLM output โ€” parse the API response for pattern URLs and replace keyword matching with LLM-referenced patterns
  • Weekly digest โ€” subscribe to a topic (e.g., "NIS2 updates") and receive a weekly Ripple analysis email

Accessibility & reach

  • Add <noscript> fallback content โ€” terminal-styled static HTML fallback for NoScript users. Shows site description, pattern count, tool list, and GitHub link. "No tracking. No cookies. No analytics." (shipped)

Patterns to add

  • More OWASP Top 10 coverage (currently A01, A05, A09)
  • API security UX patterns

Site improvements

  • Offline/PWA support for use without network

License

MIT