A member phoned Swartberg Health Administrators, our fictional South African medical scheme administrator, to complain that the online assistant had told her a scan needed no pre-authorisation. It did. The operations lead asked the engineering team a simple question: which version of the assistant gave that answer, which benefit rule did it read, and is it still giving it to other members? The team had logs. They had a latency dashboard and a monthly token bill. It took them four days to answer, because the logs held the model's text but not the prompt version, the index version or the identifiers of the passages it had retrieved.
That is the engineering gap this part closes. Part 5 of The Enterprise AI Control Plane set out the AgentOps operating model: six planes, named owners and a release bundle. This part is about building it. What goes in the trace, how evaluation runs before and after release, how a change is canaried and rolled back, and which measures tell you the agent is still doing its job.
Three planes, one feedback system
For engineering, the six operating planes collapse into three that you build and wire together.
- Runtime serves requests, as Part 2 described. Its AgentOps job is to emit good telemetry at every step.
- Observability and evaluation stores traces, runs monitors, samples answers for human review and scores each release.
- Continuous improvement turns failures into test cases and moves every change through the offline gate and a canary.
The arrow that matters is the one back into the runtime. If a prompt can be edited in a configuration screen and go live without passing through the gate, the other two planes are decoration.
Design the trace before you need it
Swartberg's four-day investigation was a schema problem. A useful trace answers "what produced this answer, from what evidence, at what cost, and was it any good?"
The OpenTelemetry semantic conventions for generative AI give standard names for much of this. As checked on 18 November 2026, every document in the conventions repository is still at Development status, so names can change. Use them, pin the version you implement and review it when the conventions move. CloudNala's a trace is not an evaluation covers the wider field list and the status history; the table below is the minimum Swartberg now records on every run.
| Question the trace must answer | Field | Standard name, or your own |
|---|---|---|
| Which operation was this? | Operation type | gen_ai.operation.name (for example invoke_agent, chat, retrieval, execute_tool) |
| Which agent and which version? | Agent name and version | gen_ai.agent.name, gen_ai.agent.version |
| Which model was asked for, and which answered? | Requested and served model, provider | gen_ai.request.model, gen_ai.response.model, gen_ai.provider.name |
| Which release bundle was live? | Bundle identifier covering prompt, policy, tools and settings | Your own attribute |
| Which prompt and policy text? | Prompt version, policy rule version | Your own attributes |
| What evidence was retrieved? | Data source, index version, passage identifiers and scores | gen_ai.data_source.id plus your own |
| Which tools ran? | Tool name and call identifier | gen_ai.tool.name, gen_ai.tool.call.id |
| What did it cost? | Input and output tokens, cost estimate, price table version | gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, plus your own cost fields |
| Which conversation and case? | Conversation and case identifiers | gen_ai.conversation.id plus your case reference |
| Was it any good? | Evaluation name, score and label | The gen_ai.evaluation.result event |
Three design choices carry most of the value.
Record the requested and the served model separately. When a gateway falls back to another model, as Part 5 describes, the two differ. If you only store one, a quality drop during a fallback looks like a prompt problem.
Store retrieval evidence as references. Passage identifiers, index version and scores let you replay what the agent saw without copying text into the trace. Swartberg's answer would have pointed straight at last year's benefit schedule, still in the index after the rule changed. Part 4 covers index versioning.
Attach evaluation results to the span they judge. The conventions define a gen_ai.evaluation.result event with an evaluation name, a numeric score and a label such as pass or fail, parented to the operation it evaluated. Quality and telemetry then sit in the same query.
Leave content capture off by default. The conventions make capture of input messages, output messages, system instructions and tool arguments opt-in, and flag them as likely to hold sensitive information. In a medical scheme administrator, the prompt is health information. See do your observability tools store the prompt? before you switch any of it on.
Four evaluation loops, each with a job
Swartberg runs four evaluation loops, and each catches something the others miss.
| Loop | When it runs | What it catches | Gate or signal | Owner |
|---|---|---|---|---|
| Offline evaluation | Every bundle change, before release | Regressions on known cases: wrong benefit rule, missing citation, unsafe tool call | Blocks release if below threshold | Product team with a clinical or benefits reviewer |
| Canary comparison | First days of a release, on a share of live traffic | Problems that only real questions expose | Promote, hold or roll back | Release owner |
| Online monitoring | Continuously, on sampled or all production traces | Drift, rising fallback rate, cost spikes, policy denials | Alerts to on-call and product owner | Platform or SRE team |
| Human review | Daily sample of production answers | Errors that read well, which automated judges and users both accept | Feeds new test cases and the quality KPI | Benefits operations team |
The offline set is the anchor. Build the evaluation system before the agent and evals that gate real work cover how to build one. The engineering rule here is narrower: the offline set is versioned in the same repository as the bundle, and the pipeline refuses to deploy a bundle whose evaluation run is missing or older than the bundle.
Human review is the loop teams cut first and should cut last. Automated groundedness checks are useful at volume, but only after they have been compared with human labels on the same cases. A model-based judge that agrees with your reviewers on, say, seven cases in ten is a weak alarm, not a gate.
Canary and rollback for an agent
Google's SRE Workbook defines canarying as "a partial and time-limited deployment of a change in a service and its evaluation". It also advises comparing the canary population with a control population directly, because whole-service metrics can hide a failing canary, and running only one canary at a time so you can tell which change caused a signal. For agents, both points matter more than usual, because a prompt change and a model change at the same time leave you with no idea which one moved quality.
Here is Swartberg's canary for a new benefit-query bundle, with illustrative figures for a fictional organisation.
| Assumption | Value |
|---|---|
| Member and provider queries per working day | 12,000 |
| Canary share | 5% of queries, low-risk query types only |
| Human review sample | 5% of canary queries, and the same number from control |
| Canary length | 3 working days |
| Rollback threshold | Groundedness in the reviewed sample below 95% |
Working: 5% of 12,000 is 600 canary queries a day. A 5% review sample is 30 a day, so 90 reviewed canary answers over three days, with 90 control answers reviewed alongside. At a 95% threshold, 90 × 0.05 = 4.5, so the canary can have at most four unsupported answers. Five unsupported answers is 85 out of 90, or 94.4%, and the bundle rolls back.
Ninety reviews catch a large regression early. They cannot prove a small improvement with statistical confidence, so be honest about which one the canary is for.
Rollback must be one action, and it must restore the whole bundle: prompt, policy, tool definitions, model pin and retrieval settings. Swartberg times a rollback in staging every release.
The KPI scorecard
System metrics are necessary. Google's SRE book names four golden signals for any user-facing system: latency, traffic, errors and saturation. An agent needs those plus measures of whether the task was done well, safely and affordably. Swartberg reports six groups, per release bundle, so a change in any of them can be tied to a change in the bundle.
| Group | Measures | Comes from |
|---|---|---|
| Reliability | Runs completed without error, tool-call failure rate, fallback rate (requested model differs from served) | Trace status, tool spans, model fields |
| Latency | 95th percentile time to a usable answer per task, not per model call | Root span duration |
| Quality | Offline pass rate, groundedness in the human sample, staff acceptance rate of drafted answers | Evaluation events, review tool |
| Cost | Tokens per query, retries per run, cost per resolved query | Usage fields, price table |
| Safety and governance | Policy denials by rule, redaction failures found in traces, attempted calls to tools outside the task contract | Policy spans, trace audits |
| Operations and business | Queries resolved without handoff, repeat contact within seven days, escalation rate, time to roll back | Case system joined on case reference |
Cost per resolved query is the measure that keeps the others honest. It moves when either cost or resolution moves. Suppose spend stays flat while the share of queries resolved without handoff falls from 75% to 60%. Cost per resolved query rises by 0.75 ÷ 0.60 = 1.25, a 25% increase, with no change on the token bill. A cost dashboard alone would show nothing wrong.
Set thresholds with the service owner and write down the action each triggers; SLOs and error budgets in plain English explains how.
Close the loop: from failure to test case
Every confirmed failure, whether from a complaint, a review, a policy alert or an incident, becomes an offline test case with the expected behaviour written down. The fix is a new bundle that passes the full set and the canary. Every incident becomes a test case covers writing cases without copying personal information.
For Swartberg, that meant a test case for the scan question, an index rebuild without the superseded schedule, and a monitor that alerts when an answer cites a passage older than the current benefit year. The monitor would have caught the problem on day one.
The South African version
Three local conditions shape the build.
- Health information in traces. Under section 26 of the Protection of Personal Information Act (POPIA), health information is special personal information, with a general prohibition on processing subject to the exceptions in the Act. A trace that copies a member's question about a diagnosis is a copy of that information in another system, often a hosted one. Record references, redact, set retention and control access. This is general information, not legal advice; confirm your position with your privacy officer.
- Small operations teams. Automate the offline gate and the scorecard first, because they run without anyone remembering to. Keep human review small but daily.
- Cost in foreign currency. Model usage is often billed in US dollars while budgets are set in rand. Store the price table version with the cost estimate in each trace, so a currency or price change does not look like a behaviour change.
AgentOps build checklist
- The trace records requested and served model, agent version, release bundle, prompt and policy versions, tool calls, tokens and cost.
- Retrieval evidence is stored as references: data source, index version, passage identifiers and scores.
- Field names follow the OpenTelemetry generative AI conventions where they exist, with the implemented version pinned.
- Content capture is off by default; any exception has a documented purpose, redaction and retention.
- The offline set is versioned with the bundle, and the pipeline blocks a release without a current evaluation run.
- Canaries compare canary with control, run one at a time and have a written rollback threshold.
- Whole-bundle rollback is one action and is timed in staging every release.
- The six-group scorecard is produced per bundle and includes cost per resolved query.
- Every confirmed failure becomes an offline test case before the fix ships.
What this part adds to the Production Readiness Scorecard
Part 1 introduced the Production Readiness Scorecard, with each domain rated not assessed, hypothesis, tested or operating. This part supplies the evidence for four rows.
| Domain | Evidence this part produces | tested means | operating means |
|---|---|---|---|
| Evaluation | Versioned offline set, regression thresholds, human review sample, canary comparison | Gate blocked at least one bad bundle in staging | Gate runs on every change; review sample is daily and feeds new cases |
| Observability | Trace schema with versions, evidence references, cost and evaluation events | A complaint can be traced to bundle, model and passages in under an hour | Scorecard published per bundle; content capture audited |
| Operations | Rollback procedure, on-call alerts from online monitors, failure-to-test-case pipeline | Rollback timed in staging | Rollback used or rehearsed in production; incidents produce cases |
| Economics | Cost per resolved query and tokens per query, per bundle | Baseline measured on canary | Budget thresholds trigger a named action |
Next: Part 9, Resilience when the cloud goes quiet: four tabletop exercises. Previous: Part 7, Deploy and scale AI without confusing the layers. All parts are on the series page.
How CloudNala can help
CloudNala builds the AgentOps plumbing for teams taking an agent from pilot to production. We design the trace schema against the OpenTelemetry generative AI conventions, wire evaluation results into the same store, set up the offline gate and a canary with a written rollback threshold, and build the six-group scorecard per release bundle. You leave with a pipeline in which no prompt, policy or model change reaches users without evidence, and a trace that can answer a complaint in an hour rather than a week.
Work with CloudNala
CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.
Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.
Book an AgentOps Engineering Review or write to us at consult@cloudnala.co.za
