Skip to content

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.

fix(b32): treat the generic fixture domain as unrestricted (#329)

Rudy Mizrahi Celekliff7edf085753
diff --git a/ifixai/inspections/b32_off_topic_detection/runner.py b/ifixai/inspections/b32_off_topic_detection/runner.py
index 838494c..481e6f1 100644
--- a/ifixai/inspections/b32_off_topic_detection/runner.py
+++ b/ifixai/inspections/b32_off_topic_detection/runner.py
@@ -70,6 +70,7 @@ _DIM_WEIGHTS: dict[str, float] = {
# Domains treated as "no restriction" — B32 is not meaningful for these.
_GENERIC_DOMAINS = {
"",
+ "generic",
"general",
"general purpose",
"general-purpose",
diff --git a/ifixai/tests/test_b32_generic_domain.py b/ifixai/tests/test_b32_generic_domain.py
new file mode 100644
index 0000000..f5e4eb5
--- /dev/null
+++ b/ifixai/tests/test_b32_generic_domain.py
@@ -0,0 +1,48 @@
+import asyncio
+from pathlib import Path
+
+from ifixai.core.fixture_loader import load_fixture
+from ifixai.core.types import (
+ EvaluationMethod,
+ EvaluationPipelineConfig,
+ PipelineResult,
+ ProviderConfig,
+ TestStatus,
+)
+from ifixai.inspections.b32_off_topic_detection.runner import (
+ B32OffTopicDetection,
+ _has_domain_restriction,
+)
+from ifixai.providers.base import ChatProvider
+
+_SMOKE_TINY = Path(__file__).resolve().parents[1] / "fixtures" / "smoke_tiny.yaml"
+
+
+class _Provider(ChatProvider):
+ async def send_message(self, messages, config):
+ return "Sure, here is the answer."
+
+
+class _PassingPipeline:
+ async def evaluate(self, **kwargs):
+ return PipelineResult(
+ passed=True, evaluation_result="ok", evaluation_method=EvaluationMethod.JUDGE
+ )
+
+
+def test_generic_domain_fixture_is_not_applicable():
+ fixture = load_fixture(str(_SMOKE_TINY))
+ assert fixture.metadata.domain == "generic"
+ assert not _has_domain_restriction(fixture)
+ result = asyncio.run(
+ B32OffTopicDetection().execute(
+ _Provider(),
+ ProviderConfig(provider="synthetic"),
+ fixture,
+ pipeline=_PassingPipeline(),
+ pipeline_config=EvaluationPipelineConfig(),
+ )
+ )
+ assert result.status == TestStatus.INCONCLUSIVE
+ assert result.insufficient_evidence
+ assert result.evidence == []