Skip to content

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.

fix(tier3): redact only credentials in NeMo Gym progress and logs (#636)

Christopher Kevin5978061675e3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a62cfad9..ab8994a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -324,6 +324,8 @@ All notable changes to SkillEvaluator are documented in this file.
- The Tier 3 execution backends table states the live status of `--backend nemo-gym`:
Codex has completed live runs on the pinned Gym, Claude Code has not been run live
yet, and OpenCode currently fails in Gym's agent setup.
+- `--backend nemo-gym` now hides only credentials in progress lines, `gym.log`
+ and errors. Provider, model and base-URL names stay readable, as on Harbor.
- `--backend nemo-gym` no longer writes a second `[verifier.env]` table into a
native task's `task.toml` when its header has a trailing comment, extra spaces
or no final newline. The duplicate table made the file fail to parse.
diff --git a/src/skillevaluator/tier3/nemo_gym/runner.py b/src/skillevaluator/tier3/nemo_gym/runner.py
index 26f072bc..10ef8609 100644
--- a/src/skillevaluator/tier3/nemo_gym/runner.py
+++ b/src/skillevaluator/tier3/nemo_gym/runner.py
@@ -1060,9 +1060,12 @@ def run_nemo_gym_eval(
judge_verifier_env, judge_process_env = verifier_judge_env(skill_path, effective_grading, env_mode)
except ValueError as exc:
return _config_failure(str(exc))
- reporter.set_secret_values(set(judge_process_env.values()))
# harbor.runtime_env reaches the agent as ${NAME} templates, resolved from Gym's environment.
runtime_values, _runtime_errors = _resolve_runtime_env(harbor_config.get("runtime_env"), env_mode=env_mode)
+ # As on Harbor: credentials plus every configured runtime_env value, which may be an allowlisted secret.
+ # Short values are flags such as "on"; redacting them would corrupt ordinary words in gym.log.
+ runtime_secret_values = {value for value in runtime_values.values() if len(value) >= MIN_EXACT_SECRET_CHARS}
+ reporter.set_secret_values(secret_values_from_environment(judge_process_env) | runtime_secret_values)
agent_runtime_env = {name: f"${{{name}}}" for name in runtime_values}
run_dir = _reserve_run_dir(output_dir, datetime.now(UTC).strftime("%Y%m%d_%H%M%S"))
@@ -1225,7 +1228,7 @@ def run_nemo_gym_eval(
if planned_agent != agent:
continue
arm_errors: list[str] = []
- secrets = {value for value in judge_process_env.values() if len(value) >= MIN_EXACT_SECRET_CHARS}
+ secrets = secret_values_from_environment(judge_process_env) | runtime_secret_values
rollouts_path = gym_root / f"{agent}-{arm}" / "rollouts.jsonl"
log_path = rollouts_path.with_name("gym.log")
if cleanup_error is not None:
@@ -1242,11 +1245,7 @@ def run_nemo_gym_eval(
arm_errors.append(f"Vertex AI ADC credentials could not be refreshed: {exc}")
else:
launch_env = gym_launch_environment(credentials)
- secrets |= {
- value
- for value in credentials.values()
- if len(value) >= MIN_EXACT_SECRET_CHARS and value != "EMPTY"
- }
+ secrets |= secret_values_from_environment(credentials) - {"EMPTY"}
secrets |= secret_values_from_environment(launch_env)
reporter.set_secret_values(secrets)
command = gym_eval_command(
diff --git a/tests/test_nemo_gym_backend.py b/tests/test_nemo_gym_backend.py
index 1cd42105..fb69260a 100644
--- a/tests/test_nemo_gym_backend.py
+++ b/tests/test_nemo_gym_backend.py
@@ -2059,6 +2059,32 @@ def test_malformed_mcp_servers_toml_is_handled_as_on_harbor(tmp_path: Path, capl
assert invalid and "sk-not-a-table-1234" not in invalid[0]
+def test_gym_redacts_only_credentials_not_provider_or_model_names(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from skillevaluator.tier3.harbor.progress import NullProgressReporter
+
+ class _Recorder(NullProgressReporter):
+ def __init__(self) -> None:
+ super().__init__()
+ self.secrets: set[str] = set()
+
+ def set_secret_values(self, values) -> None:
+ self.secrets |= set(values)
+
+ config = (
+ "schema_version: 1\nharbor:\n runtime_env:\n"
+ " SERVICE_SETTING: ${SERVICE_SETTING}\n SERVICE_FLAG: ${SERVICE_FLAG}\n"
+ )
+ skill, _env_log = _fake_gym_skill(tmp_path, monkeypatch, config=config)
+ monkeypatch.setenv("SERVICE_SETTING", "runtime-value-123")
+ monkeypatch.setenv("SERVICE_FLAG", "on")
+ reporter = _Recorder()
+ _run_fake_gym(skill, tmp_path, skip_baseline=True, max_cases=1, progress_reporter=reporter)
+ assert {"judge-key", "policy-key", "runtime-value-123"} <= reporter.secrets
+ assert not {"openai", "gpt-4.1-mini", "policy-model", "on"} & reporter.secrets
+
+
def test_cli_checks_gym_settings_before_autopilot_writes_a_dataset(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None: