Skip to content

Remove Anthropic key - #434

Merged
dcramer merged 1 commit into
mainfrom
dcramer-patch-1
Jul 20, 2026
Merged

dcramer merged 1 commit into
mainfrom
dcramer-patch-1

Conversation

@dcramer

@dcramer dcramer commented Jul 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@dcramer
dcramer enabled auto-merge (squash) July 20, 2026 18:36
@dcramer
dcramer merged commit 59d2b57 into main Jul 20, 2026
20 of 22 checks passed
@dcramer
dcramer deleted the dcramer-patch-1 branch July 20, 2026 18:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9640aca. Configure here.

Comment thread .github/workflows/warden.yml Resolved
Jeffreyhung added a commit that referenced this pull request Nov 4, 2026
The `evals` job fails before running anything on PRs that touch
`packages/evals/` (e.g. #562): `WARDEN_ANTHROPIC_API_KEY is required to
run evals in CI`. The workflow only wires the Anthropic secret. Warden's
own review workflow dropped that key in #434 and runs on
`WARDEN_OPENROUTER_API_KEY`, which resolves fine on the same PRs. The
evals harness was also hardcoded to Anthropic: suites skipped without
`ANTHROPIC_API_KEY`, and the judge called the Anthropic SDK directly.

## Changes

**Provider selection (`packages/evals/src/provider.ts`)**
- `WARDEN_EVAL_MODEL`: a Pi `provider/model` selector. When set, it
replaces every scenario's model, forces the Pi runtime, and enables the
suites without an Anthropic key.
- `WARDEN_EVAL_JUDGE_MODEL`: optional judge model. Defaults to
`WARDEN_EVAL_MODEL`, then `anthropic/claude-sonnet-4-6`.
- Credentials use the existing `WARDEN_<PROVIDER>_API_KEY` convention,
which eval setup already bridges to the SDK's env name.
- With neither variable set, behavior is unchanged: YAML models,
Anthropic key required.

**Judge**
- `runJudge` now goes through `getRuntime('pi').runAuxiliary` with the
configured model instead of `new Anthropic()`. Same prompt, same
verdict-count validation, same fail-closed fallback.
- Adds an `eval_judge` auxiliary task name so judge calls are labeled in
telemetry.
- `@anthropic-ai/sdk` is no longer a dependency of `warden-evals`.

**Workflow**
- `WARDEN_EVAL_MODEL` defaults to
`openrouter/anthropic/claude-sonnet-4.6`. That's the same model the
suites already pin, so scores stay comparable, on the OpenRouter key the
repo already has. The `WARDEN_EVAL_MODEL` / `WARDEN_EVAL_JUDGE_MODEL`
repo variables override it.
- Passes `WARDEN_OPENROUTER_API_KEY`, `WARDEN_ANTHROPIC_API_KEY`, and
`WARDEN_OPENAI_API_KEY`. Unset secrets are empty and harmless.
- "Verify eval credentials" checks the `WARDEN_<PROVIDER>_API_KEY` for
each selected model and names the missing one.
- "Create eval status check" only runs when verification passed. It used
to throw a second, misleading `Eval results file not found` on top of
the real error.

This PR touches `evals.yml`, so its own `evals` run exercises the
OpenRouter path end to end.

## Verification

- New `provider.test.ts` and `judge.test.ts`. `harness.test.ts` was
updated for the new judge options. The evals unit suite passes: 69
tests.
- `pnpm lint`, `pnpm build`, and typecheck all pass. The Warden
`src/sdk` tests pass.
- With no keys, `pnpm evals` skips all 62 evals, same as before.
- With `WARDEN_EVAL_MODEL=openrouter/anthropic/claude-sonnet-4.6` and a
fake key, the run reaches OpenRouter on Pi and fails with
`Authentication required.`. Without a key it fails locally with `No API
key found for openrouter`.
- I ran the verify step script locally for: valid key, missing key, a
judge on a different provider with a missing key, and a selector without
a provider.

## Notes

- Providers whose SDK env name doesn't follow `<PROVIDER>_API_KEY` (e.g.
`vercel-ai-gateway` → `AI_GATEWAY_API_KEY`) still work locally via the
SDK's own env name. In CI the verify step expects the `WARDEN_`-prefixed
form, so adding one means adding that secret to the workflow env.

<!-- junior-request-attribution:start -->
via **Jeffrey Hung**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0AH1TP6CHJ%3A1793816729.438159 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Jeffrey Hung <[email protected]>
Co-authored-by: Claude <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 9640aca6 Deployed Jul 20, 2026 by vercel[bot]
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