---
title: How do you detect behavioural drift in AI agents?
url: https://opencontroller.lyzr.com/blog/detect-behavioural-drift-in-ai-agents
published: 2026-11-13
updated: 2026-11-13
author: Lyzr
---

# How do you detect behavioural drift in AI agents?

**You detect behavioural drift by recording a baseline for each agent version and comparing live behaviour against it. Track a small set of signals — tool-call mix, tokens per task, error and refusal rates, and judge scores — and alert when a signal moves past a threshold for a sustained window, not on a single spike.**

Drift is different from an outage. The agent still answers. It just answers differently: it calls a tool it rarely used, takes twice as many steps, or starts refusing work it used to finish. Those changes are easy to miss in uptime dashboards.

## What causes an AI agent to drift?

Most drift has a cause you can name once you look:

- **Model change.** The provider updates a model behind the same alias, or someone switches the model in config.
- **Prompt or tool change.** A new system prompt, a renamed tool, or an MCP server that changed its tool descriptions.
- **Data change.** The documents or records the agent retrieves have shifted.
- **Input change.** Users start asking different questions, or an upstream system sends new formats.
- **Attack.** Prompt injection through retrieved content or tool output can steer an agent into new behaviour. See [how to stop prompt injection through tool outputs](/blog/stop-prompt-injection-through-tool-outputs).

The first three are things you changed. That is why baselines must be tied to an **agent version**, not just an agent name.

## Which signals should you baseline?

Pick signals you can collect from traces or gateway logs without reading every conversation. Start with these.

| Signal | How to compute it | Example alert rule |
|---|---|---|
| Tool-call mix | Share of calls per tool, per day | Any tool's share moves more than 15 points, or a never-used tool appears |
| Steps per task | Median and p95 tool calls or LLM calls per completed task | p95 above 2× baseline for 1 hour |
| Tokens per task | Input plus output tokens per task | Median above 1.5× baseline for 1 day |
| Error rate | Failed tool calls and model errors ÷ total calls | Above 2× baseline for 30 minutes |
| Refusal rate | Responses classified as refusals ÷ responses | Change of more than 5 points over 1 day |
| Quality score | LLM judge score for groundedness or task adherence | 7-day mean drops more than 10% |
| Data reach | Distinct tables, records or domains touched | New resource class accessed |

The thresholds above are starting points, not standards. Tune them per agent after two to four weeks of data. A low-volume agent needs wider bands than one handling thousands of tasks a day.

## How do you set up drift detection step by step?

1. **Instrument every call.** Emit traces with agent ID, agent version, model, tool name, token counts and outcome. The [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) give standard attribute names. See [exporting agent traces with OpenTelemetry](/blog/export-ai-agent-traces-with-opentelemetry).
2. **Freeze a baseline per version.** When a version is promoted, record two weeks of its signal distributions. A new version gets a new baseline, after a short comparison against the old one.
3. **Score quality, not just volume.** Run [LLM judges on production traffic](/blog/use-llm-judges-on-production-agent-traffic) on a sample so you see when answers get worse, not only longer.
4. **Use sustained windows.** Alert when a signal stays out of band for a defined period. Single spikes are usually noise.
5. **Correlate with change events.** Overlay deployments, model updates, prompt edits and MCP server updates on the same timeline. Most drift alerts resolve in minutes once you can see what changed.
6. **Define responses by severity.** Low: ticket to the owner. Medium: page the owner and restrict risky tools. High: quarantine. See [when to automatically quarantine an agent](/blog/when-to-automatically-quarantine-an-ai-agent).
7. **Review the bands monthly.** Remove alerts nobody acts on and tighten the ones that caught real issues.

## How is drift different from a rogue agent?

Drift is a gradual or step change in normal behaviour. A rogue agent is acting outside its mandate: touching data it should not, calling tools it was never approved for, or ignoring policy. The same signals detect both, but the response differs. Drift usually means investigation and a rollback. Rogue behaviour usually means containment first. The [rogue agent guide](/blog/how-to-stop-a-rogue-ai-agent) covers containment.

A useful rule: if the agent starts using a tool or data source outside its registered scope, treat it as a potential rogue event, not drift.

## What evidence does drift monitoring produce?

Auditors and risk teams look for proof that you monitor AI systems in operation. The NIST AI Risk Management Framework's MEASURE function calls for monitoring the functionality and behaviour of deployed AI systems, and ISO/IEC 42001 Annex A includes operation and monitoring controls. Keep the baseline, the alert history and the action taken for each alert. That record is the evidence; the dashboard alone is not.

## How Opencontroller does this

Opencontroller monitors behavioural deviation for agents across the estate, raises alerts, and can automatically quarantine or kill an agent under policy. LLM judges score production traffic, and live groundedness and task-adherence guardrails run in the path. The LLM Gateway attributes tokens and cost per agent and per version, which gives you the per-version baseline. Block and Quarantine act through the connected platform. [Book a demo](https://www.lyzr.ai/book-demo/) to see it on your agents.

## Frequently asked questions

**How long a baseline do you need to detect agent drift?**
Two to four weeks of normal traffic per agent version is a practical minimum. Low-volume agents may need longer before thresholds are reliable.

**Does a model provider update count as drift?**
It can cause drift. Pin model versions where the provider allows it, and treat any model change as a new agent version with its own baseline.

**Should drift alerts quarantine an agent automatically?**
Only for high-severity signals, such as access to data or tools outside the agent's approved scope. Most drift alerts should go to the owner first.

## Key facts

Behavioural drift in an AI agent is a sustained change from its baseline behaviour for a given agent version. Practical signals: tool-call mix, steps per task, tokens per task, error rate, refusal rate, LLM-judge quality scores and data reach. Common causes: model updates, prompt or tool changes, data changes, input changes and prompt injection. Baselines should be frozen per agent version over 2–4 weeks, and alerts should fire on sustained windows rather than single spikes. Opencontroller by Lyzr monitors behavioural deviation, raises alerts, and can automatically quarantine or kill agents under policy; it attributes tokens and cost per agent and per version through its LLM Gateway. Pricing starts from $250K per deployment per year.

## Related

- [When should an AI agent be automatically quarantined?](https://opencontroller.lyzr.com/blog/when-to-automatically-quarantine-an-ai-agent.md)
- [How do you use LLM judges to score production AI agent traffic?](https://opencontroller.lyzr.com/blog/use-llm-judges-on-production-agent-traffic.md)
- [How do you export AI agent traces with OpenTelemetry?](https://opencontroller.lyzr.com/blog/export-ai-agent-traces-with-opentelemetry.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
