Agent Assurance for your AI Deployment
Test how your agents actually behave across workflows, tools, and actions. Catch failures and vulnerabilities before they ship.
npm install -g @testmuai/rook
- TestMu AI (Formerly LambdaTest)
- /
- Learning Hub
- /
- AI Monitoring: What to Track, Thresholds and Blind Spots
OVERVIEW
A textbook AI monitoring rule, which pages when a reply runs longer than the mean plus three standard deviations, flagged 124 of 8,819 requests (1.41%) in just under an hour of the code-completion file of Microsoft's Azure LLM inference trace 2023, according to a script run on 2026-10-20. On normally distributed data, the same rule flags about 0.13% of points.
Nothing in the trace marks any of those requests as an incident. Most of the work in AI monitoring is choosing signals and thresholds that stay quiet on an hour like that one and fire on the hour that matters, and knowing which failures no threshold can see.
Overview
AI monitoring is the continuous tracking of AI systems in production, covering latency, throughput, token use, cost, errors and output quality, against a baseline that triggers an alert when a signal drifts. In just under an hour of Microsoft's Azure LLM trace, a textbook three-sigma alert flagged 1.41% of code requests, more than ten times what a normal distribution predicts.
Key Facts About AI Monitoring
- AI monitoring baselines: AI monitoring needs a separate baseline for each workload, model and prompt version, because a normal range computed on blended traffic hides the one workload that is failing.
- Is AI monitoring the same as AIOps?: No. AI monitoring watches AI systems themselves, while AIOps applies machine learning to monitoring conventional IT such as servers, networks and business applications.
- AI observability: AI observability keeps the traces, logs and sampled content needed to explain a new failure, while AI monitoring alerts on failures that a team already knows how to describe.
- AI performance monitoring: AI performance monitoring tracks p95 latency, time to first token, tokens per request, requests per minute, error rate and cost per successful task, split by workload and model version.
- Azure LLM inference trace 2023: Microsoft's public Azure trace shows a median code request generating 13 tokens against 129 for a conversation request, so one shared token threshold cannot fit both workloads.
- Context ceilings: In the Azure trace, 444 code requests, 5.0% of that file, carried a context within 2% of the 7,437-token maximum, so requests near a limit need a monitor of their own.
- Can a rolling baseline hide an incident?: Yes. In a synthetic test on the Azure trace, a rolling 15-minute p99 baseline stopped alerting two minutes after replies doubled, while a frozen baseline alerted for all 18 minutes.
- Does AI monitoring replace testing before release?: No. AI monitoring sees timing, size, errors and sampled scores, so an agent that updates the wrong record with a normal reply and no error raises no alert.
- Agent Assurance: Before release, Agent Assurance from TestMu AI runs an agent that acts against staging and checks each acceptance criterion against changed files, tool calls and records, not against the agent's own account.
What Is AI Monitoring?
AI monitoring is the continuous measurement of AI systems in production, such as predictive models, LLM apps, RAG pipelines and agents, against a baseline, with an alert when a signal drifts. It covers the service (latency, errors, throughput), the spend (tokens, cost) and the behaviour (output quality, input drift, actions taken), and teams also call it AI system monitoring.
Search results for the term mix two meanings. One is monitoring AI systems; the other is AIOps, which applies machine learning to monitoring ordinary IT such as servers and networks.
For some systems monitoring will be a legal duty. Under Article 72 of Regulation (EU) 2024/1689, the EU AI Act, providers of high-risk AI systems must "establish and document a post-market monitoring system" in proportion to the nature of the AI technologies and the risks of the system. Under Article 113, in the consolidated text as at 27 July 2026 (read on 2026-10-20), the high-risk sections of Chapter III (classification, requirements and the obligations of providers and deployers) apply from 2 December 2027 for systems listed in Annex III and from 2 August 2028 for those covered by Annex I.
An AI monitor reads these layers, cheapest to watch first:
- Service - request rate, latency percentiles, error and timeout rates, the same signals as any web service.
- Usage and cost - tokens in and out per request, spend per workload, and how often requests reach a context or output limit.
- Behaviour - sampled output quality, safety flags, shifts in what users ask and, for agents, which tools they call.
- Outcome - whether the task succeeded, which needs labels or a check of the system the AI changed, and often arrives late or never.
How Is AI Monitoring Different From AI Observability?
In the OpenTelemetry observability primer, observability is what helps a team answer the question "Why is this happening?" about a running system. AI monitoring has a smaller remit: it charts signals picked before launch and pages someone when one of them leaves the range agreed for it.
| Aspect | AI monitoring | AI observability |
|---|---|---|
| Question it answers | Is a known signal outside its normal range right now? | Why did this request or run behave the way it did? |
| Data it reads | Metrics and per-minute aggregates | Traces, spans, logs and sampled prompts and replies |
| What it produces | Alerts, dashboards and service-level reports | Investigations, root causes and ideas for new monitors |
| When you design it | Before launch, from failure modes you can name | Before launch, then query it when something new goes wrong |
| What drives its cost | Number of time series and alert rules | Volume of traces and content kept, and for how long |
Each needs the other: a monitor says that a given minute went wrong, and the traces say which prompt version, model or tool caused it. The AI observability guide covers how to instrument a system so those traces exist.
Signals to Monitor for Each Kind of AI System
The signals depend on what the system produces and on how long it takes to learn whether that output was right.
| System | Signals to track | Failures the signals catch | When ground truth arrives |
|---|---|---|---|
| Predictive model (classifier, regressor, ranker) | Input feature distributions, null and out-of-range rates, prediction distribution, accuracy or error once labels exist | Data drift, a broken upstream pipeline, a model scoring a population it was not trained on | Days to months later, when outcomes such as chargebacks or churn are recorded |
| LLM app (chat, summarizer, extractor) | Latency percentiles, time to first token, tokens in and out, error and refusal rates, format validity, sampled quality scores | Slow or truncated replies, cost spikes, a prompt or model change that degrades answers | Rarely: feedback buttons and sampled reviews stand in for labels |
| RAG pipeline | LLM app signals plus retrieval latency, empty or low-score retrievals, context size and groundedness of sampled answers | Stale or missing documents, answers drifting away from the retrieved context | Only for sampled answers checked against sources; the RAG evaluation metrics guide gives the formulas |
| Agent that acts | LLM app signals plus steps per run, tool call mix, tool error rate, repeated calls and cost per completed task | Loops, runaway cost, failing tools, a shift in which tools get called | Only when someone checks the system the agent changed, such as a database row or a ticket |
Microsoft's model monitoring documentation for Azure Machine Learning, dated 27 January 2026, draws the same line. Its data drift and data quality signals compare production inputs with training data or recent production data, its prediction drift signal compares outputs with validation, labeled test or recent production data, and its model performance signals compare outputs with "collected ground truth data", which the page marks as required.
- Watch proxies until labels arrive - drift and data quality signals move within minutes of a pipeline break, while accuracy can lag by weeks.
- Split every signal by workload and version - a chat feature and a code feature on one model have different normal ranges, as the trace numbers below show.
- Record the change history next to the charts - model, prompt, retrieval index and tool releases on the same timeline make a drift alert point at its cause; LLM prompt monitoring covers tying a change in replies to the prompt version behind it.
- Watch what users send - shifts in prompt length, language or topic mix are input drift, which can arrive with no change on your side, so chart them per workload.
- Read feedback week over week - thumbs-down rate and hand-offs to a person cost nothing to collect but come mostly from unhappy users, so compare weeks instead of reading a single day.
For LLM apps, generative AI monitoring adds checks on the content of prompts and replies, which latency and token metrics cannot see; LLM observability covers which checks to run, how much to sample and how to alert on the scores.
AI Performance Monitoring: Latency, Throughput, Cost and Quality
AI performance monitoring measures how fast, how much and at what cost an AI system serves requests, and how often the result is usable. Compute each metric per workload, model and version, since a blended number hides the workload that is failing.
| Metric | Formula | A rise usually means |
|---|---|---|
| p95 latency | 95th percentile of end-to-end request duration in the window | Queueing, a slower model or longer replies |
| Time to first token | Time from sending the request to receiving the first streamed token | Longer prompts or heavy prompt-processing load |
| Time per output token | (Duration minus time to first token) divided by (output tokens minus 1) | Slower generation on shared or overloaded hardware |
| Throughput | Requests per minute and tokens per minute | More demand, a retry storm or a client loop |
| Tokens per request | p50, p95 and p99 of context tokens and of generated tokens | A template change, longer conversations or replies cut off at a limit |
| Error rate | Failed requests divided by all requests, by error type | Provider errors, timeouts or rate limits |
| Cost per successful task | Total spend divided by tasks that passed their success check | Retries, longer replies or more failed tasks |
| Quality pass rate | Sampled outputs that pass a check divided by sampled outputs | A rise is good; a fall points at a prompt, model or data change |
Latency gets two numbers because inference has two phases. The Splitwise paper, whose data is the trace used on this page, describes "a compute-intensive prompt computation, and a memory-intensive token generation, each with distinct latency, throughput, memory, and power characteristics". Time to first token tracks the first phase and time per output token the second.
If you instrument with OpenTelemetry, request duration and token counts map to gen_ai.client.operation.duration and gen_ai.client.token.usage, marked Development in semantic conventions v1.41.0; v1.42.0 deprecated every gen_ai.* metric and moved the GenAI conventions to their own repository, whose main branch has since replaced the token metric. The OpenTelemetry LLM metrics taxonomy lists the other GenAI metric names with their units and status.
The trace shows why blended dashboards mislead. In the conversation file, the median request generated 129 tokens from a 1,020-token context; in the code file, the median request generated 13 tokens from 1,469, according to the script output in the next section.
- Volume - conversation traffic never fell below 191 requests a minute, while code traffic had 12 empty minutes and peaked at 632.
- Cost driver - set against the length of its reply, the median code request carries far more context than the median conversation request, so a change in output-token price moves conversation costs far more relative to their total.
- Latency driver - long code prompts load the prompt phase, long conversation replies the generation phase, so each workload needs its own latency baseline.
How to Set AI Monitoring Alert Thresholds From a Baseline
To compare common alert rules, a Node script with no dependencies, run on 2026-10-20, computed baselines and alert counts on both files of the Azure LLM inference trace 2023, which Microsoft publishes under a CC-BY 4.0 licence. Each file has three columns: timestamp, context tokens and generated tokens.
Alert Baselines From Under an Hour of Azure LLM Traffic
The first part of the script output describes the traffic: volume per minute, token percentiles, and how many requests sit at the largest value seen. Percentiles use the nearest-rank method, and the last, partial minute of each file is left out of the per-minute counts.
Azure LLM inference trace 2023, public sample
workload requests full minutes empty per minute
p50 min max
conv 19366 58 0 326 191 507
code 8819 57 12 111 0 632
tokens per request p50 p95 p99 max
conv context 1020 4083 4142 14050
conv generated 129 451 601 1000
code context 1469 7315 7436 7437
code generated 13 90 252 1899
ceilings (requests at the observed maximum)
conv context max 14050 at max 1 within 2% 1
conv generated max 1000 at max 11 within 2% 14
code context max 7437 at max 18 within 2% 444
code generated max 1899 at max 1 within 2% 1- Separate workloads - the median minute held 326 conversation requests and 111 code requests, and code had 12 empty minutes, so a rate alert tuned on one workload pages constantly or never on the other.
- Ceilings - 444 code requests, 5.0% of the file, carried a context within 2% of the 7,437-token maximum, and 11 conversation replies stopped at exactly 1,000 generated tokens; a request at a limit may have been cut short, so track the share near each limit as its own signal.
- Outliers - one conversation request carried 14,050 context tokens, more than three times that workload's p99 of 4,142, which is why alerts should read percentiles of a window rather than single requests.
Static, Rolling and Frozen LLM Alert Baselines Compared
The script tests a static rule on single requests, two per-minute rules on generated tokens and one on request rate. Its token and rate rules, copied from the script, look like this:
// Monitor 2: a minute's p95 generated tokens over the p99
// of the requests in the trailing WINDOW minutes
function tokenRule(by) {
const fired = [];
for (let m = WINDOW; m < by.length; m++) {
const pool = by.slice(m - WINDOW, m).flat()
.map((r) => r.g);
const now = by[m].map((r) => r.g);
if (now.length < 20 || pool.length < 100) continue;
if (pct(now, 0.95) > pct(pool, 0.99)) fired.push(m);
}
return fired;
}
// Monitor 2b: same comparison against a frozen baseline,
// the p99 of the requests in minutes 0-29, never updated
const FROZEN = 30;
function frozenRule(by) {
const pool = by.slice(0, FROZEN).flat().map((r) => r.g);
const th = pct(pool, 0.99);
const fired = [];
for (let m = FROZEN; m < by.length; m++) {
const now = by[m].map((r) => r.g);
if (now.length < 20) continue;
if (pct(now, 0.95) > th) fired.push(m);
}
return fired;
}
// Monitor 3: a minute's request count over mean + 3 sd
// of the counts in the trailing WINDOW minutes
function rateRule(by) {
const fired = [];
for (let m = WINDOW; m < by.length; m++) {
const counts = by.slice(m - WINDOW, m)
.map((x) => x.length);
const limit = mean(counts) + 3 * sd(counts);
if (by[m].length > limit) fired.push(m);
}
return fired;
}The script then injects three synthetic incidents into a copy of the conversation file and labels them as invented, since the trace records none. The rest of the output shows how each rule behaved:
static rule: one request over mean + 3 sd (whole hour)
workload threshold requests over share minutes hit
conv 700 52 0.27% 37
code 207 124 1.41% 36
one-sided normal tail above mean + 3 sd: 0.13%
pages in the clean hour (no incident in the trace)
token: minute p95 over baseline p99 generated tokens
rate: minute requests over baseline mean + 3 sd
workload checked token rolling token frozen rate
conv 43 0 0 1
code 42 0 0 0
rolling = trailing 15 minutes; frozen = minutes 0-29
checked = minutes after the 15-minute warm-up;
the frozen rule checks minute 30 onward only
conv rate rule fired at minute 22
synthetic incidents on the conv workload (invented)
minutes firing that were quiet in the clean hour
incident token roll token frozen rate
A output doubled from m40 2 18 0
token roll minutes: 40-41
token frozen minutes: 40-57
B retries x3 in m45-47 0 0 1
rate minutes: 45
C 30 wrong records in m50 0 0 0
rows marked wrong: 30; shape unchanged- Static mean plus three standard deviations - flagged 52 conversation requests (0.27%) and 124 code requests (1.41%) spread over 37 and 36 minutes; token counts are skewed, so the normal-theory 0.13% does not hold.
- Rolling baseline - quiet in the clean hour, but after incident A doubled every reply from minute 40 it fired at minutes 40 and 41 only, because the doubled replies filled the top 1% of its own 15-minute baseline.
- Frozen baseline - the same comparison against minutes 0 to 29 stayed quiet in the clean hour and fired in all 18 minutes of incident A.
- Rate rule - paged once in the clean hour, at minute 22, when traffic rose from 343 to 408 requests a minute (a recount of the same file, not printed above), and caught only the first minute of the three-minute retry storm in incident B, as the tripled minute 45 then widened the baseline for minutes 46 and 47.
- Incident C - the script kept every labelled row's timing and token counts as they were, which is how a wrong write looks to these monitors, so no rule could fire.
Steps From a Frozen Baseline to a Paging LLM Alert
- Baseline each workload and version on its own - compute p50, p95 and p99 per workload, model and prompt version, never on blended traffic.
- Prefer percentiles to three-sigma limits on skewed data - the NIST/SEMATECH e-Handbook page on variables control charts notes that k = 3 "has become an accepted standard in industry", and that even under its assumptions the standard rule gives "false alarms" every 371 points on average; on skewed token data the code file did worse, as the static rule showed.
- Freeze the baseline window - compare against a reviewed window, such as the same hours last week, and refresh it on a schedule after checking it held no incident, so a live incident cannot become the new normal.
- Require the condition to persist - Prometheus alerting rules have an optional
forclause that "causes Prometheus to wait for a certain duration" before an alert counts as firing; in the trace, a two-minute wait would have silenced the false rate page at minute 22, but with a rolling baseline it would also have silenced the retry storm. The script compared a frozen baseline on the token rule only, so test a frozen rate baseline on your own traffic before relying on the pair. - Add ceiling and ratio monitors - alert on the share of requests near the context or output limit, and on retries per request, which change before averages do.
- Label every page - mark each alert real or false, and retune any rule whose false share stays high after two weeks.
AI Monitoring Blind Spots: Failures That Raise No Alert
A monitor sees the shape of traffic, not its meaning. Incident C labelled 30 replies as changing the wrong customer record while leaving their timing and length as they were, the way a wrong write looks from outside, so every rule stayed quiet by construction.
Content is often missing too. The README of the Azure LLM inference trace states: "Due to customer privacy requirements (e.g., GDPR), we do not have visibility into the content of the prompts." It also dates the collection to 11 November 2023, while every timestamp in both files falls on 16 November 2023, so check a dataset's own records before trusting its description.
- What monitors catch - slow, failing, expensive, truncated or drifting traffic, and sampled replies that fail a check.
- What monitors miss - a fluent reply that is wrong, a write to the wrong record, an action that should never have run but finished cleanly, and any failure on an input that has not arrived yet.
For agents that act, the gap is widest, since their output is a change in another system. AI agent monitoring covers what to watch on agent runs in production, while confirming that a run changed the right thing takes a read of the system it changed, ideally before release.
AI Monitoring Tools by Category
Tools differ most in which layer they read. The AI observability tools and AI agent observability tools roundups compare named products.
| Category | What it reads | Check before choosing |
|---|---|---|
| APM and infrastructure platforms with AI views | Service metrics and traces, with LLM calls shown next to the rest of the stack | Whether token, cost and quality fields are built in or custom attributes |
| LLM observability and tracing platforms | Prompts, replies, spans, evaluation scores and prompt versions | Content sampling and retention controls, and self-hosting |
| ML model monitors | Feature and prediction distributions, data quality, accuracy against labels | Support for text inputs and generated outputs |
| Cloud ML platform monitors | Built-in drift, data quality and generation quality signals for models deployed on that cloud | Preview status and whether it works outside that cloud's endpoints |
| Open-source stacks | OpenTelemetry data, time-series metrics, alert rules and dashboards you run yourself | Who owns storage, alert rules and upgrades |
Whatever the category, check OpenTelemetry support first. The OpenTelemetry Collector README says it "offers a vendor-agnostic implementation on how to receive, process and export telemetry data", so instrumentation written once can feed more than one backend.
Testing Agent Actions That Monitoring Misses, With Agent Assurance
Monitoring reports what production traffic looked like after users sent it. For an agent that edits files, calls APIs or changes records, the check that incident C needed belongs before release, against a system where a wrong write costs nothing.
TestMu AI's Agent Assurance runs that kind of check before release; it neither observes live traffic nor intervenes in a running agent. Rook CLI, which you run from a terminal, is pre-alpha and publicly installable, and you direct it at your own agent to run a suite of scenarios.
npm install -g @testmuai/rook
rook --versionBuilds exist for macOS and Linux, and 64-bit Windows through npm or WSL, with a minimum of Node.js 20 for the npm package; for macOS and Linux the Rook CLI installation guide also describes Homebrew and a checksum-verifying shell installer.
- Scenarios written for this agent - Rook CLI reads the agent's code, or a PRD, spec or API description if you cannot share code, and drafts scenarios that each carry acceptance criteria; functional and adversarial classes are generated by default.
- How it reaches the agent - a profile tells Rook CLI whether to call an HTTP endpoint, run a command or use an MCP tool, and the scenarios execute against staging or inside a CI job.
- What counts as evidence - edits to files below the paths named in the profile, artifacts the run produced, the calls made set against the agent's declared tools and its must-not-call list, and, for a case like incident C, a lookup of the record through a read-only MCP tool that you supply and approve.
- Verdicts - a criterion can only end Pass, Fail or Unable to Verify; that third result is reported apart and never counted for or against the pass rate.
Some criteria are scored by model judges, yet an agent saying it made a change never counts as proof: a criterion about a changed record is decided by reading that record through a read-only tool you supply, and without such a tool it is never a pass (it comes back Unable to Verify, or the scenario is skipped). Most eval and observability tools score what your agent said and recorded. Agent Assurance checks what the run changed, and reports what it could not verify.
Writes made during a run stay in place, so aim runs at a staging copy of the systems the agent touches. The Agent Assurance CI/CD guide warns that "A process exit code of zero is not an agent-quality gate", so a pipeline should gate on the run's report, for example the output of rook report --json.
For conversational phone agents, TestMu AI's Agent Testing can score recorded production calls: the phone agent testing docs describe uploading batches of them and scoring them with the same metrics as test calls.
A Starting Plan for Monitoring One AI Workload
Start with the busiest workload: export a week of request logs, compute p50, p95 and p99 for latency, context tokens, generated tokens and requests per minute, then apply the baseline-to-alert steps above to that frozen week. If those metrics land in Prometheus, its guide to histograms and summaries notes that quantiles "are estimated" and that a classic histogram's error "is limited by the width of the bucket the quantile is located in", so place bucket boundaries close to the p95 and p99 you alert on.
Where an agent in the system writes to records or files, add a pre-release check of those writes. How Rook CLI connects to an agent is described in the Agent Assurance overview, and npm install -g @testmuai/rook installs the CLI.
Author
Sandeep Yadav is a Senior Software Engineer at TestMu AI, where he builds the platform's test intelligence and AI-native engineering systems. He has architected autonomous GitHub Apps, vector-search code intelligence, and self-diagnosing QA workflows, and designed distributed platforms that process 2M+ daily test executions and 1B+ events, turning high-volume test, log, and code data into intelligent, self-optimizing systems. He works on embedding reasoning models into production infrastructure to power autonomous review, root-cause analysis, and analytics workflows. He brings over four years of engineering experience with deep expertise in the Elastic Stack, Apache Kafka, and Redis. Earlier he engineered a GDPR-compliant, end-to-end-encrypted secure web-chat application at Mithi. A Facebook Hackercup 2021 Round 2 qualifier and merit-scholarship recipient, Sandeep holds a B.Tech in Electrical Engineering from Delhi Technological University.
Reviewer
Saurabh Prakash is an Engineering Manager at TestMu AI, where he leads engineering on agentic AI development and scalable system architecture for the quality engineering platform. He has also contributed to Test at Scale, the company's open-source test intelligence platform. He brings over 9 years of experience across Node.js, Java, Spring, MVC, data structures, algorithms, and scalable system design, with earlier roles as SDE 2 at Zomato, Senior Software Engineer at LogicHub, and Software Development Engineer at Directi. Saurabh holds a B.Tech in Computer Science and Engineering from Delhi Technological University.
AI Monitoring FAQs
Did you find this page helpful?
More Related Learning Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests





