Skip to content

feat(evals): add express-openid-connect MFA step-up eval - #244

Open
sanchitmehtagit wants to merge 2 commits into
mainfrom
feat/express_open_id_connect_mfa_evals
Open

feat(evals): add express-openid-connect MFA step-up eval#244
sanchitmehtagit wants to merge 2 commits into
mainfrom
feat/express_open_id_connect_mfa_evals

Conversation

@sanchitmehtagit

@sanchitmehtagit sanchitmehtagit commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Adds an eval that measures whether an LLM agent can correctly implement MFA step-up in an Express app using express-openid-connect.

The task prompts the agent to protect a /transfer route: check the amr claim from req.oidc.idTokenClaims, redirect to Auth0 via res.oidc.login() with acr_values when MFA is absent, and verify MFA completion server-side after the step-up redirect. The eval ships with a matching scaffold - a minimal Express app with Auth0 login already wired - so agents start from a realistic base rather than a blank file.

Graders cover L1-L5:

  • L1: required symbols (acr_values, amr, idTokenClaims, oidc.login, authorizationParams)
  • L2: hallucinated libraries and SPA patterns absent (speakeasy, otplib, loginWithRedirect, etc.)
  • L3: no hardcoded secrets in source; amr/acr read from server-side verified claims only
  • L4: project compiles; behavioral correctness of the step-up flow (detect MFA absence, trigger login, verify on return)
  • L5: uses req.oidc.idTokenClaims rather than req.oidc.user (which is filtered and may omit amr/acr)

References

Testing

  • npm run build && npm test passes.

  • Eval can be run manually with npm run evals -- --eval express_oidc_mfa --mode agent.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

Adds eval and scaffold for MFA step-up using express-openid-connect.
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3535c61a-435e-4680-a71c-6876ab25986d


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sanchitmehtagit
sanchitmehtagit marked this pull request as ready for review August 26, 2026 08:23

@subhankarmaiti subhankarmaiti 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.

Nice eval, the step-up flow is the right thing to be measuring here and the scaffold runs cleanly (npm start listens, node --check passes, express-openid-connect resolves to 2.20.2). A few things on the graders before merge, mainly around signal strength.

Comment thread apps/auth0-evals/src/evals/mfa/express-openid-connect/graders.ts Outdated
Comment thread apps/auth0-evals/src/evals/mfa/express-openid-connect/graders.ts
Comment thread apps/auth0-evals/src/evals/mfa/express-openid-connect/graders.ts
Comment thread apps/auth0-evals/src/evals/scaffolds/express-oidc/auth0/server.js Outdated
---
id: express_oidc_mfa
name: Express OpenID Connect MFA Step-Up
scaffold: src/evals/scaffolds/express-oidc/auth0

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.

Tiny nit, non-blocking. All 13 other scaffold-using evals name the eval dir the same as its scaffold dir, so express-oidc for both would keep that consistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keeping the current approach. The eval id is already express_oidc_mfa which matches the scaffold name, and the dir name doesn't affect eval discovery.

Addressing PR Feedback decision

Approach

  • Keep current (recommended)
    Cosmetic-only; eval ID is already express_oidc_mfa
  • ⬜ Rename to express-oidc
    For consistency

Reply

  • ✅ Post (auto)
  • ⬜ Skip (reply manually)
  • ⬜ Other

@subhankarmaiti

Copy link
Copy Markdown
Contributor

The "Available evals" table in apps/auth0-evals/README.md is exhaustive (28 rows for 28 evals) and the last five eval-adding PRs all updated it. Can we add an express_oidc_mfa row so it stays in sync?

- Drop `authorizationParams` L1 grader that passes on unmodified scaffold
- Add `wroteFile('.env', ...)` L4 grader to verify .env creation
- Add `amr`/`acr` to `identityClaimFilter` in scaffold so L5 judge premise holds
- Trim scaffold comment to remove task hint
- Add `express_oidc_mfa` row to README Available evals table
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