This episode takes 2FA to the enterprise level: making MFA mandatory for admin and billing roles, a gradual phase-in with 30-day notifications, per-tenant policies, and MFA's relationship with SOC 2, ISO 27001, and security questionnaires, plus auditing and reporting.

In a small app, 2FA is a per-user choice. At enterprise scale, 2FA becomes policy: what's mandatory, for whom, when it takes effect, and how it's proven to auditors. Episode 18 covers the organizational side that code tutorials rarely touch.
You'll design enforcement — making MFA mandatory for sensitive roles with a humane transition phase — then map its relationship with compliance frameworks like SOC 2 and ISO 27001, and close with the auditing and reporting that auditors and prospective clients ask for.
Enforcement doesn't have to apply to all users at once. Start with the highest-risk roles: admin, billing, and access to customer data. The policy is represented by a configurable role list:
mfa:
enforcedRoles:
- admin
- billing
- support_agent
gracePeriodDays: 30
tenantOverride: trueThe enforcedRoles configuration determines who's mandatory, while gracePeriodDays gives transition time. tenantOverride lets enterprise tenants set their own policy — a common pattern in multi-tenant products.
Enforcement also applies to non-interactive access: API keys, service-to-service tokens, and deployment pipelines can't scan a QR. For them, make sure there are alternatives like hardware keys or documented special rules — not a loophole that escapes policy.
Some organizations raise the enforcement level in stages: starting with requiring 2FA, then demanding TOTP plus passkey for the most critical roles, and finally hardware keys for production access. This staged approach gives the security team data about what actually works in the field before tightening the rules.
Sudden mandates produce a wave of support tickets and locked-out users. Design a transition phase: users in sensitive roles get a notification 30 days before the requirement becomes active, weekly reminders, and login blocking only on the last day of the grace period:
Day 0 first notification: MFA will be required
Day 7 email reminder
Day 21 last reminder + in-app banner
Day 30 MFA mandatory; login without MFA rejectedBlocking on day 30 emphasizes urgency, but can be surprising. A softer alternative: after the grace period, show a forced enrollment screen that can't be skipped — users can still log in, but only after completing the 2FA setup.
SOC 2 and ISO 27001 both expect layered access controls. In practice, auditors ask three things: is MFA mandatory for sensitive access, how is the policy enforced, and how is compliance verified. The configurable enforcement from the previous section answers all those questions with evidence.
Enterprise vendors send long documents full of security questions. Two questions are almost always present: "Do you implement MFA?" and "Is MFA mandatory for administrative access?". Answering with evidence — policy, effective dates, and adoption metrics — is far more convincing than claims without data.
Also prepare answers for follow-up questions: how is account recovery handled, are backup codes available, and how is MFA access auditing run. These follow-up questions are what separate shallow answers from mature ones.
Enterprise tenants have their own needs: some require hardware keys, some demand zero grace period. Build a policy hierarchy so global settings act as the default and tenants can override within an allowed range. The audit must track which policy applies to whom.
The 2FA audit is a source of compliance data. Record every event with enough context but without excessive PII:
mfa_enabled user=<uuid> tenant=acme at=2026-07-01T10:00:00Z
mfa_enforced user=<uuid> tenant=acme at=2026-07-15T09:30:00Z
mfa_failed user=<uuid> attempts=3 at=2026-07-15T09:31:00Z
mfa_disabled user=<uuid> actor=admin at=2026-07-20T14:00:00ZThese lines answer auditors' questions without leaking secrets. Store them in an immutable (append-only) audit system and set retention per policy.
Tie the MFA audit to sessions and IPs in a correlatable form, so a single incident can be sequenced from notification, login, to the 2FA change. This correlation is what security researchers look for when assessing an incident history.
Metrics to report: the percentage of active users with MFA, adoption per tenant, and the average time to complete enrollment within the grace period. These metrics aren't just dashboard material — they're compliance evidence requested in annual security reviews and tenders.
An example query producing per-tenant adoption numbers:
SELECT tenant_id,
COUNT(*) FILTER (WHERE totp_enabled) AS mfa_on,
COUNT(*) AS total
FROM users
GROUP BY tenant_id;Serve the results of this query in a schedulable report, so compliance numbers are always available without running a manual query ahead of an audit.
Episode 18 took 2FA to the organizational level: per-role enforcement with a 30-day phase, per-tenant policies, the relationship with SOC 2 and ISO 27001, and the audit and reporting that answer auditors and prospective clients.
The key takeaways:
In the next episode, episode 19, we will cover UX, accessibility, and copy-paste — a 6-digit input with autofocus and auto-submit, a 30-second countdown, clear error messages, ARIA labels, QR contrast, and a manual option for users without a camera.