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
| Check | What it covers | What it catches |
|---|---|---|
| Automatic checks on every run | Output format, policy rules, personal data in replies, answers with no supporting source | Clear violations, at full volume |
| Human review of a sample | A weighted sample with more high-risk actions, new topics and low-confidence runs | Wrong judgements and weak answers that rules cannot see |
| User signals | Thumbs down, rephrased questions, escalations, reopened tickets, complaints | Problems 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
| Measure | Why it matters |
|---|---|
| Cost per run and per resolved case | Cost per run can fall while cost per resolved case rises, if more cases bounce back |
| Model and tool calls per run | A rising count often means the agent is looping or struggling |
| The slowest runs, not only the average | Customers feel the slow tail, and an average hides it |
| Daily spend against budget | Catches 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
- 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.
- Preserve. Keep the traces, configuration and model version of the affected runs.
- Assess. Use the traces to find every affected customer and action, not only the one who complained.
- Notify. Tell the people who need to know. If personal data was exposed, legal duties may apply, so involve counsel.
- Fix and prove it. Add the failing cases to the regression suite, fix the cause, and rerun before switching back on.
- 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.