Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(tier3): make native NeMo Gym Claude Code runs reach the policy model and discover skills (#581)
Christopher Kevind0113bd23d57
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3168df43..3396a621 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -301,6 +301,10 @@ All notable changes to SkillEvaluator are documented in this file.generated `evals/evals.json` datasets accept the surrogate-escaped namePython gives such a file. The SARIF `artifactLocation.uri` percent-encodesthe name's original bytes (`caf%E9.md`).+- Native NeMo Gym Claude Code runs now bind the selected policy model server,+ supply its placeholder credential, pin the sandbox runtime and enable project+ skill discovery in both arms, including when Gym uses a private Claude+ configuration directory.- SARIF `artifactLocation.uri` values stay valid for more paths. Arepository-relative path whose first segment contains a colon, such as`notes:v2.md`, gets a `./` prefix so it no longer reads as a URI scheme. Adiff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdxindex f24d0915..7dec30eb 100644--- a/docs/tier3-live-evaluation.mdx+++ b/docs/tier3-live-evaluation.mdx@@ -717,6 +717,13 @@ Native agent execution, verifier artifacts, paired small/custom-Dockerfile runsinput-file handling still need independent qualification. Codex, Claude Code andOpenCode mappings remain experimental and do not establish end-to-end agent support.+The Claude Code mapping uses the same pinned runtime version as Harbor, installed+by Gym inside the sandbox. It enables native discovery and projects staged skills+into the task workdir's `.claude/skills/` directory because Gym uses a private+Claude configuration directory. The baseline uses the same discovery settings+without the target skill. Gym's required Anthropic credential field receives only+a placeholder; policy credentials remain in the model-server environment.+```bash# Requires a separately verified, pinned Gym task-folder implementation.export SKILL_EVAL_NEMO_GYM_BIN=/opt/nemo-gym/.venv/bin/gymdiff --git a/src/skillevaluator/tier3/nemo_gym/runner.py b/src/skillevaluator/tier3/nemo_gym/runner.pyindex 1a6d3040..781a83a3 100644--- a/src/skillevaluator/tier3/nemo_gym/runner.py+++ b/src/skillevaluator/tier3/nemo_gym/runner.py@@ -23,6 +23,7 @@ from datetime import UTC, datetimefrom pathlib import Pathfrom typing import Any+from skillevaluator.tier3.harbor.local_runtime import PINNED_RUNTIME_VERSIONSfrom skillevaluator.tier3.harbor.progress import (MIN_EXACT_SECRET_CHARS,NullProgressReporter,@@ -68,15 +69,16 @@ def stage_for_gym(arm_dir: Path,verifier_env: dict[str, str] | None = None,*,+ agent: str | None = None,timeout_multiplier: float = 1.0,resource_overrides: dict[str, int] | None = None,) -> None:"""Adapt Harbor-format tasks for Gym's agents and verifier.Drops Harbor's ``skills_dir`` task hook, which Gym's CLI agents reject. The task image- already carries the skills at each agent's native location (``/root/.agents/skills``,- ``/root/.claude/skills``, ...), so the with-skill arm is unchanged and the baseline image- still has none. Adds ``verifier_env`` (``${NAME}`` templates) to ``[verifier.env]``: Harbor+ already carries the skills at each agent's native location. Claude also gets project+ skills because Gym uses a private ``CLAUDE_CONFIG_DIR``. The baseline image still has+ no target skill. Adds ``verifier_env`` (``${NAME}`` templates) to ``[verifier.env]``: Harborpasses the judge overrides at job level, and Gym has no job-level verifier env. Scales theagent, verifier and environment-build timeouts by ``timeout_multiplier``, as Harbor's``--timeout-multiplier`` does, because Gym enforces the task's own timeouts. Writes the@@ -85,8 +87,17 @@ def stage_for_gym("""for task_toml in arm_dir.glob("*/task.toml"):text = task_toml.read_text(encoding="utf-8")- if (tomllib.loads(text).get("environment") or {}).get("mcp_servers"):+ environment = tomllib.loads(text).get("environment") or {}+ if environment.get("mcp_servers"):raise ValueError(f"{task_toml.parent.name}: {NATIVE_MCP_SERVERS_ERROR}")+ if agent == "claude-code":+ dockerfile = task_toml.parent / "environment" / "Dockerfile"+ if dockerfile.is_file() and (dockerfile.parent / "skills").is_dir():+ workdir = environment.get("workdir") or "/workspace"+ projection = "COPY " + json.dumps(["skills/", f"{workdir.rstrip('/')}/.claude/skills/"])+ docker_text = dockerfile.read_text(encoding="utf-8")+ if projection not in docker_text.splitlines():+ dockerfile.write_text(docker_text.rstrip("\n") + "\n" + projection + "\n", encoding="utf-8")staged = _SKILLS_DIR_LINE.sub("", text)existing = set((tomllib.loads(staged).get("verifier") or {}).get("env") or {})lines = "".join(@@ -382,6 +393,16 @@ def gym_eval_command(]if n_concurrent:command += ["--concurrency", str(n_concurrent)]+ if agent == "claude-code":+ command += [+ "++anthropic_api_key=EMPTY",+ "++claude_code_agent.responses_api_agents.claude_code_agent.model_server="+ "{type:responses_api_models,name:policy_model}",+ "++claude_code_agent.responses_api_agents.claude_code_agent.model=${policy_model_name}",+ "++claude_code_agent.responses_api_agents.claude_code_agent.bare=false",+ "++claude_code_agent.responses_api_agents.claude_code_agent.claude_code_version="+ + PINNED_RUNTIME_VERSIONS["claude-code"],+ ]if inherit_sandbox_environment:# Gym's Codex agent starts Codex with only its own variables unless told to keep the sandbox's.gym_agent = NEMO_GYM_AGENTS[agent]@@ -1067,6 +1088,7 @@ def run_nemo_gym_eval(stage_for_gym(arm_dir,judge_job_env,+ agent=agent,timeout_multiplier=effective_timeout,# Generated tasks already carry them; native tasks get Harbor's job-level override.resource_overrides={diff --git a/tests/test_nemo_gym_backend.py b/tests/test_nemo_gym_backend.pyindex c8389e5f..dfa2cc50 100644--- a/tests/test_nemo_gym_backend.py+++ b/tests/test_nemo_gym_backend.py@@ -95,6 +95,41 @@ def test_gym_command_keeps_api_key_out_of_argv(tmp_path: Path, monkeypatch: pyteassert "+default_host=172.17.0.1" in command[email protected]("agent", ["claude-code", "codex", "opencode"])+def test_gym_claude_command_configures_model_server_runtime(+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch, agent: str+) -> None:+ from skillevaluator.tier3.harbor.local_runtime import PINNED_RUNTIME_VERSIONS++ monkeypatch.setenv(MODEL_API_KEY_ENV, "policy-secret-value")+ monkeypatch.setenv("ANTHROPIC_API_KEY", "unrelated-anthropic-secret")+ command = gym_eval_command(+ "gym",+ tmp_path,+ agent=agent,+ model="policy-model",+ model_url="https://example.com/v1",+ rollouts_path=tmp_path / "rollouts.jsonl",+ n_attempts=1,+ n_concurrent=None,+ sandbox="docker",+ )+ assert "policy-secret-value" not in " ".join(command)+ assert "unrelated-anthropic-secret" not in " ".join(command)+ assert f"+policy_api_key=${{oc.env:{MODEL_API_KEY_ENV}}}" in command+ overrides = [+ "++anthropic_api_key=EMPTY",+ "++claude_code_agent.responses_api_agents.claude_code_agent.model_server="+ "{type:responses_api_models,name:policy_model}",+ "++claude_code_agent.responses_api_agents.claude_code_agent.model=${policy_model_name}",+ "++claude_code_agent.responses_api_agents.claude_code_agent.bare=false",+ "++claude_code_agent.responses_api_agents.claude_code_agent.claude_code_version="+ + PINNED_RUNTIME_VERSIONS["claude-code"],+ ]+ for override in overrides:+ assert (override in command) == (agent == "claude-code")++def _rollout(tmp_path: Path, task: str, attempt: int, overall: float | None) -> dict:logs = tmp_path / "gym-logs" / f"{task}-{attempt}"logs.mkdir(parents=True)@@ -427,6 +462,50 @@ def test_stage_for_gym_drops_only_the_skills_dir_hook(tmp_path: Path) -> None:assert "cpus = 2" in text and 'A = "1"' in text[email protected]("workdir", [None, "/work", "/"])[email protected]("with_skill", [True, False])+def test_stage_for_gym_projects_claude_skills_into_task_workdir(+ tmp_path: Path, workdir: str | None, with_skill: bool+) -> None:+ task = tmp_path / "case"+ environment = task / "environment"+ skills = environment / "skills"+ skills.mkdir(parents=True)+ if with_skill:+ (skills / "calculator").mkdir()+ (skills / "calculator" / "SKILL.md").write_text("Use the calculator.\n")+ (task / "task.toml").write_text(+ '[environment]\nskills_dir = "/workspace/skills"\n' + (f"workdir = {json.dumps(workdir)}\n" if workdir else "")+ )+ dockerfile = environment / "Dockerfile"+ dockerfile.write_text("FROM python:3.12-slim\n")+ stage_for_gym(tmp_path, agent="claude-code")+ stage_for_gym(tmp_path, agent="claude-code")+ destination = (workdir or "/workspace").rstrip("/") + "/.claude/skills/"+ assert dockerfile.read_text().splitlines().count("COPY " + json.dumps(["skills/", destination])) == 1+ assert "skills_dir" not in (task / "task.toml").read_text()+ assert bool(list(skills.rglob("SKILL.md"))) == with_skill++[email protected]("agent", [None, "codex", "opencode"])+def test_stage_for_gym_leaves_other_agent_images_unchanged(tmp_path: Path, agent: str | None) -> None:+ task = tmp_path / "case"+ (task / "environment" / "skills").mkdir(parents=True)+ (task / "task.toml").write_text("[environment]\n")+ dockerfile = task / "environment" / "Dockerfile"+ dockerfile.write_text("FROM python:3.12-slim\n")+ stage_for_gym(tmp_path, agent=agent)+ assert dockerfile.read_text() == "FROM python:3.12-slim\n"+++def test_stage_for_gym_claude_without_docker_skills(tmp_path: Path) -> None:+ task = tmp_path / "case"+ task.mkdir()+ (task / "task.toml").write_text("[environment]\n")+ stage_for_gym(tmp_path, agent="claude-code")+ assert not (task / "environment").exists()++def test_verifier_judge_env_stages_templates_not_values(tmp_path: Path, monkeypatch) -> None:from skillevaluator.tier3.nemo_gym.runner import verifier_judge_env@@ -569,6 +648,33 @@ def _run_fake_gym(skill: Path, tmp_path: Path, **overrides) -> dict:return run_nemo_gym_eval(**kwargs)+def test_fake_gym_claude_stages_project_skills_in_both_arms(tmp_path: Path, monkeypatch) -> None:+ from skillevaluator.tier3.nemo_gym import runner as gym_runner++ skill, _env_log = _fake_gym_skill(tmp_path, monkeypatch)+ original_stage = gym_runner.stage_for_gym+ staged = {}++ def recording_stage(arm_dir: Path, *args, **kwargs) -> None:+ original_stage(arm_dir, *args, **kwargs)+ staged[arm_dir.name] = [+ (+ path.read_text(),+ bool(list((path.parent / "skills").rglob("SKILL.md"))),+ )+ for path in arm_dir.glob("*/environment/Dockerfile")+ ]++ monkeypatch.setattr(gym_runner, "stage_for_gym", recording_stage)+ _run_fake_gym(skill, tmp_path, agents=["claude-code"])+ assert set(staged) == {"with", "without"}+ for arm, tasks in staged.items():+ assert tasks+ for dockerfile, has_skill in tasks:+ assert 'COPY ["skills/", "/workspace/.claude/skills/"]' in dockerfile+ assert has_skill == (arm == "with")++@pytest.fixturedef incompatible_gym(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:gym = tmp_path / "released-gym"