Skip to content

feat(mfa): MFA Leg 2 (tenant config: CLI)#83

Open
sanchitmehtagit wants to merge 4 commits into
plumbingfrom
mfa-legs
Open

feat(mfa): MFA Leg 2 (tenant config: CLI)#83
sanchitmehtagit wants to merge 4 commits into
plumbingfrom
mfa-legs

Conversation

@sanchitmehtagit

@sanchitmehtagit sanchitmehtagit commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Stacked on #82 (plumbing). Review/merge #82 first; this PR targets plumbing and will be retargeted to main once it lands. The diff shown here is MFA-only.

What this adds

Restructures MFA evals along two orthogonal axes, each measured independently. Tenant config is CLI-only — the Terraform axis was dropped from scope.

Leg 1 — client step-up (framework-specific)

react_mfa, vue_mfa, angular_mfa now test only the client step-up flow (amr claim via getIdTokenClaims, acr_values step-up, gating the transfer). Tenant-config graders + prompt lines removed; holistic judges reworded.

Leg 2 — tenant config (framework-agnostic), one standalone eval

Eval Method Graders
mfa_tenant_cli Auth0 CLI ranCommandOneOf (factor) + ranCommand('guardian/policies', ['all-applications']) + ranCommandsInOrder (factor before policy) + trace-aware holistic judge

Co-located mock routes

The guardian mock surface lives with its eval, not in the shared mocks/ dir: src/evals/mfa/tenant-cli/routes/ holds guardian.routes.json + fixtures/guardian/ + handlers.js. The dispatcher picks it up via the existing EVAL_MOCK_ROUTES_DIRS wiring — no engine change. This keeps the eval self-contained.

Shared CLI platform context (no scaffold)

mfa_tenant_cli declares no scaffold:. Because it ships a routes/ dir, the loader auto-attaches the shared src/evals/contexts/cli-platform/AGENTS.md (added on #82) — generic platform-engineer guidance with only the auth0 api <METHOD> <path> passthrough shape. The old per-feature scaffold (which embedded the exact guardian/policies/guardian/factors commands the graders check — letting an agent copy-paste the answer) is deleted. The eval now tests whether the agent knows the tenant flow. Platform context is guidance shared across all CLI evals, not per-eval starter code.

Removed

  • The mfa_tenant_terraform eval and the scaffolds/terraform/auth0 scaffold — CLI is the only tenant-config axis now.
  • Client scaffolds renamed vue/auth0vue/auth0-cli, angular/auth0angular/auth0-cli; old bundled auth0 scaffolds removed.

Why

Separating the axes de-confounds the signal (a failing client eval points at client code, not tenant config) and removes redundant grading of the same Guardian sequence across three frameworks. Co-locating the mock + auto-attaching the generic platform context makes each eval self-contained and stops the context from leaking graded commands.

Testing

npm run build, npm run lint, npm test pass. guardian-route.test.ts exercises the co-located manifest via EVAL_MOCK_ROUTES_DIRS (6/6 green). Discovery finds the client evals + mfa_tenant_cli.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cfebbc4-fc4e-45ba-9ce8-64eb3509458a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mfa-legs

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 force-pushed the mfa-legs branch 7 times, most recently from a85770d to 5e0efab Compare July 7, 2026 09:08
sanchitmehtagit and others added 2 commits July 7, 2026 14:51
…eg 2)

Restructures MFA evals along two orthogonal axes so each is measured
independently (builds on the plumbing branch).

Leg 1 — client step-up (framework-specific): react_mfa / vue_mfa / angular_mfa
now test ONLY the client step-up flow. The tenant-config graders and prompt
lines are removed; holistic judges reworded accordingly.

Leg 2 — tenant config (framework-agnostic), two standalone evals:
- mfa_tenant_cli — enable a Guardian factor then enforce via guardian/policies
  through the Auth0 CLI. Event graders (ranCommandOneOf / ranCommand /
  ranCommandsInOrder) + a trace-aware holistic judge (includeCommandTrace).
- mfa_tenant_terraform — declare an auth0_guardian resource in main.tf.
  matches / notContains / wroteFile + a file-based judge.

Mock: ships mocks/routes/guardian.sh — the Guardian API surface (factors +
policies) as a self-contained route file loaded by the plumbing dispatcher, with
read-after-write state namespaced mfa_*. Guardian route test included.

Scaffolds: rename vue/angular auth0 → auth0-cli (client scaffolds), add
cli/auth0 + terraform/auth0 platform-context scaffolds, remove the old bundled
react/vue/angular auth0 scaffolds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace shell guardian.sh route with declarative manifest (guardian.routes.json),
fixture (policies_set.json), and JS handlers (handlers.js). Parity gate passes:
all 6 guardian-route tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…affold

- Move the guardian surface (guardian.routes.json + fixtures/guardian/ +
  handlers.js) out of the shared apps/auth0-evals/mocks/ into the consuming
  eval's own dir: src/evals/mfa/tenant-cli/routes/. Picked up via the existing
  EVAL_MOCK_ROUTES_DIRS wiring — no engine/run.ts change. The eval is now
  self-contained.
- Delete the Terraform tenant-config eval (mfa/tenant-terraform) and the
  terraform scaffold — CLI is the only tenant-config axis now.
- Repoint mfa_tenant_cli at the shared generic scaffolds/cli/platform-context
  (no leaked commands) and delete the leaky per-feature scaffolds/cli/auth0.
- guardian-route.test.ts now sets EVAL_MOCK_ROUTES_DIRS to the co-located dir;
  fix stale mfa_tenant_terraform references in the client eval comments.

Note: committed with --no-verify — the repo's lint-staged pre-commit hook runs
`eslint --fix` on every staged .ts from the root, but only apps/auth0-evals has
an eslint config (packages/* have none), so the hook errors on the eval-core
test file. Pre-existing hook limitation; `npm run lint` (root) + prettier pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sanchitmehtagit sanchitmehtagit changed the title feat(mfa): MFA Leg 1 (client step-up) + Leg 2 (tenant config: CLI & Terraform) feat(mfa): MFA Leg 1 (client step-up) + Leg 2 (tenant config: CLI) Jul 8, 2026
…text

The mfa_tenant_cli eval no longer declares a scaffold. Its routes/ dir now
triggers auto-injection of the shared src/evals/contexts/cli-platform/AGENTS.md
(the platform context is guidance shared across all CLI-config evals, not
per-eval starter code). Removes the leaky per-feature scaffolds/cli/platform-context.

Depends on the loader convention landing on plumbing (#82); on rebase, the
routes/-triggered injection supplies the platform context.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sanchitmehtagit sanchitmehtagit changed the title feat(mfa): MFA Leg 1 (client step-up) + Leg 2 (tenant config: CLI) feat(mfa): MFA Leg 2 (tenant config: CLI) Jul 8, 2026
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.

1 participant