Repository navigation
ci(eval): keep judge credentials away from the agent under test - #4001
Conversation
The eval's agent can run shell commands, and until now it ran in a process that held the Claude credentials the judge uses, while the job uploaded full transcripts and logs to a public artifact that GitHub does not scrub. - The Agent UI backend now starts without the judge's credentials; only the `claude -p` driver keeps them. - The driver runs with no built-in tools (`--tools ""`). It only ever needed the agent UI's MCP tools, and it no longer has shell, file or web access. - The artifact is now scorecards and summaries only, kept 14 days, and a step refuses to upload any file containing a credential. Traces and logs stay on the runner; reproduce a regression locally to get them. - The eval CI guide's examples upload scorecards only and warn against giving the backend credentials.
Approve with suggestionsThis tightens the agent eval's blast radius in three sensible ways: the backend the agent runs in no longer inherits the judge's Claude credentials, the judge driver loses its shell/file/web tools, and the public artifact shrinks to scorecards with a pre-upload secret scan. The direction and the mechanics are right. The one thing worth fixing before merge: the PR says the artifact now "carries only scores," but the scorecard file that still ships contains every turn's user message and agent response — the same transcript content the dropped trace files held. So removing the traces didn't remove that data from the public download; it only removed a duplicate copy and the convenience of having it split per scenario. The literal-value scan is the real protection here, and it only catches the three named secrets spelled out verbatim. Either keep the traces (they cost nothing extra now) or strip the transcript fields from the copy that gets uploaded — and either way, reword the "reproduce locally to get the traces" note, which currently misleads. Everything else is minor: one line in the CI guide still tells readers to open a trace file to diagnose a CI regression, and the scan step prints an all-clear when it scanned zero files. I confirmed the Real-world evidenceNo
🔍 Technical details🟡 ImportantThe uploaded scorecard still contains full transcripts (
Consequences:
Pick one: keep 🟢 MinorSame doc now contradicts itself on traces ( Scan reports a clean bill after scanning nothing ( The scan list and the upload list are two copies ( Strengths
|
|
Right: the scorecard carried the whole conversation, so dropping 🔍 Technical details
|
Addresses review on amd#4001: dropping traces removed nothing, because scorecard.json carries the same conversation. The eval now writes scorecard.public.json (python -m gaia.eval.scorecard): every score and status kept, what the simulator and agent said, the judge's reasoning and raw CLI error text removed. Only that copy and summary.md upload; the full scorecard stays on the runner for the compare step. The credential scan warns when it scanned nothing instead of reporting a clean result, and its file list and the upload's point at each other. The CI guide's examples upload the public copy, and its regression section says traces stay on the machine that ran the eval.
Same fix as amd#4001's scan: zero files scanned is a warning, not a clean result, and the scan and upload lists point at each other.
…#4007) CI never ran the flagship GaiaAgent, and never checked whether its code changes work. The only agent eval is ChatAgent answering questions about documents, scored by an LLM's opinion. This adds a CI job that gives the flagship four real tasks: explain a file, fix a bug with a regression test, build a weekly CSV report, and add an env-var config option. Coding tasks are scored by what the finished project does; question tasks are decided by the judge against the points a correct answer must establish. Claude grades quality in one call, and the job fails on a missed expectation for passes, quality, honesty, tokens, steps or runtime. Every report puts main's committed results beside the current run. It runs on GAIA's embedded Lemonade, in the same report-by-default / `enforce` policy as the existing categories. The first run on current main already finds real problems. Kimi K2 passed all 4 tasks, but quality was 3.4/5: pytest was refused before it ran, stray `.bak` files were left behind, and one answer claimed "all tests pass" while admitting pytest never ran. <details> <summary>🔍 Technical details</summary> - **`gaia eval tasks run | judge | gate`** in `src/gaia/eval/flagship_tasks.py`. Tasks and the `core` (4) and `full` (8) suites live in `eval/tasks/tasks.json`; the fixture project is `eval/tasks/toybox`. - **Isolation.** Each task gets a fresh copy of the project in a temp dir, and the agent's `allowed_paths` is exactly that copy. `run` pops `CLAUDE_CODE_OAUTH_TOKEN` and `ANTHROPIC_API_KEY` from its own environment before the agent starts. In CI those credentials exist only in the judge step. - **Judge.** `claude -p --tools ""` in an empty temp directory, given the original project, the answer and the diff. A task with no usable grade is recorded as unjudged, and the gate fails its quality checks rather than skipping them. - **Gate.** Expectations live in `eval/tasks/expectations/<model>.<suite>.json`, tied to model, suite and judge model. The file holds main's measured results (overall and per task, with commit and runner) plus the limits. The report reads `Main | This run | Limit`. `--propose` writes that file from a run with headroom: one task may flip, quality may drop 0.5, tokens and steps may grow 35%, and runtime may grow 50%. Limits move only through a reviewed commit. No file is committed yet: the first runner run's artifact carries the proposal. - **Excluded tasks.** Six of the bench's 14 tasks are left out. Five need a GitHub token inside the agent's environment, and the shell-injection task relies on Unix shell behaviour that the Windows runner lacks. - **Workflow.** A new `flagship-tasks` job sits before `agent-eval`, so it doesn't overlap amd#4001's hunks. It adds a `task_suite` dispatch input and triggers on `eval/tasks/**`. The artifact is the scorecard plus proposed expectations, scanned for credentials, kept 14 days. Every `run:` body is pure ASCII. - **Local token counts.** Gemma under-reports tokens until amd#4005 lands. Capture expectations after it, or the token limits will be about 2-16x too low. </details> ## Test plan - [x] `pytest tests/unit/eval/test_flagship_tasks.py`: 67 pass (plus the opt-in live judge check, which passes: 10/10 verdicts in one call). Each coding task fails on the untouched project and passes a reference solution. Credentials never reach the agent. The judge gets no tools. Every gate metric can fail on its own. Report vs. enforce exit codes are covered. - [x] `pytest tests/unit/eval tests/unit/test_cli*.py tests/unit/test_eval*.py`: 725 pass. The 1 failure is the macOS `python`-not-on-PATH case (amd#3981), identical on main. - [x] End to end on Kimi K2 via Lemonade: `run` passed 4/4 in 190 s, `judge` graded all 4, `gate` without expectations reported and exited 0, and `--propose` followed by `gate --enforce` against that proposal exited 0. - [x] `pylint`, `black`, `isort`, `flake8` on the new code; `util/check_doc_links.py` passes; the workflow YAML parses and every `run:` body is ASCII. - [ ] First run on the Strix Halo runner (needs a same-repo branch, since fork PRs skip it). Check that the embedded Lemonade starts with `llamacpp:vulkan`, all 4 tasks run, and the artifact holds `scorecard.json` and `proposed-expectations.json`. - [ ] Commit that proposal as `eval/tasks/expectations/Gemma-4-E4B-it-GGUF.core.json` (after amd#4005) to switch the gate on. --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
The agent eval now keeps the Claude credentials in the one process that needs them. Its public artifact carries only scores. Before this change, the agent under test shared an environment with the judge's credentials, the judge had general-purpose tools it never used, and the job uploaded full transcripts and logs, which GitHub does not scrub the way it scrubs job logs. To triage a regression, rerun the same
gaia eval agent --categorycommand locally.🔍 Technical details
CLAUDE_CODE_OAUTH_TOKENandANTHROPIC_API_KEYremoved from its environment, and both are restored for theclaude -pdriver.--tools "", which drops built-in tools and keeps MCP. Verified locally with Claude Code 2.1.271: the driver still lists and calls all 15gaia-agent-uiMCP tools and has no Bash, Read, Write or WebFetch.test_eval_launch_contract.pypins the flag.eval-out/*/scorecard.jsonandsummary.mdonly, kept for 14 days. A step before upload scans those files for the three secret values and refuses to upload any file that contains one.docs/guides/eval-ci.mdxupload scorecards only, and a warning now covers the backend environment. The MCP launcher's comment no longer says its log is uploaded.Test plan
pytest tests/unit/test_eval_launch_contract.py tests/unit/eval: 541 pass. The 1 failure is the existing macOSpython-not-on-PATH case (fix(eval): eval gate loses all its tools where there is no barepythonon PATH #3981) and is identical on main.claude -p --tools "" --mcp-config <eval config>lists onlymcp__gaia-agent-ui__*tools and calls them.no credential found, and the artifact holds onlyscorecard.jsonandsummary.md.