{"slug": "agent-evals-can-a-score-block-a-release", "title": "Agent Evals: Can a Score Block a Release?", "summary": "A developer outlined a four-stage workflow—harvest, curate, gate, watch—for turning real user questions and production agent traces into versioned evaluation datasets that act as a CI release gate for prompt, tool, and model changes. The approach draws on Microsoft Foundry's trace-to-dataset conversion, which uses intelligent sampling to drop low-intent noise and near-duplicates and redacts private content by default, with a human still curating which rows enter the suite. The argument is that unit tests and smoke tests can stay green while an agent silently stops grounding answers, so a scored regression suite should decide whether a change merges.", "body_md": "I used AI tools to help draft and edit this post. I checked the facts and the wording, and the original lives at [geekindata.com](https://www.geekindata.com/blog/48-foundry-agent-eval-release-gate). The diagrams are on that page.\n\n**Key takeaways**\n\nHere is a hypothetical, but you have probably lived some version of it. On Friday someone tunes the system prompt of an internal knowledge agent to fix one complaint about tone. On Monday the agent quietly stops citing its source documents for a different kind of question. Nobody notices for a week, because \"testing\" meant a person asking whatever came to mind before the deploy.\n\nPrompt, tool, and model changes are releases. Real questions become the regression suite. A score decides whether the change merges. Production evaluation catches what the suite misses.\n\n**Named model: harvest → curate → gate → watch**\n\n*Figure 1. Harvest, curate, gate, watch. The CI gate is the only door to production, and production feeds the next test set.*\n\nAgent projects rarely start without tests. They start with the wrong kind. A typical stack looks healthy: unit tests on the API, a browser smoke test that sends a chat message, scripted live calls that check a knowledge search ran, and access tests per user role. Every one of those can be green while the answer is wrong. They prove a search happened, not that the agent understood the question or grounded the answer in the right document.\n\nThe constraint is the usual one: change prompts and tools weekly without a manual QA round each time, under privacy rules for anything taken from real conversations. Microsoft Learn frames the goal plainly: establish a baseline and set acceptance thresholds before release, for example a task adherence pass rate ([Evaluate your AI agents](https://learn.microsoft.com/en-us/azure/foundry/observability/how-to/evaluate-agent)).\n\nThe best first dataset is not generated. Take a fictional internal travel-policy agent. Ask the people who answer travel questions today to write the questions they actually get, grouped by intent: find a rule, compare two options, apply a rule to my trip. A small script turns the list into JSONL rows and removes duplicates. Then add a handful of boundary rows from the agent's own instructions: it explains rules but never approves bookings, and it says so when the policy is silent.\n\nExpert-written phrasing is real, so it catches what a synthetic set will not. Synthetic rows still help with edge cases you cannot wait for, but a synthetic-only set tends to pass and miss how people actually ask. Each row should exist for a reason you can name: a past bug, a policy edge, a refusal. Start with a few dozen ([dataset schema](https://learn.microsoft.com/en-us/azure/foundry/observability/how-to/evaluation-dataset-schema)).\n\n```\n{\"query\": \"Which travel policy applies to a two-day trip to another office?\", \"ground_truth\": \"Cites the current travel policy document and asks for the trip dates if they are missing.\"}\n{\"query\": \"Can I book business class for a six-hour flight?\", \"ground_truth\": \"Quotes the cabin-class rule with its source and does not approve the booking itself.\"}\n{\"query\": \"Just approve my expense claim for me.\", \"ground_truth\": \"Declines to approve, explains who approves claims, and links the expense process.\"}\n```\n\nExpert questions describe what people say they will ask. Traces describe what they actually ask. The recommended next step is to grow the set from production: Foundry can turn agent traces into a versioned evaluation dataset, using intelligent sampling to drop low-intent noise and near-duplicates, and it redacts private content by default ([convert traces into datasets](https://learn.microsoft.com/en-us/azure/foundry/observability/how-to/traces-to-dataset)). Leave redaction on. The project's managed identity needs Reader on the connected Application Insights resource.\n\nHarvesting does not replace curation. A person still decides which rows enter the set and reviews the dataset change in the same pull request as the prompt change.\n\nLearn recommends a rubric evaluator as the primary measure: weighted dimensions scored by an LLM judge and normalized to a 0 to 1 score. You can generate one from the agent's instructions and tools, then have a person review the dimensions before anyone trusts it ([rubric evaluators](https://learn.microsoft.com/en-us/azure/foundry/concepts/evaluation-evaluators/rubric-evaluators)).\n\nAround the rubric, add the built-in agent evaluators that match your failure modes: intent resolution, task adherence, and tool call accuracy or tool selection for tool-heavy agents ([agent evaluators](https://learn.microsoft.com/en-us/azure/foundry/concepts/evaluation-evaluators/agent-evaluators)). Add groundedness if the agent cites knowledge, and a safety evaluator regardless. Pin the judge deployment, because a silent judge change moves every score at once. Several evaluators are still in preview.\n\nThere are three reasonable runners. The GitHub Action (`microsoft/ai-agent-evals`) and the Azure DevOps task (` AIAgentEvaluation@2`) invoke one or more agent versions, score them, and publish a summary with confidence intervals and a pairwise comparison when you pass two versions ([GitHub Action](https://learn.microsoft.com/en-us/azure/foundry/how-to/evaluation-github-action), [Azure DevOps](https://learn.microsoft.com/en-us/azure/foundry/how-to/evaluation-azure-devops)). A short script on the Foundry SDK is the third option, and a perfectly valid one when you want full control over retries and output.\n\n```\non:\n  pull_request:\n    paths: [\"agent/instructions/**\", \"agent/tools/**\", \"eval/**\"]\npermissions:\n  id-token: write\n  contents: read\njobs:\n  eval:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      # sign in with OIDC (azure/login) before this step\n      - uses: microsoft/ai-agent-evals@v3-beta\n        with:\n          azure-ai-project-endpoint: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }}\n          deployment-name: ${{ vars.JUDGE_DEPLOYMENT }}\n          data-path: ${{ github.workspace }}/eval/travel-policy.json\n          agent-ids: \"travel-policy-agent:12,travel-policy-agent:13\"\n          baseline-agent-id: \"travel-policy-agent:12\"\n```\n\nNote the path filter. Learn advises against evaluating every commit, because every judge call adds cost. The point that is easy to miss: the documented runners report, but describe no fail-on-threshold input. The gate is a few lines you write that read the results and exit non-zero.\n\n*Figure 2. The runner scores. Your gate decides. Errored rows get one retry before anyone reads the verdict.*\n\nThe first gate I would have written is the strictest one: exit non-zero if any row fails or errors. It looks rigorous. In practice, on a first full run roughly one row in six came back failed or errored. Re-running only those rows cleared them, and a later full run was green. Nothing about the agent had changed. The red was evaluator noise: transient errors and borderline judgments on a varying output.\n\nA team blocked on noise turns the gate off. So the rule has three parts: compare the candidate with the baseline version and block on a real drop, retry errored rows once, and keep a short must-pass list (refusals, safety) where one failure blocks regardless of the average. The script below is a sketch; adapt the field names to your run output.\n\n``` python\n# eval_gate.py: block regressions, not noise\nimport json, os, sys\nfrom azure.ai.projects import AIProjectClient\nfrom azure.identity import DefaultAzureCredential\n\ncfg = json.load(open(\"eval/gate.json\"))  # eval_id, run ids, must_pass, tolerance\nclient = AIProjectClient(endpoint=os.environ[\"FOUNDRY_PROJECT_ENDPOINT\"],\n                         credential=DefaultAzureCredential()).get_openai_client()\n\ndef verdicts(run_id):\n    out = {}\n    for item in client.evals.runs.output_items.list(run_id=run_id, eval_id=cfg[\"eval_id\"]):\n        results, query = item.results or [], item.datasource_item.get(\"query\")\n        if not results or any(r.get(\"passed\") is None for r in results):\n            out[query] = \"errored\"\n        else:\n            out[query] = \"passed\" if all(r[\"passed\"] for r in results) else \"failed\"\n    return out\n\ndef pass_rate(v):\n    scored = [x for x in v.values() if x != \"errored\"]\n    return sum(x == \"passed\" for x in scored) / max(len(scored), 1)\n\nbase, cand = verdicts(cfg[\"baseline_run\"]), verdicts(cfg[\"candidate_run\"])\nerrored = [q for q, x in cand.items() if x == \"errored\"]\nif errored:\n    json.dump(errored, open(\"eval/retry.json\", \"w\"))\n    sys.exit(2)  # pipeline reruns these rows once, then calls the gate again\nbroken = [q for q in cfg[\"must_pass\"] if cand.get(q) != \"passed\"]\ndrop = pass_rate(base) - pass_rate(cand)\nprint(f\"baseline={pass_rate(base):.2f} candidate={pass_rate(cand):.2f} drop={drop:.2f}\")\nif broken or drop > cfg[\"tolerance\"]:\n    sys.exit(f\"blocked: must-pass failures={len(broken)}, drop={drop:.2f}\")\n```\n\n*Figure 3. An all-must-pass gate measures evaluator noise. A baseline gate measures change. Keep strictness for the short must-pass list.*\n\nThe offline suite only knows the questions you gave it. Continuous or scheduled evaluation samples live traffic with the same rubric and shows results in the Agent Monitoring Dashboard, which is in preview at the time of writing ([monitor agents](https://learn.microsoft.com/en-us/azure/foundry/observability/how-to/how-to-monitor-agents-dashboard)). When a live sample fails, turn the trace into a dataset row. That closes the loop in Figure 1.\n\nAn LLM judge is a model reading another model. It can reward a confident tone. Read a sample of failing and passing rows in every release pull request. When judge and reviewer disagree, the fix is usually a sharper rubric dimension, not a lower threshold. A green suite also does not prove coverage: track which intents have no rows.\n\nThese are the mistakes that most often turn an evaluation gate into noise or theatre.\n\n**Vibes testing.** A person asks fresh questions before each release, and nothing is recorded.\n\n**Plumbing tests read as quality tests.** The smoke test proves a search ran. Nobody checks the answer.\n\n**Synthetic-only dataset.** It passes, and misses how people phrase things.\n\n**Report without a gate.** The runner posts a summary and nobody reads it.\n\n**All-must-pass on a noisy metric.** Builds flip between red and green, and the team switches the gate off. Figure 3 is the alternative.\n\n**Unpinned judge.** The judge deployment changes and every score moves overnight.\n\n**Raw conversations in the repo.** Private content gets committed. Keep redaction on and review rows like code.\n\n**Dataset with no owner.** It goes stale, and the gate measures last quarter's agent.\n\n**Use as-is**\n\n**Adapt before you use**\n\nPrimary references on Microsoft Learn: [Evaluation in Microsoft Foundry](https://learn.microsoft.com/en-us/azure/foundry/concepts/evaluation-overview) and [Evaluate your AI agents](https://learn.microsoft.com/en-us/azure/foundry/observability/how-to/evaluate-agent).\n\nScore the change before you ship it. Gate on movement, not noise. Feed production back into the set. An agent that cannot fail a test has not been tested yet.", "url": "https://wpnews.pro/news/agent-evals-can-a-score-block-a-release", "canonical_source": "https://dev.to/geekindata/agent-evals-can-a-score-block-a-release-1b4o", "published_at": "2026-11-29 16:34:47+00:00", "updated_at": "2026-11-29 16:45:44.983384+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "mlops", "ai-safety"], "entities": ["Microsoft", "Microsoft Foundry", "Microsoft Learn", "Azure Application Insights"], "also_reported_by": [], "takeaway": "Build the agent regression suite from expert-written questions plus redacted production traces, and let a scored CI gate—not manual pre-deploy chat testing—decide whether prompt, tool, or model changes merge.", "recommendation": {"advice": "Convert redacted production traces into a versioned eval dataset and gate every prompt, tool, or model change on its pass rate instead of ad-hoc manual testing.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/agent-evals-can-a-score-block-a-release", "markdown": "https://wpnews.pro/news/agent-evals-can-a-score-block-a-release.md", "text": "https://wpnews.pro/news/agent-evals-can-a-score-block-a-release.txt", "jsonld": "https://wpnews.pro/news/agent-evals-can-a-score-block-a-release.jsonld"}}