Skip to content

feat(evals): add SMS/email MFA CLI graders and notRanCommand primitive - #247

Merged
sanchitmehtagit merged 2 commits into
mainfrom
feat/hallucination_cli_mfa_graders
Aug 27, 2026
Merged

feat(evals): add SMS/email MFA CLI graders and notRanCommand primitive#247
sanchitmehtagit merged 2 commits into
mainfrom
feat/hallucination_cli_mfa_graders

Conversation

@sanchitmehtagit

Copy link
Copy Markdown
Contributor

Summary

  • Adds notRanCommand grader primitive (L2/hallucination) to @a0/evals-graders — the inverse of ranCommand, typed with NotRanCommandLevel = GraderLevel.L2 so it cannot be misused for structural grading
  • Extends mfa_cli PROMPT.md to explicitly ask agents to set up both the SMS phone factor and the email factor via the Auth0 CLI
  • Replaces the old broad ranCommandsInOrder (any-factor → policies) with per-factor ordering checks (SMS → policies, email → policies) and adds graders for guardian/factors/phone/message-types and guardian/factors/email
  • Fixes the Hallucination scoring gap for CLI evals: previously no L2 graders existed so scoreFromGraders always returned 100; now notRanCommand produces a real signal

Test plan

  • npm run build passes (evals-graders + evals packages)
  • npm test passes — 721 tests across 17 test files in packages/evals, 70 tests in packages/evals-graders
  • notRanCommand('guardian/factors/otp', ...) fails a run where the agent calls OTP instead of SMS
  • Hallucination dimension shows a real score (not 100 fallback) for mfa_cli runs

Extends the mfa_cli eval to cover the full SMS phone factor setup flow
(enable + message-types) and email factor setup, with precise ordering
checks that both factors precede the guardian/policies enforcement call.

Adds notRanCommand (L2/hallucination) as a new grader primitive — the
inverse of ranCommand — so CLI evals can score the Hallucination
dimension against the command trace rather than always returning 100
due to no L2 graders being present.
@coderabbitai

coderabbitai Bot commented Aug 27, 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: c8e0ac90-e1d2-400b-83b8-94b5ebe7c94b


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.

export type EventGraderLevel = GraderLevel.L4 | GraderLevel.L5;

/** Level valid for notRanCommand — a hallucination (L2) check on the command trace. */
export type NotRanCommandLevel = GraderLevel.L2;

@kailash-b kailash-b Aug 27, 2026

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.

New type has no tests in packages/evals-graders/tests/primitives.test.ts

@sanchitmehtagit sanchitmehtagit Aug 27, 2026

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.

added 6 notRanCommand tests to primitives.test.ts covering happy path, forbidden command match, errored-call exclusion, empty trace, and name generation in 6c9e879.


// ── L4: Enable the SMS factor ─────────────────────────────────────────
ranCommandOneOf(
['guardian/factors/otp', 'guardian/factors/push', 'guardian/factors/sms'],

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.

The existing grader conflicts the newly added one.
Can we remove the guardian/factors/otp entry from here?

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.

Good catch, i will remove this grader itself

@sanchitmehtagit sanchitmehtagit Aug 27, 2026

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.

removed ranCommandOneOf entirely - the ranCommandsInOrder checks already verify SMS was called before the policy, so the conflicting OTP entry is gone in 6c9e879.

subhankarmaiti
subhankarmaiti previously approved these changes Aug 27, 2026
Remove ranCommandOneOf from mfa_cli graders — it conflicted with the
notRanCommand(otp) L2 grader. The ranCommandsInOrder checks already
verify SMS was called before the policy.

Add notRanCommand tests to primitives.test.ts covering happy path,
forbidden command match, errored-call exclusion, empty trace, and name
generation.
@sanchitmehtagit
sanchitmehtagit merged commit 341131a into main Aug 27, 2026
6 checks passed
@sanchitmehtagit
sanchitmehtagit deleted the feat/hallucination_cli_mfa_graders branch August 27, 2026 12:16
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