Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

feat(eval): set the groundedness floor from the runs, and gate on it (#1008)

Beenu Arora80bad222b0c8
diff --git a/.github/workflows/live-agent-eval.yml b/.github/workflows/live-agent-eval.yml
index eacac3725..aa40342e7 100644
--- a/.github/workflows/live-agent-eval.yml
+++ b/.github/workflows/live-agent-eval.yml
@@ -21,11 +21,16 @@ name: Live agent eval (local model)
# live-agent performance. A gate that can pass without calling the model is
# worse than no gate.
#
-# Not a PR gate yet, on purpose. It follows the observe-then-ratchet convention
-# already used by security.yml: prove the job is stable and establish a floor
-# from real runs first, then promote it to `pull_request` and make the
-# threshold blocking. Promoting it before the floor is grounded in measurements
-# would just be inventing a number.
+# The floor now exists and is asserted on every run — see
+# `scripts/check_live_agent_floor.py` and the runs recorded in
+# `services/agents/tests/eval_data/live_agent_floor.json`. It was derived from
+# measurements, which is why it took a working job to get one.
+#
+# Still not a PR gate, and now for a measured reason rather than a cautious
+# one: a slice adds minutes to a run and a 0.5b model's output is a property
+# of the machine it is decoded on, so a threshold tight enough to be useful
+# would be tight enough to flake on a runner nobody controls. Scheduled plus
+# on-demand, failing hard when the floor is breached, is what that supports.
on:
workflow_dispatch:
@@ -37,7 +42,14 @@ on:
incidents:
description: 'How many incidents to dispatch'
type: string
- default: '20'
+ # Ten, measured rather than chosen. The default was 20, and the first
+ # run that got as far as dispatching the agent hit `timeout-minutes`
+ # with the slice unfinished, because one unbounded completion can
+ # take twenty minutes on a runner. That cause is fixed in
+ # `app/investigator/limits.py`; this keeps a margin anyway, because
+ # GitHub reports a timeout as `cancelled` rather than `failed`, so a
+ # weekly run that measured nothing would not look like a failure.
+ default: '10'
schedule:
- cron: '0 3 * * 2'
@@ -59,10 +71,10 @@ jobs:
live-agent:
name: Dispatch the real agent against a local model
runs-on: ubuntu-latest
- timeout-minutes: 60
+ timeout-minutes: 90
env:
OLLAMA_MODEL: ${{ github.event.inputs.model || 'qwen2.5:0.5b' }}
- INCIDENT_LIMIT: ${{ github.event.inputs.incidents || '20' }}
+ INCIDENT_LIMIT: ${{ github.event.inputs.incidents || '10' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
@@ -137,6 +149,14 @@ jobs:
--out live-agent-eval.json \
--wet-out live-agent-eval.wet.json
+ # The assertion. Until this existed the job measured and reported and
+ # nothing could fail, which is why the two claim-matrix rows resting on
+ # it stayed PARTIAL. The floor is read out of a committed file that
+ # records the runs it was derived from, so the number cannot be edited
+ # apart from its evidence.
+ - name: The measured groundedness floor
+ run: python3 scripts/check_live_agent_floor.py --report live-agent-eval.wet.json
+
- name: Summarise
if: always()
run: |
diff --git a/scripts/check_live_agent_floor.py b/scripts/check_live_agent_floor.py
new file mode 100644
index 000000000..c6416678f
--- /dev/null
+++ b/scripts/check_live_agent_floor.py
@@ -0,0 +1,240 @@
+#!/usr/bin/env python3
+"""The live agent's groundedness has a floor, and the floor came from runs.
+
+Why this exists
+---------------
+
+``services/agents/app/confidence/groundedness.py`` measures what fraction of
+the concrete indicators an agent asserts — IPs, hashes, CVEs, MITRE
+techniques, domains — actually appear in the evidence it was handed.
+``fused_alert_consumer`` uses it in production to refuse to auto-close on
+reasoning the evidence does not support. Two things were already gated on
+every PR: that the scorer works, and that the worker demotes an ungrounded
+verdict. Neither says anything about *the live agent's own output*, because a
+hand-written string proves the scorer and only a real model's text proves the
+agent.
+
+``live-agent-eval.yml`` dispatches the real four-agent pipeline against a
+locally-served model and scores exactly that. This gate is the assertion on
+its result.
+
+Why the floor is where it is
+----------------------------
+
+The number is not chosen, it is read out of ``FLOOR_FILE``, which records the
+runs it came from: the model, how many incidents each run dispatched, every
+observed mean, and where those runs happened. A floor invented before the
+distribution existed would be a number nobody measured, which is the whole
+reason the two claim-matrix rows waiting on it stayed PARTIAL rather than
+being closed with a plausible-looking constant.
+
+What this refuses
+-----------------
+
+``substrate``
+ A report tagged anything other than ``mode: live``. The harness degrades
+ to deterministic substrate numbers when the agent stack is unreachable,
+ and asserting a floor against those would certify a model that was never
+ called. ``--wet-require-live`` should have failed the run first; this is
+ the second lock on the same door.
+
+``unmeasured``
+ ``groundedness.measured`` false, or fewer incidents scored than the floor
+ was derived over. A mean of one incident is not the same measurement as a
+ mean of twenty, and comparing them to the same floor would quietly change
+ what the gate asserts.
+
+``wrong model``
+ A report from a model the floor was not derived against. Groundedness is
+ a property of the model's output; a floor measured on one model says
+ nothing about another. Pass ``--allow-model`` to grade a new model
+ deliberately, which prints the comparison rather than hiding it.
+
+``below the floor``
+ The thing the gate is for.
+
+Usage
+-----
+::
+
+ python3 scripts/check_live_agent_floor.py --report live-agent-eval.wet.json
+ python3 scripts/check_live_agent_floor.py --show
+ python3 scripts/check_live_agent_floor.py --self-test
+
+Exit codes: 0 clean, 1 findings, 2 the check itself could not run.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import sys
+from pathlib import Path
+from typing import Any
+
+# `scripts/` is on sys.path when this file is run as a program, but not when a
+# test loads it by path with importlib. gate_toolkit sits beside it either way.
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from gate_toolkit import repo_root, self_test_if_requested
+
+self_test_if_requested(__file__)
+
+#: Where the floor and its provenance live. A committed file rather than a
+#: constant in this module, so the number and the runs behind it cannot be
+#: edited apart.
+FLOOR_REL = Path("services") / "agents" / "tests" / "eval_data" / "live_agent_floor.json"
+
+REQUIRED_KEYS = ("axis", "model", "served_by", "incidents", "floor_mean", "observations", "derivation")
+
+
+def load_floor(path: Path) -> dict[str, Any]:
+ """Read the floor declaration, refusing one that does not carry its evidence."""
+ doc = json.loads(path.read_text(encoding="utf-8"))
+ missing = [key for key in REQUIRED_KEYS if key not in doc]
+ if missing:
+ raise ValueError(f"{FLOOR_REL} is missing {', '.join(missing)} — a floor without its provenance is a number nobody can check")
+ observations = doc.get("observations")
+ if not isinstance(observations, list) or not observations:
+ raise ValueError(f"{FLOOR_REL} records no observations — the floor must be derived from runs, not chosen")
+ for index, entry in enumerate(observations):
+ if not isinstance(entry, dict) or "mean" not in entry or "where" not in entry or "incidents" not in entry:
+ raise ValueError(f"{FLOOR_REL} observations[{index}] needs mean, incidents and where")
+ floor = doc["floor_mean"]
+ if not isinstance(floor, int | float):
+ raise ValueError(f"{FLOOR_REL} floor_mean is not a number")
+ lowest = min(float(o["mean"]) for o in observations)
+ if float(floor) > lowest:
+ raise ValueError(
+ f"{FLOOR_REL} declares a floor of {floor} above the lowest run it was derived from ({lowest}) — that floor is already failing"
+ )
+ return doc
+
+
+def check(report: dict[str, Any], floor_doc: dict[str, Any], *, allow_model: bool) -> list[str]:
+ """Return the reasons this report does not clear the floor. Empty means clear."""
+ problems: list[str] = []
+
+ mode = str(report.get("mode") or "")
+ if mode != "live":
+ problems.append(
+ f"the report is tagged mode={mode!r}, not 'live'. The harness degrades to deterministic "
+ "substrate numbers when the agent is unreachable, and a floor asserted against those would "
+ "certify a model that was never called."
+ )
+ # Everything below reads numbers whose provenance has just been
+ # rejected, so there is nothing further worth saying about them.
+ return problems
+
+ grounded = report.get("groundedness")
+ if not isinstance(grounded, dict) or not grounded.get("measured"):
+ note = (
+ (grounded or {}).get("note", "no groundedness block in the report")
+ if isinstance(grounded, dict)
+ else "no groundedness block in the report"
+ )
+ problems.append(f"groundedness was not measured: {note}")
+ return problems
+
+ # A run where every agent caught its provider error and used its
+ # deterministic path produces a report tagged `live`, at a tenth of a
+ # second per investigation, with a flattering groundedness that no model
+ # wrote. `--wet-require-live` refuses that at source; this refuses it
+ # again here, because the report is the artefact a reader keeps.
+ if "llm_calls_placed" in grounded and int(grounded.get("llm_calls_placed") or 0) <= 0:
+ problems.append(
+ "the report records zero LLM calls placed, so every agent used its deterministic fallback. "
+ "These numbers describe the fallback, not the model."
+ )
+ return problems
+
+ required_incidents = int(floor_doc["incidents"])
+ scored = int(grounded.get("scored_incidents") or 0)
+ if scored < required_incidents:
+ problems.append(
+ f"{scored} incident(s) scored, and the floor was derived over {required_incidents}. "
+ "A mean over a smaller sample is a different measurement, not a cheaper one."
+ )
+
+ report_model = str(report.get("model") or "")
+ floor_model = str(floor_doc["model"])
+ if report_model != floor_model and not allow_model:
+ problems.append(
+ f"this report is from {report_model!r} and the floor was derived against {floor_model!r}. "
+ "Groundedness is a property of the model's output. Pass --allow-model to grade a new model "
+ "deliberately; the comparison is then printed rather than assumed."
+ )
+
+ mean = float(grounded.get("mean") or 0.0)
+ floor = float(floor_doc["floor_mean"])
+ if mean < floor:
+ worst = ", ".join(str(o["mean"]) for o in floor_doc["observations"])
+ problems.append(
+ f"groundedness mean {mean:.4f} over {scored} incident(s) is below the floor of {floor:.4f}. "
+ f"The floor was derived from these run means: {worst}. Either the agent, its prompts or the "
+ "scorer changed — re-measure and move the floor in the same change, with the new runs recorded."
+ )
+ return problems
+
+
+def main(argv: list[str] | None = None) -> int:
+ parser = argparse.ArgumentParser(description="Assert the live agent's measured groundedness floor.")
+ parser.add_argument("--report", type=Path, help="the wet-eval block written by run_evals.py --wet-out")
+ parser.add_argument("--show", action="store_true", help="print the floor and the runs it came from, then exit")
+ parser.add_argument("--allow-model", action="store_true", help="grade a model the floor was not derived against")
+ parser.add_argument("--repo-root", type=Path, default=None)
+ args = parser.parse_args(argv)
+
+ root = args.repo_root.resolve() if args.repo_root else repo_root()
+ floor_path = root / FLOOR_REL
+ if not floor_path.is_file():
+ print(f"ERROR: {FLOOR_REL} not found under {root} — there is no declared floor to assert", file=sys.stderr)
+ return 2
+ try:
+ floor_doc = load_floor(floor_path)
+ except (ValueError, json.JSONDecodeError) as exc:
+ print(f"ERROR: {exc}", file=sys.stderr)
+ return 2
+
+ if args.show or args.report is None:
+ print(f"axis {floor_doc['axis']}")
+ print(f"model {floor_doc['model']} ({floor_doc['served_by']})")
+ print(f"slice {floor_doc['incidents']} incidents, deterministic prefix")
+ print(f"floor {floor_doc['floor_mean']}")
+ print("runs it came from:")
+ for entry in floor_doc["observations"]:
+ print(f" mean={entry['mean']} n={entry['incidents']} {entry['where']}")
+ print(f"derivation: {floor_doc['derivation']}")
+ if args.report is None and not args.show:
+ print("\nno --report given, so nothing was asserted", file=sys.stderr)
+ return 0
+
+ if not args.report.is_file():
+ print(f"ERROR: {args.report} not found — the eval wrote no report, so there is nothing to assert on", file=sys.stderr)
+ return 2
+ try:
+ report = json.loads(args.report.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ print(f"ERROR: {args.report} is not JSON ({exc}) — the eval did not finish", file=sys.stderr)
+ return 2
+
+ problems = check(report, floor_doc, allow_model=args.allow_model)
+ grounded = report.get("groundedness") or {}
+ measured = (
+ f"{grounded.get('mean')} over {grounded.get('scored_incidents')} incident(s) of {report.get('model')}"
+ if grounded.get("measured")
+ else "nothing measured"
+ )
+
+ if problems:
+ print(f"live-agent-floor: {len(problems)} finding(s) — {measured}", file=sys.stderr)
+ for problem in problems:
+ print(f" {problem}", file=sys.stderr)
+ return 1
+
+ print(f"live-agent-floor: OK — {measured}, floor {floor_doc['floor_mean']}")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/scripts/tests/test_check_live_agent_floor.py b/scripts/tests/test_check_live_agent_floor.py
new file mode 100644
index 000000000..e1850384d
--- /dev/null
+++ b/scripts/tests/test_check_live_agent_floor.py
@@ -0,0 +1,213 @@
+"""The floor refuses everything that would let it pass without measuring.
+
+The failure this guards against is not "the agent got worse". It is a gate
+that reports green on a report the agent never produced — a substrate
+fallback, a one-incident sample compared to a twenty-incident floor, or a
+different model's numbers held to this model's bar. Each of those would make
+the floor a decoration, which is worse than not having one, because the
+claim-to-gate matrix would then cite it.
+"""
+
+from __future__ import annotations
+
+import importlib.util
+import json
+import sys
+from pathlib import Path
+
+import pytest
+
+REPO_ROOT = Path(__file__).resolve().parents[2]
+GATE = REPO_ROOT / "scripts" / "check_live_agent_floor.py"
+
+
+def _load():
+ spec = importlib.util.spec_from_file_location("check_live_agent_floor", GATE)
+ assert spec is not None and spec.loader is not None
+ module = importlib.util.module_from_spec(spec)
+ sys.modules[spec.name] = module
+ spec.loader.exec_module(module)
+ return module
+
+
+gate = _load()
+
+FLOOR = {
+ "axis": "groundedness",
+ "model": "qwen2.5:0.5b",
+ "served_by": "ollama",
+ "incidents": 20,
+ "floor_mean": 0.45,
+ "observations": [{"mean": 0.5364, "incidents": 20, "where": "local"}],
+ "derivation": "margin below the lowest observed run",
+}
+
+
+def report(**overrides):
+ base = {
+ "mode": "live",
+ "model": "qwen2.5:0.5b",
+ "groundedness": {"measured": True, "mean": 0.5364, "scored_incidents": 20, "llm_calls_placed": 160},
+ }
+ base.update(overrides)
+ return base
+
+
+# ── the ways a green run could mean nothing ──────────────────────────────────
+
+
+def test_a_substrate_report_never_clears_a_live_floor():
+ problems = gate.check(report(mode="dry_run"), FLOOR, allow_model=False)
+ assert any("not 'live'" in p for p in problems)
+
+
+def test_a_substrate_report_is_refused_before_its_numbers_are_read():
+ """Reading on would grade figures whose provenance was just rejected."""
+ problems = gate.check(
+ {
+ "mode": "dry_run",
+ "model": "qwen2.5:0.5b",
+ "groundedness": {"measured": True, "mean": 0.99, "scored_incidents": 20, "llm_calls_placed": 160},
+ },
+ FLOOR,
+ allow_model=False,
+ )
+ assert len(problems) == 1
+
+
+def test_groundedness_that_was_not_measured_is_not_a_pass():
+ problems = gate.check(
+ report(groundedness={"measured": False, "note": "nothing to score"}),
+ FLOOR,
+ allow_model=False,
+ )
+ assert any("not measured" in p for p in problems)
+
+
+def test_a_run_that_placed_no_llm_call_is_the_fallback_not_the_model():
+ """Observed for real: a dead model env var sent every agent at an alias
+ the endpoint had never heard of, and the run reported 0.8050 at 0.11s per
+ investigation — faster than a network round trip, and flattering."""
+ problems = gate.check(
+ report(groundedness={"measured": True, "mean": 0.805, "scored_incidents": 20, "llm_calls_placed": 0}),
+ FLOOR,
+ allow_model=False,
+ )
+ assert any("zero LLM calls" in p for p in problems)
+
+
+def test_a_smaller_sample_is_a_different_measurement():
+ problems = gate.check(
+ report(groundedness={"measured": True, "mean": 0.9, "scored_incidents": 3, "llm_calls_placed": 24}),
+ FLOOR,
+ allow_model=False,
+ )
+ assert any("3 incident(s) scored" in p for p in problems)
+
+
+def test_another_model_is_not_graded_against_this_model_s_floor():
+ problems = gate.check(report(model="llama3.2:3b"), FLOOR, allow_model=False)
+ assert any("llama3.2:3b" in p for p in problems)
+
+
+def test_grading_another_model_is_possible_but_deliberate():
+ assert gate.check(report(model="llama3.2:3b"), FLOOR, allow_model=True) == []
+
+
+# ── the thing the gate is actually for ───────────────────────────────────────
+
+
+def test_a_run_below_the_floor_fails_and_prints_what_it_was_derived_from():
+ problems = gate.check(
+ report(groundedness={"measured": True, "mean": 0.31, "scored_incidents": 20, "llm_calls_placed": 160}),
+ FLOOR,
+ allow_model=False,
+ )
+ assert any("0.3100" in p and "0.4500" in p and "0.5364" in p for p in problems)
+
+
+def test_a_run_at_the_floor_passes():
+ assert (
+ gate.check(
+ report(groundedness={"measured": True, "mean": 0.45, "scored_incidents": 20, "llm_calls_placed": 160}), FLOOR, allow_model=False
+ )
+ == []
+ )
+
+
+def test_the_real_report_shape_clears_the_real_floor():
+ """The committed floor must pass a report carrying the runs it came from.
+
+ A floor set above its own evidence would red every run from the day it
+ landed, and the first person to see it would move the floor rather than
+ investigate.
+ """
+ real = gate.load_floor(REPO_ROOT / gate.FLOOR_REL)
+ lowest = min(float(o["mean"]) for o in real["observations"])
+ clean = {
+ "mode": "live",
+ "model": real["model"],
+ "groundedness": {"measured": True, "mean": lowest, "scored_incidents": int(real["incidents"]), "llm_calls_placed": 1},
+ }
+ assert gate.check(clean, real, allow_model=False) == []
+
+
+# ── the floor declaration has to carry its evidence ──────────────────────────
+
+
+def test_a_floor_with_no_observations_is_refused(tmp_path):
+ path = tmp_path / "floor.json"
+ path.write_text(json.dumps({**FLOOR, "observations": []}), encoding="utf-8")
+ with pytest.raises(ValueError, match="records no observations"):
+ gate.load_floor(path)
+
+
+def test_a_floor_above_its_own_evidence_is_refused(tmp_path):
+ path = tmp_path / "floor.json"
+ path.write_text(json.dumps({**FLOOR, "floor_mean": 0.9}), encoding="utf-8")
+ with pytest.raises(ValueError, match="above the lowest run"):
+ gate.load_floor(path)
+
+
+def test_a_floor_missing_its_provenance_is_refused(tmp_path):
+ path = tmp_path / "floor.json"
+ path.write_text(json.dumps({"floor_mean": 0.45}), encoding="utf-8")
+ with pytest.raises(ValueError, match="missing"):
+ gate.load_floor(path)
+
+
+def test_the_committed_floor_parses_and_declares_its_runs():
+ real = gate.load_floor(REPO_ROOT / gate.FLOOR_REL)
+ assert real["axis"] == "groundedness"
+ assert len(real["observations"]) >= 2, "one run is a sample, not a distribution"
+ # The model and where each run happened travel with every number, so a
+ # reader never has to ask which model produced the figure.
+ for entry in real["observations"]:
+ assert str(entry["where"]).strip()
+
+
+# ── end to end ───────────────────────────────────────────────────────────────
+
+
+def test_a_missing_report_is_an_eval_that_did_not_finish(tmp_path):
+ assert gate.main(["--report", str(tmp_path / "absent.json")]) == 2
+
+
+def test_show_prints_the_floor_without_asserting():
+ assert gate.main(["--show"]) == 0
+
+
+def test_the_gate_reds_on_a_report_below_the_floor(tmp_path):
+ real = gate.load_floor(REPO_ROOT / gate.FLOOR_REL)
+ path = tmp_path / "wet.json"
+ path.write_text(
+ json.dumps(
+ {
+ "mode": "live",
+ "model": real["model"],
+ "groundedness": {"measured": True, "mean": 0.0, "scored_incidents": int(real["incidents"]), "llm_calls_placed": 1},
+ }
+ ),
+ encoding="utf-8",
+ )
+ assert gate.main(["--report", str(path)]) == 1
diff --git a/scripts/wet_eval.py b/scripts/wet_eval.py
index 8fd4e6bdc..c95c7e1e1 100644
--- a/scripts/wet_eval.py
+++ b/scripts/wet_eval.py
@@ -260,6 +260,10 @@ class WetEvalRecord:
# reporting a flattering 1.0 for output that was never produced.
groundedness: float | None = None
hallucinated: list[str] = field(default_factory=list)
+ #: How many LLM calls the run actually placed. Zero means every agent fell
+ #: through to its deterministic path, which produces plausible records
+ #: that no model wrote.
+ llm_calls: int = 0
@property
def total_tokens(self) -> int:
@@ -491,6 +495,7 @@ def _live_records(
# reported usage across all four agents' calls. Only estimated when
# the provider surfaced nothing at all.
cost_summary = getattr(state, "cost_summary", None) or {}
+ llm_calls = int(cost_summary.get("call_count") or 0)
prompt_tokens = int(cost_summary.get("prompt_tokens") or 0)
completion_tokens = int(cost_summary.get("completion_tokens") or 0)
if prompt_tokens == 0 and completion_tokens == 0:
@@ -521,6 +526,7 @@ def _live_records(
severity=str(inc.get("severity") or "medium").lower(),
groundedness=grounded_score,
hallucinated=hallucinated,
+ llm_calls=llm_calls,
prompt_tokens=prompt_tokens,
completion_tokens=completion_tokens,
latency_seconds=round(latency_s, 4),
@@ -620,6 +626,9 @@ def _groundedness_block(records: list[WetEvalRecord]) -> dict[str, Any]:
return {
"measured": True,
"scored_incidents": len(scored),
+ # Beside the number, because a reader cannot otherwise tell the
+ # model's output from the deterministic fallback's.
+ "llm_calls_placed": sum(r.llm_calls for r in records),
"mean": round(mean(scored), 4),
"median": round(median(scored), 4),
"min": round(min(scored), 4),
@@ -814,6 +823,22 @@ def compute_wet_eval(
records, warnings, degraded = _live_records(incidents_path, model=model, limit=limit)
if require_live and degraded:
raise RuntimeError("require_live=True but the live path fell back to substrate numbers:\n - " + "\n - ".join(warnings))
+ # The agent stack imported, the pipeline ran, records came back — and
+ # not one LLM call was placed, because every agent caught its provider
+ # error and used its deterministic fallback. That produces a report
+ # tagged `live` full of numbers no model wrote, which is exactly what
+ # `require_live` exists to refuse; it just could not see this shape.
+ # Observed for real: a workflow that set a dead model env var sent
+ # every agent at a gateway alias the local server had never heard of,
+ # and the run reported a groundedness of 0.8050 at 0.11s per
+ # investigation — faster than a network round trip.
+ placed = sum(r.llm_calls for r in records)
+ if require_live and records and placed == 0:
+ raise RuntimeError(
+ f"require_live=True but not one LLM call was placed across {len(records)} investigation(s). "
+ "Every agent fell through to its deterministic path, so these numbers describe the fallback "
+ "and not the model. Check the model pins reach a model the endpoint serves."
+ )
# Degrade-cleanly: if the live path could not produce records
# we re-tag the report as ``dry_run`` so consumers don't think
# they're looking at real numbers.
diff --git a/services/agents/tests/eval_data/live_agent_floor.json b/services/agents/tests/eval_data/live_agent_floor.json
new file mode 100644
index 000000000..1e0b153c4
--- /dev/null
+++ b/services/agents/tests/eval_data/live_agent_floor.json
@@ -0,0 +1,39 @@
+{
+ "axis": "groundedness",
+ "metric": "mean fraction of the concrete indicators the agent asserted (IPs, hashes, CVEs, MITRE techniques, domains) that appear in the evidence it was handed, over a deterministic prefix of services/agents/tests/eval_data/synthetic_incidents.json",
+ "model": "qwen2.5:0.5b",
+ "served_by": "Ollama, locally. No hosted provider was involved in any run below and this floor describes none. A hosted model would need its own runs and its own floor.",
+ "incidents": 10,
+ "floor_mean": 0.4,
+ "observations": [
+ {
+ "mean": 0.5561,
+ "incidents": 10,
+ "runs": 7,
+ "where": "developer machine (Apple silicon, Ollama 0.30.7)",
+ "note": "identical to four decimal places across all seven; three were taken after the completion bound landed and returned the same value, so the bound truncates nothing the agents legitimately write"
+ },
+ {
+ "mean": 0.5821,
+ "incidents": 10,
+ "runs": 1,
+ "where": "GitHub-hosted ubuntu-latest runner, live-agent-eval.yml run 36508200093",
+ "note": "62 LLM calls placed"
+ },
+ {
+ "mean": 0.5329,
+ "incidents": 10,
+ "runs": 1,
+ "where": "GitHub-hosted ubuntu-latest runner, live-agent-eval.yml run 36509668438",
+ "note": "62 LLM calls placed; the lowest run observed anywhere"
+ },
+ {
+ "mean": 0.5364,
+ "incidents": 20,
+ "runs": 16,
+ "where": "developer machine, over the 20-incident prefix",
+ "note": "not the gated slice - recorded because sixteen identical runs show the measurement is a property of the prefix rather than of the run"
+ }
+ ],
+ "derivation": "The four agents decode greedily at temperature 0, and on one machine that makes the measurement a point mass: seven local runs over the 10-incident prefix returned 0.5561 to four decimal places, and sixteen over the 20-incident prefix returned 0.5364. It is not a point mass across machines. Two GitHub-runner runs of the same slice returned 0.5821 and 0.5329, a spread of 0.0492, because a quantised model decoding greedily on a different kernel diverges at the margins. The floor is set from that spread rather than from the local stability, which would have been the misleading number to use. 0.40 sits 0.1329 below the lowest run observed anywhere and about 2.7 times the observed cross-runner spread, and it is deliberately conservative because the runner-side sample is only two runs. It still fails anything a quarter worse than today. Raise it only with fresh runs recorded here; a floor above the lowest run it cites is refused by scripts/check_live_agent_floor.py, because that floor would red every run from the day it landed."
+}