Skip to content

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

Merged
subhankarmaiti merged 7 commits into
mainfrom
feat/express_open_id_connect_mfa_evals
Aug 28, 2026
Merged

feat(evals): add express-openid-connect MFA step-up eval#244
subhankarmaiti merged 7 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: c65a2a51-3876-418e-b969-aaf98643fa25


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-oidc/graders.ts
Comment thread apps/auth0-evals/src/evals/mfa/express-oidc/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.

Done

@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
@sanchitmehtagit

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 0cf4b8f. I also followed up with 27e8b2e to clear the security scan on the merged branch.

@subhankarmaiti
subhankarmaiti merged commit 91fe2e3 into main Aug 28, 2026
6 checks passed
@subhankarmaiti
subhankarmaiti deleted the feat/express_open_id_connect_mfa_evals branch August 28, 2026 06:54
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.

3 participants