Repository navigation
Conversation
In gRPC mode the server wrote every client resource (scenario JSON, rubric YAMLs, validator scripts, configs, env_files) to /tmp_sessions/<sid>/google3/..., while every agent CLI's HOME/cwd was /tmp_sessions/<sid>/fake_home. `ls ..` from the agent's cwd listed the step prompts, the rubric and the validator, and agents under test read them, inflating rubric-graded scores. Resources now go to a separate root, /var/lib/evalbench/sessions/<sid>/ (mode 0700), and /tmp_sessions/<sid>/ holds only the sandbox: - sessionmgr: SESSION_RESOURCES_PATH moves; SESSION_SANDBOX_PATH added for fake_home. Prune and the restart scan cover both roots. Prune uses rmtree, which does not follow symlinks (e.g. `gemini skills link`). - generators: use SESSION_SANDBOX_PATH instead of the literal. - agentevaluator: env_files are read from the resources root via the run config's session_id; a relative work_dir (resolved next to the dataset, i.e. inside the resources tree) is copied into the sandbox and the copy is used as cwd. - Dockerfile creates the root; docs and review checklist updated. All google3/ path rewriting already keys off SESSION_RESOURCES_PATH, so validators, scorers, skills and MCP configs follow the move with no client or config changes. Agents still run as root, so this closes the observed vector (walking up from cwd) rather than making the files unreadable; the 0700 is set now so a non-root follow-up only has to change who the CLI runs as.
silviojr
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
October 14, 2026 19:33
silviojr
marked this pull request as draft
October 14, 2026 21:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes b/571912956: Prevent AI coding agents under evaluation from discovering and reading the grading rubrics and test answer keys from their working directory.
The Situation: What Happened?
EvalBench tests and scores AI coding agents (such as Gemini CLI, Antigravity, and Claude Code) on complex multi-turn tasks. When a test run starts, the client sends over the test package:
The Problem: Agents Were "Reading the Answer Key"
Previously, EvalBench placed all of these files inside the same folder:
Because the agent's workspace (
fake_home) and the grading files were right next to each other, an agent simply exploring its environment or runningls ..could see all the test files, rubrics, and Python grading scripts.In actual benchmark runs, agents did exactly that: they read the grading rubric and validator code, saw the exact criteria the test was checking for, and tailored their responses to pass the evaluation.
This artificially inflated benchmark scores because the agent was effectively "cheating" by reading the answer key before finishing the exam.
The Fix: Separate the Answer Key from the Student's Desk
This PR completely separates the evaluation grading assets from the agent's working directory so an agent cannot reach the grading materials by looking around its workspace:
Move test assets out of the agent's path:
/var/lib/evalbench/sessions/<session_id>//tmp_sessions/<session_id>/fake_home/Because these are now in entirely different directory trees, an agent looking around its workspace or navigating up parent directories (
..) will never find the rubrics or grading scripts.Isolate starter files (
work_dir):If a test scenario provides starter code for the agent to work on, EvalBench now makes a copy of only that specific starter directory inside the agent's sandbox. The agent works on the copy and has no link back to the rest of the test package.
Session cleanup:
Updated the session manager to clean up both directories when a test run completes.
Changes Breakdown
evalbench/util/sessionmgr.py: PointsSESSION_RESOURCES_PATHto/var/lib/evalbench/sessions/and sets upSESSION_SANDBOX_PATHfor/tmp_sessions/. Ensures both paths are cleaned up when sessions are pruned.evalbench/evaluator/agentevaluator.py: Copies scenario starter code into the sandbox workspace so the agent never touches the parent resources tree.evalbench_service/Dockerfile: Pre-creates/var/lib/evalbench/sessions/in the container."/tmp_sessions"string for the shared constant.test/session_resources_test.pyandtest/agentevaluator_test.pyverifying directory separation, sandbox copying, and cleanup.Verification