Agent Evaluation Spec
Status
Draft canonical spec. Companion to Synedrix OS - Agent Spec. Supersedes: synedrix-os-agent-evaluation-spec-v0.1.md. Related artifacts: Synedrix OS - Agent Spec, Synedrix OS - Agent Runtime Policy Spec, Synedrix OS - Platform Architecture & Tech Stack, Synedrix OS - Workflow Contract Spec, Synedrix OS Observability Metrics Spec.
Purpose
This spec defines how a Synedrix OS agent is tested, scored, and approved across three quality dimensions: output quality, policy compliance, and operational health.
Synedrix OS separates LLM engineering observability (Langfuse), product and behavioural analytics (PostHog), and operational monitoring (Grafana/Prometheus) into distinct layers. The evaluation framework maps directly onto those layers rather than collapsing all quality signals into one score.
Evaluation is a first-class operating concern in Synedrix OS. Agents without declared evaluation suites must not graduate from draft to active status in the registry.
Three evaluation dimensions
1. Output quality (Langfuse)
Answers: Is the agent producing correct, coherent, and on-policy outputs?
Langfuse owns prompt versioning, LLM trace capture, token and cost attribution, evaluations, and quality scoring.
Types of output quality checks:
- Factual correctness — does the output match ground truth for known inputs?
- Schema compliance — does the output match the declared
output_schemain the agent contract? - Confidence calibration — is stated confidence consistent with actual accuracy?
- Reasoning coherence — does the reasoning support the conclusion?
- Hallucination detection — are claims grounded in the provided context?
- Policy instruction adherence — does the output follow the safety and governance overlays in the prompt policy?
2. Policy compliance (orchestration + audit layer)
Answers: Is the agent operating within its authority boundary and governance constraints?
Types of policy compliance checks:
- Authority boundary checks — did the agent attempt actions outside its declared authority?
- Approval gate compliance — did it correctly flag approval-required actions rather than proceeding autonomously?
- Side-effect compliance — did it produce only declared side effects?
- Escalation compliance — did it escalate correctly when conditions required it?
- Tool permission compliance — did it invoke only tools within its declared
tool_permissions? - Scope compliance — did it stay within its declared memory access scope?
3. Operational health (Grafana/Prometheus + Langfuse)
Answers: Is the agent performing reliably within cost and latency budgets?
- Latency SLO compliance — is p50/p95/p99 latency within
latency_slo_ms? - Token budget compliance — is average usage within declared budgets?
- Error rate — proportion of invocations ending in failure or escalation.
- Retry rate — high rates indicate model or tool instability.
- Circuit breaker open rate — how often does the circuit breaker open?
- Cost per invocation — within declared budget?
- Fallback rate — how often does the agent degrade to fallback model or rules-only mode?
Observability metric families as evaluation inputs
The following metric families are defined in Synedrix OS Observability Metrics Spec and are available as inputs to evaluation suites and promotion gates. Each family is classified as blocking(suite failure prevents promotion) oradvisory (informs review but does not block promotion alone). The defaults below are OS-floor values; domain packs and business instances may tighten but not relax them.
| Metric family | Spec section | Scope | Default gate | Blocking? |
|---|---|---|---|---|
Retrieval quality (retrieval_f1_at_k, retrieval_quality_score) | §7.1 | Invocation | Required for retrieval-backed agents | Advisory |
Groundedness / hallucination (hallucination_probability, hallucination_flag, faithfulness_score) | §7.2 | Invocation | Blocking for interface and high-risk agents | Blocking |
Cost and drift (cost_drift_flag, cost_drift_pct, total_cost_usd) | §7.3 | Invocation | Advisory; triggers model routing review | Advisory |
Semantic validity (semantic_validity_score, semantic_validity_flag) | §7.4 | Invocation | Blocking when structured output feeds downstream automation | Blocking |
Multi-turn coherence (coherence_score, goal_alignment_score) | §7.6 | Conversation | Blocking for interface agents only | Blocking (interface agents) |
Tool reliability (tool_success_rate, p95_latency_ms) | §7.7 | Tool aggregate | Advisory; feeds anomaly detection | Advisory |
Risk alignment (risk_alignment_score, risk_policy_violations_count) | §7.8 | Invocation | Blocking for medium, high, and critical risk tiers | Blocking |
Guardrail effectiveness (guardrail_true_positive_rate, guardrail_false_positive_rate) | §7.9 | Guardrail aggregate | Required before guardrail moves from monitor to enforce mode | Advisory |
User trust and satisfaction (user_trust_score, trust_score_30d_avg, trust_trend_30d) | §7.10 | Conversation / agent | Promotion gate for interface agents; MUST NOT be used as per-call runtime veto | Advisory |
Promotion gate examples using observability metrics
High-risk or critical agent (risk_tier: high or critical)
eval_suite:
suite_id: eval-risk-alignment-blocking
agent_id: <agent_id>
dimensions: [policy-compliance, observability-metrics]
blocking: true
pass_thresholds:
risk_alignment_score_min: 0.95
risk_policy_violations_count_max: 0
hallucination_probability_max: 0.15
semantic_validity_flag_allowed: falseInterface agent (user-facing)
eval_suite:
suite_id: eval-interface-trust-gate
agent_id: <agent_id>
dimensions: [output-quality, observability-metrics]
blocking: true # blocks promotion; not a per-call runtime veto
pass_thresholds:
trust_score_30d_avg_min: 0.70
coherence_score_min: 0.75
hallucination_probability_max: 0.20Evaluation suite schema
eval_suite:
suite_id: # e.g. eval-policy-guard-regression
agent_id:
description:
dimensions: # output-quality | policy-compliance | operational-health | observability-metrics
run_trigger: # on-deploy | scheduled | on-prompt-change | on-demand | on-model-change
langfuse_dataset_ref:
pass_thresholds:
output_quality_min: # 0.0–1.0
policy_compliance_min: # 0.0–1.0
latency_p95_max_ms:
error_rate_max:
token_budget_compliance:
blocking: # true = deployment blocked if suite fails
notification_targets:
regression_sensitivity: # strict | standard | permissiveEvaluation triggers
| Trigger | Description | Recommended for |
|---|---|---|
on-deploy | Run full suite before agent goes active | All agents |
on-prompt-change | Run output quality suite on any prompt layer version change | All LLM-backed agents |
scheduled | Periodic regression against live or shadow traffic | Production agents |
on-demand | Manual trigger for debugging or incident review | All agents |
on-model-change | Triggered when primary or fallback model version changes | All agents using managed models |
Promotion gates
| Transition | Required gate |
|---|---|
draft → active | All blocking: true suites must pass |
| Prompt version bump | Output quality suite must pass |
| Model version change | Full suite must pass |
deprecated → retired | Replacement agent must be active with passing suites |
suspended → active | Full suite plus incident review must pass |
Promotion gates are enforced by the registry and must not be bypassable by domain packs or business instances.
Evaluation guide: interpreting scores and results
The sections above define the schema. This section is for whoever is looking at a suite’s actual output and needs to know what a number means, whether a “pass” can be trusted, and what to do about a failure.
How each score is produced
A pass_thresholds entry is not one uniform kind of measurement — three different production methods feed this framework, and they carry different weight:
- Deterministic checks (exact-match, schema-validation, substring/regex-style assertions). No model judgment involved — the cheapest, most objective signal available, and the right tool for locking in a regression against a specific, already-diagnosed failure (a known-bad answer shape, a stale fact reappearing). A deterministic check either passed or it didn’t; there is no calibration question to ask about it.
- LLM-as-judge checks (
coherence_score,hallucination_probability, and similar 0.0–1.0 quality dimensions). A second model scores the agent’s output against the grounding it was given. The judge must never be the same model or checkpoint being evaluated — a model does not grade its own work, and doing so silently inflates every score it produces. Judge scores are a proxy for quality, not quality itself: treat a single run’s judge score as informative, not authoritative, until the judge itself has been spot-checked against a few outputs a human actually read. A judge attemperature: 0is not guaranteed to score the same answer the same way twice, and this is not theoretical: observed directly onos-agt-009’s live on-the-fly scoring — two runs of a near-identical multi-turn conversation, both correctly declining an unretrieved fact with the same shape of answer, both with the same 10 retrieved sources passed to the judge, scoredcoherence_score: 0.80 / hallucination_probability: 0.20on one run andcoherence_score: 0.00 / hallucination_probability: 1.00on the other. Quantized, batched inference backends can be genuinely non-deterministic even attemperature: 0(floating-point batching effects), and the answer being judged is rarelytemperature: 0itself, so small wording differences between runs can tip a borderline judgment either way. Do not read one low judge score in isolation as proof of a regression — check whether it replicates before treating it as a finding, and treat a suite’s mean across several items as more trustworthy than any single item’s score. Closing this gap for real requires a judge-calibration pass (a small set of answers with known-correct human labels, checked against how consistently the judge agrees with them) — real, scoped work, not a side effect of building the suite itself. - Production ground truth (
trust_score_30d_avgand similar metrics sourced from real end-user signals — e.g. thumbs up/down feedback captured as a score on the originating trace). This is the only one of the three that is not a proxy: it is real users reacting to real answers. It is also the slowest to accumulate and the most sensitive to sample size — see below.
Reading a score
coherence_score,trust_score_30d_avg, and similar dimensions: higher is better (0.0–1.0).hallucination_probabilityand similar risk dimensions: lower is better (0.0–1.0) — this is a probability of a problem, not a quality score, and pass thresholds for it are expressed as a_max, not a_min. Do not read a highhallucination_probabilityas good the way a highcoherence_scoreis good.- A
_30d_avg-suffixed metric is a rolling window, not a single measurement. A “PASS” computed from a handful of events (early in an agent’s life, or right after a quiet period) is provisional, not durable — report the sample size (n) alongside the average itself, and re-check once real traffic has actually accumulated over the full window. A pass onn = 5and a pass onn = 500are not the same claim.
Reading the gate
blocking: true thresholds combine with AND, not an average — every threshold in the suite must be met simultaneously for the lifecycle transition to proceed (see “Promotion gates” above). A suite that is strong on coherence_score but fails hallucination_probability_max has not “mostly passed”; it has failed the gate.
A suite may reasonably run with blocking: false at first, while it is being stood up and its own thresholds are being sanity-checked against real output — but per this spec’s invariants, no agent may remain at active status indefinitely without at least one blocking: true suite actually enforced.
Routing a failure to the right fix
When a suite fails, the fix is not always where it looks like it is. Before spending effort, classify the failure by root cause and let that classification choose the fix — cheapest and most reversible first:
| Root cause | What it usually means | Where to fix it |
|---|---|---|
| Retrieval | The agent never had the right context to answer from — a chunking, ranking, or pinning problem, not a generation problem. | Fix retrieval/data: chunking, CANONICAL_FACTS-style pinning, re-ranking. Cheapest and most common historically — both real production incidents on record for os-agt-009 before ADR-OS-003 were retrieval problems, not model problems. |
| Model-behavior | The agent had the right context but the generation model mishandled it in a known, reproducible way (formatting drift, repetition, leaked internal tokens, unreliable tool-call judgment). | Fix at the decoding/serving layer first: structured/guided decoding, tool-choice forcing, sampling parameters. Try this before ever considering a weight change. |
| Reasoning | The agent had the right context and produced well-formed output, but the actual reasoning connecting context to answer was wrong — a genuine capability gap. | The one category where a stronger/different model, or fine-tuning the agent’s own already-authored behavior, is actually the correct lever — see ADR-OS-003 §4’s decision-boundary rule on what fine-tuning may and may not be used for. |
| Hallucination | Usually a retrieval problem wearing a generation-layer costume: the context needed to answer correctly was missing, thin, or contradictory, and the model filled the gap with plausible-sounding invention. | Check retrieval first, same as the Retrieval row, before concluding the model itself is untrustworthy. |
| None | The item passed. | No action. |
Do not reach for the most expensive, hardest-to-reverse fix (fine-tuning, a model swap) before confirming — with evidence, not assumption — that the failure isn’t actually a retrieval or decoding-layer problem in disguise. This is the same evidence-gated ordering ADR-OS-003 adopts for os-agt-009, generalized here as the intended reading of any suite built against this spec.
Reference implementation
os-agt-009 (General Chat Agent)’s Stage 0 suite, built per ADR-OS-003, is the first concrete instance of this schema in the platform: a suite definition, a golden set of items tagged by the same root-cause categories as the table above, an independent judge, and a runner that also pulls trust_score_30d_avg from real production feedback rather than estimating it. Use it as the reference pattern when standing up a suite for a new agent. Run results are recorded as scores on each answer’s own trace; this repository is documentation-only and does not itself hold point-in-time run data.
Policy compliance scoring
Policy compliance is binary per check. Aggregate compliance rate:
compliance_rate = compliant_invocations / total_invocationsA compliance rate below policy_compliance_min must:
- Trigger an immediate alert to declared
notification_targets. - Emit an
agent.evaluation.compliance-breachevent to the audit layer. - Flag the agent for review before next deployment.
High-risk agents (risk_tier: high or critical) must maintain a compliance rate of 1.0. Any breach is treated as a blocking incident.
Evaluation vs observability
| Concern | Layer | Answers |
|---|---|---|
| Output quality evaluation | Langfuse | Is the model output correct and on-policy? |
| Policy compliance evaluation | Audit + orchestration | Is the agent within its authority? |
| Operational health | Grafana/Prometheus + Langfuse | Is the agent reliable and cost-effective? |
| Behavioural analytics | PostHog | How is the agent being used? What workflows invoke it most? |
Langfuse answers model-level questions. PostHog answers product and workflow-level questions. Grafana/Prometheus answers infrastructure and SLO questions.
OS vs domain pack vs business instance split
| Concern | Synedrix OS | Domain Pack | Business Instance |
|---|---|---|---|
| Evaluation framework and suite schema | Owns. | Declares domain-specific suites and datasets. | Sets instance-level targets and notification targets. |
| Promotion gate enforcement | Owns — not bypassable. | Contributes required suites per agent. | Cannot waive blocking suites. |
| Pass thresholds | Defines minimum floor values. | May set stricter thresholds per agent class. | May tighten; cannot lower below floor. |
| Compliance scoring | Owns compliance rate calculation and alerting model. | Declares applicable compliance checks per agent.[ | Sets alert routing and incident response owners. |
Recommended database tables
agent_eval_suites — suite definitions per agent
agent_eval_runs — historical record of every suite execution
agent_eval_results — per-check results within a run
agent_eval_promotion_gates — gate outcomes per lifecycle transition
agent_eval_compliance_events — immutable audit log of compliance breachesInvariants
- Every agent must have at least one
blocking: trueeval suite before transitioning toactive. - Policy compliance checks for
risk_tier: highorcriticalagents must be blocking and require 1.0 compliance. - Promotion gate enforcement is owned by the OS registry and cannot be bypassed.
- Every compliance breach must emit an auditable event.
- Evaluation suites must be versioned with immutable pass/fail history.
Versioning
- Version: 0.2
- Supersedes: synedrix-os-agent-evaluation-spec-v0.1.md
- Related: Synedrix OS - Agent Spec, Synedrix OS - Agent Registry Spec, Synedrix OS - Platform Architecture & Tech Stack, Synedrix OS - Workflow Contract Spec, Synedrix OS Observability Metrics Spec
Related Documents
Agent Specifications
- Synedrix OS - Agent Spec — Full agent anatomy; agents must pass evaluation before moving to active status.
- Synedrix OS - Agent Registry Spec — Registry schema; lifecycle state transitions (draft → active) require passing blocking eval suites.
- Synedrix OS - Agent Registry — OS agent definitions; all twelve agents are subject to this evaluation framework.
Database and Tech Stack
- Synedrix OS - Agent DB Schema — Relational schema; the evaluation/quality table group persists eval suite results and promotion gate records.
- Synedrix OS - Platform Architecture & Tech Stack — 12-platform stack; Langfuse implements output quality evaluation, Grafana+Prometheus implements operational health evaluation.
Governance
- Synedrix OS - Workflow Contract Spec — Workflow standard; policy compliance evaluation checks agent behavior against workflow contract requirements.
- Synedrix OS - Core Principles — Principle 4 (Governance before execution) and Principle 10 (Trust is the real product) motivate this evaluation framework.
Observability Metrics
- Synedrix OS Observability Metrics Spec — Canonical metric definitions; defines the
risk_alignment_score,semantic_validity_score,hallucination_flag, anduser_trust_scorefamilies that promotion gates in this spec consume as blocking or advisory signals.
Synedrix OS · Agent Evaluation Spec · August 2026