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: stop silently dropping --system-prompt (B26/B30/B31/B32) and fixture metadata overrides (#68)

Marcos Antonio Maceoc0b5202b87d3
diff --git a/ifixai/core/fixture_loader.py b/ifixai/core/fixture_loader.py
index 28e444c..1cb4693 100644
--- a/ifixai/core/fixture_loader.py
+++ b/ifixai/core/fixture_loader.py
@@ -311,6 +311,12 @@ def _parse_fixture(raw: dict[str, Any]) -> Fixture:
domain=metadata_raw["domain"],
description=metadata_raw.get("description", ""),
timestamp=metadata_raw.get("timestamp"),
+ # Author-facing metadata overrides. FixtureMetadata declares these and
+ # B06/B31/B32 read them, but they were never copied off the raw fixture,
+ # so setting them in YAML had no effect.
+ on_topic_examples=metadata_raw.get("on_topic_examples", []),
+ b06_probes=metadata_raw.get("b06_probes", []),
+ case_id_prefixes=metadata_raw.get("case_id_prefixes", []),
)
roles = [
diff --git a/ifixai/fixtures/schema.json b/ifixai/fixtures/schema.json
index eb0f84e..c45faa2 100644
--- a/ifixai/fixtures/schema.json
+++ b/ifixai/fixtures/schema.json
@@ -27,6 +27,16 @@
"type": "array",
"items": { "type": "string", "pattern": "^[A-Z0-9]+$" },
"description": "B31 escalation/audit reference prefixes (e.g. JIRA, OPS). Uppercase alphanumeric."
+ },
+ "on_topic_examples": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "B32 on-topic prompts for this system. Fixture-author override used when tool-derived prompts cannot reach the on-topic minimum (e.g. single-tool systems)."
+ },
+ "b06_probes": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "B06 domain-specific uncertainty probes. Overrides the built-in probe set."
}
}
},
diff --git a/ifixai/inspections/b26_rate_limiting/runner.py b/ifixai/inspections/b26_rate_limiting/runner.py
index 46cdcf4..8cd7965 100644
--- a/ifixai/inspections/b26_rate_limiting/runner.py
+++ b/ifixai/inspections/b26_rate_limiting/runner.py
@@ -4,7 +4,6 @@ import time
from typing import Optional, TypedDict
from ifixai.core.types import (
- ChatMessage,
ConversationPlan,
EvaluationMethod,
EvidenceItem,
@@ -16,7 +15,7 @@ from ifixai.core.types import (
ScoreBreakdown,
)
from ifixai.evaluation.analytic_judge import load_analytic_rubric
-from ifixai.harness.base import BaseTest
+from ifixai.harness.base import BaseTest, send_single_turn
from ifixai.providers.base import (
ChatProvider,
ProviderConnectionError,
@@ -62,9 +61,7 @@ SPEC = InspectionSpec(
_LIVE_RAPID_FIRE_CONCURRENCY = 3
_ROUND_TRIP_TIMEOUT_SECONDS = 30.0
-_INSPECTION_MESSAGE = [
- ChatMessage(role="user", content="B26 rate-limit inspection ping")
-]
+_INSPECTION_PROMPT = "B26 rate-limit inspection ping"
# Provider exceptions that represent infrastructure-level transient failures
# (network outage, request timeout). These are excluded from the rate-limit
@@ -135,7 +132,7 @@ class B26RateLimiting(BaseTest):
return []
tasks = [
- provider.send_message(_INSPECTION_MESSAGE, config)
+ send_single_turn(provider, config, _INSPECTION_PROMPT)
for _ in range(concurrency)
]
start = time.monotonic()
diff --git a/ifixai/inspections/b30_malicious_deployer_rules/runner.py b/ifixai/inspections/b30_malicious_deployer_rules/runner.py
index 2962607..c510cf2 100644
--- a/ifixai/inspections/b30_malicious_deployer_rules/runner.py
+++ b/ifixai/inspections/b30_malicious_deployer_rules/runner.py
@@ -4,7 +4,6 @@ from pathlib import Path
from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY
from ifixai.core.types import (
- ChatMessage,
EvaluationMethod,
EvidenceItem,
Fixture,
@@ -19,7 +18,7 @@ from ifixai.harness.adversarial_mutator import (
expand_seeds,
load_seeds,
)
-from ifixai.harness.base import BaseTest
+from ifixai.harness.base import BaseTest, send_single_turn
from ifixai.providers.base import ChatProvider
SPEC = InspectionSpec(
@@ -105,10 +104,7 @@ class B30MaliciousDeployerRules(BaseTest):
prompt: str,
seed_id: str,
) -> EvidenceItem:
- response_text = await provider.send_message(
- [ChatMessage(role="user", content=prompt)],
- config,
- )
+ response_text = await send_single_turn(provider, config, prompt)
test_case_id = f"B30-{seed_id}-{idx + 1}"
description = f"Attempt to create malicious rule: {prompt[:60]}"
diff --git a/ifixai/inspections/b31_escalation_correctness/runner.py b/ifixai/inspections/b31_escalation_correctness/runner.py
index 8920ee2..f7e1f7a 100644
--- a/ifixai/inspections/b31_escalation_correctness/runner.py
+++ b/ifixai/inspections/b31_escalation_correctness/runner.py
@@ -6,7 +6,6 @@ from collections.abc import Callable
from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY
from ifixai.core.types import (
AnalyticRubric,
- ChatMessage,
ConversationPlan,
DimensionScore,
EvaluationCriteria,
@@ -20,7 +19,7 @@ from ifixai.core.types import (
)
from ifixai.evaluation.analytic_judge import load_analytic_rubric
from ifixai.evaluation.errors import JudgePipelineRequiredError
-from ifixai.harness.base import BaseTest, sample_capped
+from ifixai.harness.base import BaseTest, sample_capped, send_single_turn
from ifixai.providers.base import ChatProvider
from ifixai.rules.loader import RuleLoader, RuleLoadError
@@ -305,10 +304,7 @@ class B31EscalationCorrectness(BaseTest):
case_id_pattern: re.Pattern[str],
) -> EvidenceItem:
async with semaphore:
- response_text = await provider.send_message(
- [ChatMessage(role="user", content=prompt)],
- config,
- )
+ response_text = await send_single_turn(provider, config, prompt)
return await self._score_trigger(
idx=idx,
total=total,
diff --git a/ifixai/inspections/b32_off_topic_detection/runner.py b/ifixai/inspections/b32_off_topic_detection/runner.py
index fe27e6c..3e18f11 100644
--- a/ifixai/inspections/b32_off_topic_detection/runner.py
+++ b/ifixai/inspections/b32_off_topic_detection/runner.py
@@ -8,7 +8,6 @@ import yaml
from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY
from ifixai.core.types import (
AnalyticRubric,
- ChatMessage,
EvaluationCriteria,
EvaluationMethod,
EvidenceItem,
@@ -21,7 +20,7 @@ from ifixai.core.types import (
)
from ifixai.evaluation.analytic_judge import load_analytic_rubric
from ifixai.evaluation.errors import JudgePipelineRequiredError
-from ifixai.harness.base import BaseTest
+from ifixai.harness.base import BaseTest, send_single_turn
from ifixai.harness.prompt_pool import load_prompt_pool, sample_prompt_pool
from ifixai.providers.base import ChatProvider
from ifixai.rules.loader import RuleLoadError
@@ -330,10 +329,7 @@ class B32OffTopicDetection(BaseTest):
) -> EvidenceItem:
async with semaphore:
try:
- response_text = await provider.send_message(
- [ChatMessage(role="user", content=prompt)],
- config,
- )
+ response_text = await send_single_turn(provider, config, prompt)
except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweep
# Per-probe COMMUNICATION isolation: one transient provider
# error must not cancel sibling gather tasks. Narrow catch to
@@ -375,10 +371,7 @@ class B32OffTopicDetection(BaseTest):
) -> EvidenceItem:
async with semaphore:
try:
- response_text = await provider.send_message(
- [ChatMessage(role="user", content=prompt)],
- config,
- )
+ response_text = await send_single_turn(provider, config, prompt)
except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweep
_logger.warning(
"B32 on-topic probe %d communication error: %r", idx, exc