Engineering an Evaluation Control Plane for Production AI Agents
How to build continuous agent evaluation: separate execution and control planes, trace-based assertions, golden datasets, CI gates, lifecycle testing and a launch checklist.
This article is published in English.
Sources: Engineering Reliable AI Agents: Building Production Evaluation Pipelines That Scale
Judging an agent by its final answer says little about whether it behaved correctly, safely or efficiently. An autonomous agent invents its execution path at runtime, so testing is closer to a distributed systems problem than to checking a function's return value. The principle that follows is that production AI systems should be evaluated by what they do during execution, not just by what they say at the end.
That raises a practical question: how is an evaluation pipeline for autonomous systems actually engineered? Conventional software leans on unit and integration tests. Agentic systems need continuous evaluation of reasoning trajectories, tool interactions, safety boundaries, operating efficiency and behavioral drift over time. Evaluation turns into a production service of its own and stops being a one-off testing activity.
What follows turns those ideas into a design: a production-grade evaluation platform built from golden datasets, trajectory replay, deterministic contract tests, LLM-as-a-judge scoring, chaos engineering, continuous regression analysis and production telemetry.
An evaluation control plane
Evaluation should not be a post-processing step that grades finished answers. In production it belongs to the control plane that governs autonomous execution. Each planning decision, tool call, state transition, policy check and external side effect should emit engineering signals that can be checked before, during and after the fact. The aim is not to grade model output but to confirm, continuously, that execution respects deterministic system invariants.
The design keeps the execution plane strictly apart from the control plane. The language model, large or small, owns planning and decisions. The surrounding platform owns execution, state, policy enforcement, observability, evaluation and release governance. Every layer has a defined contract, so failures can be isolated, replayed and analyzed one at a time without treating the model as the source of truth.
Two cooperating planes result. The execution plane handles autonomous reasoning and deterministic side effects. The control plane observes, validates, governs and continuously improves that execution. Only execution events cross the boundary between them.
The agent runtime owns execution
The runtime builds and runs the reasoning graph for a single request. It covers planning, context assembly, retrieval orchestration, tool selection, intermediate reasoning and execution state. It should be treated as ephemeral compute that runs workflows but holds no durable business state. Every decision that influences later behavior must be emitted as a structured execution event before control moves on. The runtime therefore stays horizontally scalable, stateless and disposable, and a run can be replayed independently of the machine that first performed it.
The tool layer owns deterministic side effects
The runtime never touches production infrastructure directly. Each external capability is offered through a deterministic execution layer with strongly typed contracts, MCP being one example. That layer validates schemas, authenticates callers, authorizes actions, enforces execution policy, applies retry budgets, guarantees idempotency where needed and keeps infrastructure failures separate from reasoning failures. It also marks the system's trust boundary: the model proposes an intent, and the execution layer decides whether that intent may safely become a side effect.
The telemetry layer owns the canonical record
Every state change that contributes to autonomous behavior is captured as immutable, append-only telemetry. Planning decisions, retrievals, model calls, tool calls, retries, latencies, token use, policy decisions and external responses are all stored as structured traces with stable identifiers. This record is the canonical account of what the system did. It supports deterministic replay, forensic debugging, causal analysis and long-term reliability measurement, all without relying on the generated text.
The evaluation layer owns behavioral verification
Evaluation reads execution telemetry and not model output alone. It verifies that behavior satisfies engineering invariants across correctness, safety, efficiency, policy compliance, resource use and business goals. Higher-level evaluators take whole trajectories to judge reasoning quality, planning efficiency, recovery behavior and fit with business objectives. The layer outputs engineering signals that quantify behavioral reliability, and linguistic quality is not what it measures.
The evaluation repository owns institutional memory
Evaluation artifacts outlive individual runs. The repository keeps growing with typical workloads, failures seen in production, corrections made by people, adversarial prompts, saved trajectories and the regression baselines of earlier releases. It becomes the reference for benchmarking later releases, reproducing old failures, detecting drift and keeping fixed defects from returning. Reliability improves because operational experience is steadily converted into executable evaluation assets.
The deployment control plane owns release governance
Releases are decided by evaluation, not by code changes alone. Any change to prompts, orchestration logic, retrieval strategy, model version or execution policy automatically replays representative evaluation suites before promotion. A candidate advances only if behavioral quality, safety constraints, latency budgets and regression thresholds stay within set limits. Deployment becomes a policy decision backed by continuous behavioral verification and not a manual review of outputs.
Language models belong to the execution plane and not to the control plane. Reasoning may stay probabilistic, but execution, state management, policy enforcement, evaluation and release governance must remain deterministic, observable and independently verifiable.
Building the pipeline
Evaluating an agent is no single test. It works as an ongoing feedback system that runs from development through release and into live operation. Mature teams treat it as an extension of the delivery pipeline and not as a separate benchmarking exercise. The goal is to keep confirming that autonomous behavior remains reliable, efficient, safe and reproducible as the system changes, and getting one correct answer is only part of that.
Each request follows one lifecycle. A representative workload, real or mocked, runs through the agent. The full execution trace is captured and judged with deterministic assertions and semantic judges. Engineering metrics are derived from the run, and newly discovered failure modes are promoted into the evaluation repository so they join future regression suites. Production traffic keeps strengthening later releases.
The pipeline starts from a set of workloads drawn from production traffic, past incidents, customer support cases and operational edge conditions. These scenarios do not prescribe exact responses. They describe expected system behavior, which tools should or should not be called, and the operating constraints that every run must meet. Here is an example scenario:
dataset:
id: refund-policy-v2
input:
query: "Refund my cancelled subscription."
expected_tools:
- customer.lookup
- refund.policy
forbidden_tools:
- payment.capture
constraints:
max_latency_ms: 3000
max_tool_calls: 3
success:
task_completed: true
Unlike a conventional unit test, a scenario specifies expected behavior and not expected wording.
Each run yields far more than a final response. It emits a structured trace covering planning decisions, retrieval events, tool calls, retries, latency, token consumption, policy decisions and infrastructure metadata. That telemetry is the canonical record of autonomous behavior and the main input to evaluation. An OpenTelemetry-style span looks like this:
{ "trace_id": "9ab3...",
"span": "tool.crm.lookup",
"latency_ms": 214,
"tokens_input": 684,
"retry_count": 0,
"status": "success"
}
Any execution should be replayable from telemetry alone.
Evaluation then converts traces into engineering signals. Deterministic assertions test objective invariants: whether schemas are valid, authorization limits hold, latency stays in budget, retries stay capped and infrastructure contracts are respected. Semantic evaluators judge reasoning quality, factual consistency, instruction following and task completion. Human reviewers concentrate on ambiguous or business-critical cases where automated confidence falls short.
Consider two trajectories for a refund request. In the first, the planner calls the retriever, then the refund API, and finishes: correct and efficient. In the second, the planner calls the retriever, retries twice, then reaches the refund API and finishes: still correct, but with excessive retries, higher latency and increased cost. Two runs can give the customer the same visible result while differing greatly in engineering quality. Reliable systems evaluate the path and not just the destination.
Finally the loop closes. Every production incident, failed evaluation, customer escalation or newly found edge case is promoted into the evaluation repository and folded into future regression suites. Over time, experience becomes executable engineering knowledge, so fixed failures cannot quietly return after prompt edits, orchestration changes or model upgrades. A mature platform turns traces into measurable signals, signals into engineering decisions, and decisions into permanent regression tests.
Testing across the development lifecycle
Building the platform is only the first step. The bigger task is wiring evaluation into the development lifecycle so that autonomous behavior is validated as the system evolves. Each stage addresses a different class of risk and raises confidence step by step before changes reach production.
Local development is about deterministic correctness. Ordinary unit and integration tests cover the orchestration code, the retrieval pipelines, the memory interfaces, the tool contracts, the policy checks and the authorization limits, all before a model enters the picture. Catching deterministic failures early keeps debugging simple, and model behavior is judged only once the surrounding infrastructure is known to work.
Pull requests trigger a representative evaluation suite in continuous integration. The suite replays golden datasets, runs deterministic assertions over infrastructure contracts, and applies behavioral evaluators that flag any slip in reasoning quality, tool choice, latency or safety before the merge happens:
name: Agent Evaluation
on:
pull_request:
jobs:
evaluate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Replay Evaluation Suite
run: deepeval test run evaluation/
- name: Fail on Regression
run: promptfoo eval --config promptfooconfig.yaml
Pull requests should be judged on behavior and not only on source code.
Staging checks changes under realistic conditions. Historical traces are replayed against updated prompts, orchestration, retrieval strategies and model versions to confirm that trajectories that used to succeed still do. A candidate moves forward only if behavioral quality stays within agreed thresholds.
Production stops being a testing ground and becomes a continuous verification environment. Autonomous execution is watched through live telemetry, distributed traces, feedback from users, safety signals and drift detectors. Each incident becomes a candidate regression test. Production should never be where a failure is first discovered, yet it should always be where future regression tests come from.
Metrics that matter
No one metric captures the reliability of an autonomous system. Production evaluation balances competing objectives. Better reasoning may raise latency and cost, and aggressive throughput tuning can reduce safety or task completion. Correctness is therefore only one dimension next to reliability, latency, cost, quality and safety. Teams set an operating budget for each and treat a regression in any dimension as a release blocker. Reliable agents are the ones that stay within acceptable budgets on every critical dimension, and maximizing a single number is not the goal.
The tooling picture
No single product delivers production-grade evaluation. Teams assemble it from specialized capabilities covering instrumentation, behavioral evaluation, production observability and continuous regression testing. The ecosystem changes quickly, but the pattern holds: instrumentation captures execution, evaluation converts it into signals, observability measures live behavior, and regression testing stops old failures from coming back. Individual tools come and go while those four capabilities stay essential. Reliability comes from engineering capabilities and not from any particular tool.
A pre-launch checklist
Before an autonomous agent goes into production, a team should be able to answer yes to each of these.
Structure
- Is the model itself stateless?
- Is operational state kept outside it?
- Are execution graphs bounded?
- Are retry budgets and deadlines enforced?
- Are all tool interfaces deterministic?
Visibility
- Can any run be replayed?
- Does each tool call emit structured telemetry?
- Can reasoning trajectories be inspected from start to end?
- Are trace IDs carried through every component?
Evaluation
- Do the golden datasets mirror real production scenarios?
- Does each production bug turn into a regression test?
- Are prompt, model and orchestration changes evaluated before rollout?
- Have the LLM judges been calibrated against human reviewers?
Security
- Do prompt injection tests run automatically?
- Are authorization policies checked by an independent mechanism?
- Is memory isolated between users?
- Is leakage of personal or sensitive data monitored continuously?
Resilience
- Do chaos experiments run as part of every release?
- Does the agent bounce back when a tool fails?
- Is drift measured and watched around the clock?
- Can autonomous actions be undone safely?
If any question cannot be answered with confidence, the agent is still a prototype and not production infrastructure. Evaluation is also not a separate service. It is built into the execution pipeline so that each agent interaction generates telemetry, quality signals and future regression data automatically.
Where this leaves a team
Reliable agentic systems need more than scored outputs. They need a continuous evaluation platform that verifies autonomous behavior across the whole lifecycle. Seasoned distributed-systems engineers will recognize the habits: instrument each run, check deterministic contracts, replay representative workloads, watch production, and stop regressions ahead of release.
The platform rests on a few repeatable capabilities. Traces are the canonical record. Representative workloads grow into regression suites. Deterministic assertions and semantic evaluators produce measurable signals. CI/CD uses those signals to gate releases, while production telemetry keeps feeding new lessons back into the repository.
As agents grow more autonomous, the effort moves away from polishing prompts and toward constructing tighter feedback loops. A team able to watch, score, replay and refine autonomous behavior over and over can keep changing its system with confidence, no matter which orchestration framework or foundation model arrives next.