Skip to content

feat: Add a docs eval for auth passwords - #538

Merged
jeremenichelli merged 2 commits into
mainfrom
jeremiasmenichelli/docs-1633-add-a-docs-eval-for
Nov 23, 2026
Merged

jeremenichelli merged 2 commits into
mainfrom
jeremiasmenichelli/docs-1633-add-a-docs-eval-for

Conversation

@jeremenichelli

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature: a new docs eval, build-docs-026-auth-passwords.

What is the current behavior?

Nothing scores the Password-based Auth guide. No existing eval signs people up and checks which passwords get in. Evidence cited in the ticket: supabase/agent-skills#627.

What is the new behavior?

An agent is asked to make the local project accept only passwords of at least 12 characters with a lowercase letter, an uppercase letter, a digit and a symbol, even for callers that skip the app. The scorer restarts the stack and signs people up directly through Auth. It checks that short passwords and passwords missing a kind of character are refused, and that compliant ones, including one of exactly 12 characters, get in.

Additional context

The guide doesn't carry the claim. It never mentions password strength, minimum length or character requirements, and doesn't link to /auth/password-security, where that lives. A solution written from the page alone fails both refusal checks. I expect a low baseline unless agents find the other page or already know the settings.

Leaked password protection (the subject of #627) is hosted-only and Pro-only, so it isn't scored.

The probes ran against a fake Auth server with 12 different policies, not a real stack, so the weak_password error code and the restart behavior are unverified. Needs the run-evals-changed label for the baseline.

@jeremenichelli
jeremenichelli requested a review from a team as a code owner November 20, 2026 14:31
@vercel

vercel Bot commented Nov 20, 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 Preview Nov 23, 2026 3:11pm UTC

Request Review

@czenko czenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The probe design holds up. Each refused password breaks exactly one rule, the 12-character boundary catches a memorized 8 or 10, passwords that meet the policy are accepted separates a policy from a wall, and refusals are confirmed against auth.users rather than inferred from the status code. With nothing changed, the workspace reds both refusal checks as the README predicts.

One note for the README:

  • An agent could turn off public sign-up (enable_signup = false) and send sign-ups through its own server code that checks the policy and then creates the user. Direct sign-ups would then return signup_disabled. a password shorter than 12 characters is refused and a password missing a kind of character is refused would report could-not-measure, and passwords that meet the policy are accepted would fail. That is unlikely with no app in the seed, but a line in "not scored" saying the policy has to live in Auth's settings would make that red read as intended.

As the PR says, the weak_password code and the restart still need a real run.

jeremenichelli added a commit that referenced this pull request Nov 23, 2026
## What is the current behavior?

Nothing scores the [Deploy database
migrations](https://supabase.com/docs/guides/deployment/database-migrations)
guide, and no existing eval covers it. `build-docs-015-cascade-deletes`
checks that a migration file was written, but it is about a different
page.

The page teaches the workflow in its walkthrough (`migration new`, add
the SQL, `migration up`). It does not say that a migration which has
already shipped must not be edited, or that a column added to a table
with rows needs a value for those rows. Related evidence, all in
supabase/agent-skills: #578 (preserve committed migrations, use forward
fixes), #519 (migration replay safety), #538 (repo naming conventions),
#599 (history repair). The last two are out of scope here and named as
such in the README.

## What is the new behavior?

The claim under test is that a schema change ships as a new migration
that applies cleanly.

An agent gets a bakery app with two migrations that `local/README.md`
says production has already applied. It is asked to add a standard or
express delivery option to every order, with existing orders reading
"standard". The prompt avoids the page's vocabulary, and the README
lists the stripped words.

The scorer runs nine checks:

| Check | What it proves | Reads |
| --- | --- | --- |
| Shipped migrations untouched | The two existing files are
byte-identical | files |
| Change is in a new migration that sorts after the existing ones | A
new file the CLI would run, not skipped or sorted earlier | files |
| Agent's local database has the option | The agent applied it locally,
read before the scorer touches anything | database |
| New migrations apply on top of a database that already has orders |
Rollout in a scratch database built from the seed's own two migrations
plus three orders | scratch database |
| Existing orders come out as standard | Backfill; requires exactly
`standard\|3` | scratch database |
| New order can be placed as standard or express | Both values work |
scratch database |
| Order saved without an option never has none | Refused (only by an
error naming the column) or defaulted | scratch database |
| Database rebuilt by `supabase db reset` has the option | What a
teammate gets after pulling | database |
| Guide read | A docs call returned the page's content | transcript |

The check that carries the claim is the rollout. Editing an old
migration and running `db reset` looks fine locally. In the scratch
database it fails, because production never re-runs a file it has
applied.

I expect the file checks and the local-database check to saturate. The
signal should be in the rollout and the checks behind it.

Supporting change: `evals/docs/lib/exec-sql.ts` gains an optional
`database` option so probes can run against the scratch database. The
name is validated (`^[a-z0-9_]+$`) because it reaches a shell command.
The default path is unchanged.

## Additional context by Claude

- **Not run end to end.** I had no Supabase CLI, API keys or Node 24
locally, so the agent run, `supabase db reset` and `create database`
against a real stack have not been exercised.
- The framework loads and plans the eval (`run-eval.ts --dry`), and
Biome and `tsc` report nothing on the new files.
- The probes and file checks ran on PGlite against a correct solution
and nine single-flaw solutions (edit in place, nullable column with no
backfill, `NOT NULL` with no default, a file sorting before the existing
ones, a direct alter with no file, a non-runnable filename, and others).
Each failed the checks I predicted beforehand. A broken rollout also
fails the three checks behind it with a `not run` note, by design.
- The shell path of `execSql` was checked with stub `supabase` and
`psql` binaries.
  - The example solutions are not committed.
- **Still to do:** add the `run-evals-changed` label for the baseline,
then record anything that broke in `flakiness.md` with this PR's number.
- **Known limits of the scratch database** (listed in the README):
migrations are applied with psql one file at a time rather than as the
CLI's batch, and it has no `auth` or `storage` schemas. The seed has no
table that needs them. The local-database and rebuild checks read the
real database for that reason.
- **Eval id.** I used `020` because 016, 018 and 019 are taken across
main and open PRs. #525 is titled for this page but contains the
"Securing your API" eval, and its id 018 collides with main's
`build-docs-018-redirect-urls`.
@jeremenichelli
jeremenichelli merged commit 0abd734 into main Nov 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants