account-security

Account security - MFA, sessions, recovery. Use when protecting user accounts.

⭐4stars🔀3forks📁View on GitHub🕐Updated Jan 8, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill provides a comprehensive framework for implementing robust account security measures, including Multi-Factor Authentication (MFA), session management, and secure recovery flows. Designed for modern web stacks using Next.js and Better Auth, it establishes a single source of truth for security policies, ensuring high-level protection through strict non-negotiables like step-up re-authentication, session scoping, and auditable security events.

Use Cases

  • Implementing mandatory Multi-Factor Authentication (MFA) for administrative and super-admin roles to prevent unauthorized access to sensitive systems.
  • Setting up secure session management that allows users to monitor active devices and revoke sessions to mitigate account hijacking risks.
  • Designing 'step-up' re-authentication triggers (password or OTP) for high-risk actions such as changing security settings or accessing private data.
  • Developing secure account recovery workflows that utilize multi-layered verification to prevent social engineering and unauthorized account takeovers.
  • Establishing auditable server-side enforcement for all security-sensitive actions to maintain compliance and track potential breaches.
nameaccount-security
descriptionAccount security - MFA, sessions, recovery. Use when protecting user accounts.

Account Security Guideline

Tech Stack

  • Auth: Better Auth
  • Framework: Next.js (with Turbopack)
  • Database: Neon (Postgres)

Non-Negotiables

  • MFA required for admin/super_admin roles
  • Sensitive actions require step-up re-authentication (password or email OTP)
  • Verified session state must be scoped, time-bound, never implicitly reused
  • Session/device visibility and revocation must exist
  • All security-sensitive actions must be server-enforced and auditable
  • Account recovery must require step-up verification

Context

Account security handles how users manage sessions — visibility, revocation, step-up verification, MFA. Sign-in and SSO live in auth.

This is the SSOT for MFA policy. Admin and other privileged roles reference this.

Driving Questions

  • Can users see all active sessions and revoke them?
  • Is re-authentication required for all sensitive actions?
  • What happens when an account is compromised?
  • How does the recovery flow prevent social engineering?
  • What security events trigger user notification?