Skip to content

feat(traces): superadmin evaluation via a promoted evaluator account#36

Merged
albanm merged 8 commits into
mainfrom
feat-adminmode-evaluator
Jun 19, 2026
Merged

feat(traces): superadmin evaluation via a promoted evaluator account#36
albanm merged 8 commits into
mainfrom
feat-adminmode-evaluator

Conversation

@albanm

@albanm albanm commented Jun 19, 2026

Copy link
Copy Markdown
Member

Let admin-mode superadmins evaluate any account's traces using a configured source account's evaluator, so the reviewed account is never charged.

What changed:

  • resolveUsageIdentity now treats an adminMode superadmin as an admin of whatever account a gateway/summary call targets, so they may consume it. That account's quotas still apply and its usage is still recorded (under the superadmin's id) — no skip-billing.
  • New config.evaluatorAccount ({type,id}, env EVALUATOR_ACCOUNT_TYPE/EVALUATOR_ACCOUNT_ID, default off) designates the source account. Admin /info advertises it plus evaluatorAvailable (true only when that account has both an assistant and an evaluator model — the gateway refuses any account without an assistant).
  • The superadmin trace-review UI points EvaluatorChat (and its summarizer tool) at the source account, so the reviewed account is never called; the chat is disabled with a hint when the source is unset/unconfigured or admin mode is off. The non-admin account-admin review path is unchanged.

Why: superadmins need to review traces across accounts without consuming the reviewed account's tokens.

Heads-up:

  • This broadens authorization: an adminMode superadmin can now consume any account's gateway/summary as admin (not just the evaluator). adminMode is JWT-validated and only true for genuine superadmins.
  • The source account is billed like a normal session — point config.evaluatorAccount at a dedicated, fully-configured account; don't add admin to its moderation categories or superadmin review messages would be moderated.

albanm and others added 7 commits June 19, 2026 17:10
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…uator

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ount

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gateway refuses any account without an assistant model, so a source
account with only an evaluator model advertised availability while every
evaluator call 404'd. evaluatorAvailable now requires both models, the e2e
asserts a real evaluator tool response (not just request dispatch), and a
new api case locks the evaluator-only-no-assistant contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ation

clean() only wipes settings with owner.id matching /^test/, so seeding the
source account at user/superadmin leaked state across runs and made the
admin-info availability test history-dependent. Point the dev evaluatorAccount
(and the tests) at organization/test1, which clean() resets between runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	api/config/custom-environment-variables.js
#	api/config/default.js
#	api/config/type/.type/index.d.ts
#	api/config/type/.type/validate.js
#	api/config/type/schema.json
#	api/src/admin/router.ts
#	ui/src/components/TraceReview.vue
@albanm albanm merged commit 61ff6f0 into main Jun 19, 2026
2 checks passed
@albanm albanm deleted the feat-adminmode-evaluator branch June 19, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant