AI Agents & Automation

AI agent monitoring and observability in production

Monitoring an AI agent means recording every run in enough detail to replay it, watching quality, cost and latency over time, and having a person and a procedure ready when something goes wrong. Uptime checks miss the failures that matter, because an agent can be fast, available and still wrong. This page covers what to log, what to watch and how to respond.

Book a workflow review

An agent can be up, fast and wrong

Traditional monitoring asks whether a service answers and how quickly. The AI failures that hurt raise no error: a confident answer from an outdated policy, a refund issued against the wrong order, a loop of tool calls that burns budget, or a quiet change in behaviour after a provider updates a model. Each one returns a successful response. Seeing them takes records of what the agent read, decided and did, and people who look at those records on purpose.

AI observability is the practice of making that visible. It continues the testing done before launch: testing tells you a release was good, monitoring tells you whether it stays good.

What to record for every run

  • Identity and context: a run ID, the channel, the customer or tenant (pseudonymised where possible) and the business record involved, such as a ticket or order number.
  • Configuration: the prompt and instruction version, the model and its version, and the settings.
  • What the agent read: the IDs and versions of the documents and records it retrieved.
  • What it did: every tool call with its arguments, result, duration and any error, and every action blocked by a permission or approval rule.
  • The outcome: the final answer or action, who approved it if approval was needed, and what happened next: resolved, escalated, reopened or complained about.
  • Cost and time: tokens and spend per step, and latency for each step and for the whole run.

These logs hold customer conversations, so they are sensitive data in their own right. Redact what you do not need, restrict who can read them, set a retention period and keep them in the region your data rules require. Log enough to explain any decision, and no more.

Traces: one run, every step

A trace links the steps of a run in order: the request, each model call, each retrieval, each tool call and the reply, with timings and parent-child links. When a customer complains, you search by order number, open the run and see which document the agent read, what it concluded and which tool call went wrong. Without traces, an investigation is guesswork.

OpenTelemetry, the open standard for traces, has conventions for recording model calls that are still maturing, and dedicated LLM observability tools build on the same idea. Whatever you choose, connect the trace to your existing logs and to the business records involved, so engineers and operations staff look at the same evidence.

Quality sampling, because nobody reads every run

CheckWhat it coversWhat it catches
Automatic checks on every runOutput format, policy rules, personal data in replies, answers with no supporting sourceClear violations, at full volume
Human review of a sampleA weighted sample with more high-risk actions, new topics and low-confidence runsWrong judgements and weak answers that rules cannot see
User signalsThumbs down, rephrased questions, escalations, reopened tickets, complaintsProblems customers notice first

Reviewers score with the same rubric as the pre-launch test set, so the numbers compare. Review more at launch and after every change, then less as results hold steady, but never stop sampling the riskiest actions.

Drift: when the same agent behaves differently

An agent can change without anyone touching its code. Watch for four kinds of drift:

  • Inputs. A product launch, a new policy or a seasonal peak brings questions the agent was never tested on.
  • Models. Providers update models, so pin a dated version where one is offered and treat an upgrade as a release.
  • Knowledge. Documents change but the index does not, and the agent quotes last year's terms. Track when each source was last refreshed.
  • Behaviour. Escalation rates, tool-call patterns, answer length or the share of refusals shift from one week to the next.

Imagine a retailer that shortens its returns window. The policy page changes, the index is rebuilt only once a month, and escalations about returns start to climb. A dashboard that compares this week with last week shows it within days; a quarterly review finds it after many customers have been given the wrong answer.

Cost and latency you can see

MeasureWhy it matters
Cost per run and per resolved caseCost per run can fall while cost per resolved case rises, if more cases bounce back
Model and tool calls per runA rising count often means the agent is looping or struggling
The slowest runs, not only the averageCustomers feel the slow tail, and an average hides it
Daily spend against budgetCatches runaway loops and abuse before the invoice does

Set hard limits as well as dashboards: a maximum number of steps and a spending cap per run, and a daily budget that pauses the agent or routes work to people when it is reached.

Alerts and the exception queue

Alerts go to a named person, not a shared inbox, and fire on things that need action: error spikes, budget limits, guardrail blocks, a jump in escalations or negative feedback, a source that has stopped refreshing. Every alert links to the traces behind it.

Runs the agent cannot finish safely go to an exception queue: low confidence, a failed tool call, a blocked action, a customer asking for a person. The queue needs an owner, response times agreed with the business and a rule that each resolved exception is labelled, so recurring causes get fixed and new cases enter the test set. Our article on handling automation exceptions goes deeper.

When an agent goes wrong: incident response

  1. Contain. Use a kill switch at the right level: the whole agent, one tool, one type of action or one customer group. Work falls back to the human queue.
  2. Preserve. Keep the traces, configuration and model version of the affected runs.
  3. Assess. Use the traces to find every affected customer and action, not only the one who complained.
  4. Notify. Tell the people who need to know. If personal data was exposed, legal duties may apply, so involve counsel.
  5. Fix and prove it. Add the failing cases to the regression suite, fix the cause, and rerun before switching back on.
  6. Review. A short, blameless review that changes a permission, a check or a process, not only the prompt.

We set up the logging, traces, dashboards, alerts, exception queue and runbook as part of each agent we build, starting from a threat review. See AI agents and automation and the guide to deploying AI agents safely.

A small first step

A 30-minute workflow review

Pick one process that costs your team time. We look at it with you and tell you honestly whether automation or an AI agent pays, what it would take, and what to measure first.

Message us on WhatsApp

Questions we get asked

  • Logging is necessary for accountability, and the logs need the same care as any store of personal data. Redact what you do not need, restrict access to the people who investigate or review, set a retention period and keep the logs where your data rules require. Logging less is not the answer; logging carefully is.

  • It depends on your stack and your data rules. Often it is an open standard such as OpenTelemetry feeding the log and dashboard tools you already run; sometimes it is a dedicated LLM observability product. We choose with you, and keep the logs in the cloud account and region your policy requires.

  • It depends on volume and risk. Review more at launch and after each change, then sample less as results stay stable. High-risk actions, new topics and low-confidence runs should always be over-represented in the sample, and one person should own the review and act on its findings.

  • Two owners work best: a technical owner for errors, cost and latency, and a business owner for answer quality and the exception queue. Both look at the same dashboards, and an incident has one named lead, as with any other production system.

Keep exploring

Ready to build something secure?

Tell us about your product. We will reply with a clear plan.

Start a project

We would like to use Microsoft Clarity to see how visitors use the site, so we can improve it. It sets cookies and is off unless you accept. Cookie policy