Skip to content
Operations / Evaluation

Detect and respond to model drift

  • BP-0050
  • v1.0.0
  • draft
  • guideline
  • role: orchestrator
  • role: reviewer
  • role: implementer
  • stage: verify
  • stage: operate
  • updated 2026-11-24
  • reviewed 2026-11-24
  • next review 2027-05-24

Model drift is a change in agent behaviour that you did not make on purpose. It comes from more places than the model weights:

Source Example
Model version An alias moves to a newer snapshot; a provider ships an update
Serving Gateway fallback sends traffic to another model or provider; provider infrastructure changes
Settings A default effort or thinking setting changes between releases
Your side Prompt, skill, tool schema, MCP server or retrieval index changes
Inputs The work itself changes (new repo, new document types)
  1. MUST pin model versions in production configuration (snapshot IDs, not moving aliases), and change them only through a reviewed change. Anthropic, for example, states that a model ID’s weights and configuration do not change, while older aliases resolve to the latest snapshot.
  2. MUST record on every model call both the model requested and the model that served it (gen_ai.request.model and gen_ai.response.model), plus provider, effort level and gateway route (BP-0039). Alert when they differ unexpectedly.
  3. MUST version everything else that shapes behaviour: system prompt (hash), skills and practices (BP-ID@version), tool and MCP server versions, retrieval index build. Record them on the run.
  1. MUST keep a golden evaluation set per workflow or role: representative tasks with checkable criteria, plus every past real failure (BP-0006).
  2. MUST run it on a schedule (for example daily for critical workflows, weekly otherwise) and on every change event: model or route change, effort change, prompt or skill change, provider notice.
  3. MUST compare against a stored baseline with thresholds set in advance: pass rate, rubric score, format validity, tool-call error rate, refusals, output length, tokens, cost and latency. Run each case several times; outputs vary between runs, so compare rates, not single results.
  4. MUST pin the judge too: if a model grades the output, pin its version and rubric, and spot-check it against human judgement. An unpinned judge drifts with the thing it judges.
  1. SHOULD watch live signals against a rolling baseline: task success, retries and escalations, tool errors, human overrides, review findings, tokens per task (BP-0051).
  2. SHOULD sample production outputs for rubric grading and human review, weighted towards high-stakes work.
  3. MUST track provider lifecycle: deprecation pages and, where offered, the provider’s models API (Anthropic’s reports a lifecycle status with deprecated_at and retires_at). Plan the migration before retirement, not after.
  1. MUST treat a planned model change as a release: run the golden set on the candidate, then canary a small share of traffic through the gateway, compare, and widen only if thresholds hold (BP-0046).
  2. MUST have a rollback: pin back to the last good model and settings in the gateway, freeze further changes, and open an incident.
  3. MUST turn every drift-caused failure into a regression case, and update the role table when the right model or effort changes (BP-0049).

Any agent or workflow in regular use, and before and after any model, provider, effort or prompt change.

Drift check (Bun). Runs each golden case several times, compares pass rate and median tokens against a stored baseline, and fails the job on a breach:

// author: Stephen Eaton
// drift-check.ts — usage: bun drift-check.ts baseline.json results.json
type Run = { case: string; pass: boolean; tokens: number };
type Baseline = { passRate: number; medianTokens: number; maxPassDrop: number; maxTokenRise: number };
const median = (xs: number[]) => {
const s = [...xs].sort((a, b) => a - b), m = Math.floor(s.length / 2);
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
};
export function compare(base: Baseline, runs: Run[]) {
const passRate = runs.filter((r) => r.pass).length / runs.length;
const medianTokens = median(runs.map((r) => r.tokens));
const breaches: string[] = [];
if (base.passRate - passRate > base.maxPassDrop)
breaches.push(`pass rate ${passRate.toFixed(2)} < baseline ${base.passRate.toFixed(2)} - ${base.maxPassDrop}`);
if (medianTokens > base.medianTokens * (1 + base.maxTokenRise))
breaches.push(`median tokens ${medianTokens} > baseline ${base.medianTokens} +${base.maxTokenRise * 100}%`);
return { passRate, medianTokens, breaches };
}
if (import.meta.main) {
const [b, r] = Bun.argv.slice(2);
const res = compare(await Bun.file(b).json(), await Bun.file(r).json());
console.log(JSON.stringify(res, null, 2));
process.exit(res.breaches.length ? 1 : 0);
}

Trace attributes that make served-model drift visible:

gen_ai.request.model = claude-sonnet-5-5
gen_ai.response.model = claude-sonnet-5-5 # differs → fallback or alias move
gen_ai.request.reasoning.level = medium
app.prompt.sha256 = 9f2c… app.practices = [email protected],[email protected]
app.gateway.route = coder-primary
  • Using a moving alias in production and finding out from users that behaviour changed.
  • One run per eval case, so normal variation looks like drift (or hides it).
  • An unpinned model grading the output of another unpinned model.
  • Gateway fallbacks that silently serve a different model with no record.
  • Learning of a retirement from an error message.
  • Model versions pinned; changes reviewed
  • Requested vs served model, effort and route recorded per call
  • Prompt, skill, tool and index versions recorded per run
  • Golden set run on schedule and on every change, several runs per case
  • Baseline and thresholds set in advance; judge pinned
  • Lifecycle notices tracked; canary and rollback in the gateway