Skip to content

feat(evals): add auth0 CLI B2B organization setup eval - #178

Draft
developerkunal wants to merge 2 commits into
mainfrom
eval/auth0-cli-b2b-org-setup
Draft

feat(evals): add auth0 CLI B2B organization setup eval#178
developerkunal wants to merge 2 commits into
mainfrom
eval/auth0-cli-b2b-org-setup

Conversation

@developerkunal

Copy link
Copy Markdown

Adds an auth0_cli_b2b_org_setup eval under a new cli category that measures how well agents configure a complete B2B (organizations) setup using only the auth0 CLI, against a tenant the CLI is already logged into. It complements the SDK-integration quickstarts with a pure tenant-configuration task.

The prompt is goal-only and names no command or flag, so the agent has to work out the CLI surface itself. It asks for a protected API with read:reports/write:reports/manage:members, two RBAC roles wired to those scopes, a Regular Web App and a Machine-to-Machine app, an M2M client grant between them, two organizations each with an enabled login connection, and an org-admin invitation, then a smoke-b2b-manifest.json capturing every created resource.

Grading combines event graders over the agent's successful command trace (ranCommand/ranCommandOneOf/wroteFile) with a trace-aware judge (includeCommandTrace: true) that reads the manifest and cross-checks it against the commands actually run. The client grant and org enabled-connections have no public CLI subcommand, so those steps are matched by their Management API endpoint (client-grants, enabled_connections) rather than a dedicated command. A dedicated L3 judge fails the run if any client secret leaks into the manifest or the trace. Structure mirrors the existing evals: ascending L3/L4/L5 graders and a final levelless holistic judge.

The eval also ships an optional harness.json and verify.js for a runner that provisions a live Auth0 tenant. Both are inert to the framework here (the loader reads only PROMPT.md and graders.ts, and tsc compiles only src/**/*.ts), so they do not affect build, lint, or discovery.

Test plan

  • tsc --noEmit passes for the auth0-evals app
  • eslint passes on the new graders.ts
  • prettier --check clean on all new files
  • Eval discovery finds auth0_cli_b2b_org_setup under category cli

Goal-only CLI eval that drives a full B2B organizations setup through the
auth0 CLI: a protected API with scopes, RBAC roles, a regular-web app and an
M2M app, an M2M client grant, two organizations each with an enabled
connection, and an org-admin invitation. Grading combines event graders over
the successful command trace with a trace-aware judge over the manifest the
agent writes.

Includes an optional harness.json and verify.js for runners that provision a
live tenant; both are inert to the framework loader and build.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: c7920199-ddf2-459b-8dd4-9cc395d79f98

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

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 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 live-tenant verify.js is a great addition — asserting the full B2B graph exists on the server (not just in the agent's manifest) closes a gap that the trace and file/judge graders can't cover on their own. The PROMPT/graders structure looks clean and follows the level conventions.

Just one small nit inline, and one non-blocking follow-up that's out of scope for this PR:

  • The ranCommandsInOrder primitive this eval relies on (already on main) passes vacuously if it's ever called with an empty steps array — worth a construction-time guard + test at some point, but nothing to change here.


// Management API list endpoints answer either a bare array or a wrapped object
// (e.g. { clients: [...] }) depending on pagination params. Normalize both.
function asList(res, key) {

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.

Nit / totally optional: asList is already nicely defensive, and since api() throws on both a non-zero exit and non-JSON output, it only ever sees valid parsed JSON here — so this is safe as-is. If you ever want to make a malformed response easier to debug, distinguishing "key present but not an array" from "resource genuinely empty" could help, but definitely not worth holding the PR for. Just flagging in case it's useful later. 🙂

Comment thread apps/auth0-evals/src/evals/cli/auth0-cli-b2b-org-setup/harness.json Outdated
Move the live-tenant declaration for the B2B org setup eval from a
colocated harness.json into PROMPT.md frontmatter (provision:
auth0-tenant), alongside the existing skills field. The runner reads the
frontmatter directly, so harness.json is removed and verify.js is
auto-detected from the eval directory.
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