Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
fix(cli): select the interactive SUT before pairing judges (#162)
Rudy Mizrahi Celekli5597af5f5914
diff --git a/ifixai/cli/run.py b/ifixai/cli/run.pyindex 4ff0db6..eba2036 100644--- a/ifixai/cli/run.py+++ b/ifixai/cli/run.py@@ -953,6 +953,16 @@ def run(run_mode = "standard"profile = "full" if run_mode == "full" else "quick"+ if provider is None:+ interactive = gather_interactive_config()+ provider = interactive["provider"]+ api_key = interactive["api_key"]+ endpoint = interactive["endpoint"]+ model = interactive["model"]+ auth_method = interactive.get("auth_method") or auth_method+ if interactive.get("extra_headers"):+ extra_headers = interactive["extra_headers"]+eval_mode_auto_selected_judge: str | None = Noneif eval_mode is None:if run_mode == "full":@@ -1043,16 +1053,6 @@ def run()sys.exit(1)- if provider is None:- interactive = gather_interactive_config()- provider = interactive["provider"]- api_key = interactive["api_key"]- endpoint = interactive["endpoint"]- model = interactive["model"]- auth_method = interactive.get("auth_method") or auth_method- if interactive.get("extra_headers"):- extra_headers = interactive["extra_headers"]-# Normalize --extra-headers (JSON string, or a dict from config/wizard) once.extra_headers_dict = _parse_extra_headers(extra_headers)diff --git a/ifixai/tests/test_cli_interactive_judge_selection.py b/ifixai/tests/test_cli_interactive_judge_selection.pynew file mode 100644index 0000000..46d5b7b--- /dev/null+++ b/ifixai/tests/test_cli_interactive_judge_selection.py@@ -0,0 +1,37 @@+import pytest+from click.testing import CliRunner++from ifixai.cli.main import ifixai_cli+from ifixai.cli.run import PROVIDER_CHOICES+from ifixai.providers.resolver import credential_env_vars++[email protected]("interactive", [True, False])[email protected]("external_key", [True, False])+def test_standard_judge_pairing_uses_the_selected_sut(+ tmp_path, monkeypatch, interactive, external_key+):+ monkeypatch.chdir(tmp_path)+ monkeypatch.setenv("IFIXAI_TELEMETRY", "0")+ for provider in PROVIDER_CHOICES:+ for key in credential_env_vars(provider):+ monkeypatch.delenv(key, raising=False)+ monkeypatch.setenv("OPENAI_API_KEY", "owned-synthetic-openai-key")+ if external_key:+ monkeypatch.setenv("ANTHROPIC_API_KEY", "owned-synthetic-anthropic-key")+ args = ["run", "--dry-run", "--no-telemetry"]+ if not interactive:+ args += ["--provider", "openai"]+ # Actual Click guided prompts: no deployed endpoint; pick bare OpenAI;+ # synthetic key; no custom endpoint; no model override.+ result = CliRunner().invoke(+ ifixai_cli, args, input="n\nopenai\nowned-synthetic-openai-key\nn\nn\n"+ )+ if external_key:+ assert result.exit_code == 0, result.output+ assert "auto-paired judge provider 'anthropic' (SUT='openai')" in result.output+ assert "Dry run -- no API calls will be made" in result.output+ else:+ assert result.exit_code == 2, result.output+ assert "needs a second distinct-provider credential" in result.output+ assert "auto-paired judge provider 'openai'" not in result.output