Skip to content

feat(docs): add a multi-factor authentication guide eval - #559

Draft
czenko wants to merge 1 commit into
mainfrom
docs/mfa-guide-eval
Draft

czenko wants to merge 1 commit into
mainfrom
docs/mfa-guide-eval

Conversation

@czenko

@czenko czenko commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes DOCS-1663

Problem

Nothing measures whether the multi-factor authentication guide leads an agent to rules that lock data behind a second step. The page's opt-in rule reads auth.mfa_factors inside a policy. On a local stack, authenticated cannot read that table, so the rule refuses every request with 42501. Customers who copy it lock everyone out, and the ones who work around it often let a session that skipped the code through.

Evidence:

The ticket's claim was "a TOTP factor enrolls and verifies, and a policy requires aal2". That is the page's "enforce for all" case. The evidence and the confirmed gap are in the opt-in case, so the eval measures that.

No existing eval covers MFA. deploy-nav-004-require-two-factor is about dashboard team 2FA.

Sources reached: Linear, Slack, supabase/supabase, supabase/auth and supabase/cli issues, agent-skills issues. Not reached: Hex, Supacademy.

Changes

Adds build-docs-039-auth-mfa. A journaling app lets people turn on an authenticator-app code. Once it is on, their rows stay locked after a password sign-in until they type a code, on every device. People without a code keep using the app with a password. The seed has two tables, each with a permissive owner policy, and the CLI default config.toml.

The scorer restarts the stack and checks whether the agent's config lets a person set up a code. If it does not, the scorer turns codes on and restarts, so one config line costs one check. It then signs people up, sets up and types codes itself, and probes both tables at each level.

Checks:

  • The local stack restarts on the project settings, and the agent applied the migrations it wrote.
  • The project lets people turn on an authenticator-app code.
  • Someone without a code reads, adds, changes and removes journal rows with a password.
  • Someone who gave up setting up a code reads their journal with a password.
  • A person with a code who has not typed it cannot read their journal, and cannot add, change or remove anything.
  • A device signed in before the code was turned on is locked once it is on.
  • A person who typed their code reads, adds, changes and removes journal rows.
  • The agent read the multi-factor authentication guide.

Expected signal: The page's opt-in rule as written fails the no-code checks, the halfway check and the typed-code checks, because every request gets 42501. A permissive rule fails the skipped-code refusals.

What part of the guide this tests:

Guide section Tested How
Enforce only for users that have opted in Yes Every behavioral probe
Enforce for all users Indirectly It fails, because the prompt asks for opt-in
Enforce for new users only No The prompt does not ask for it
Enrollment and challenge, from the TOTP page Yes The scorer runs them
Turning codes on Yes The gate check reads the agent's config
Unenrolling, phone codes, server-side rendering No Out of scope

Verification

  • pnpm exec biome check evals/docs/build-docs-039-auth-mfa passes.
  • pnpm --filter @supabase-evals/framework typecheck passes.
  • pnpm eval:dry -- --suite docs --eval build-docs-039-auth-mfa plans one pair on codex-gpt-6-luna-no-skills.
  • Baseline: three runs of codex-gpt-6-luna-no-skills in the run-evals-changed run. All three passed all twelve checks, including the guide read. A full-marks pass does not show the page carried the run, since a model that knows restrictive policies produces the same result. Braintrust run.

For new or changed evals (see Submitting evals for review):

  • Ran the eval locally, and it completes without framework errors.
  • Ran it in CI with the run-evals-changed label or the Refresh eval results workflow (suite: regression for framework changes), and linked the Braintrust run here.

@czenko czenko added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Nov 25, 2026 8:19pm UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant