The Drift Ledger: Four Early Signals That Catch Agent Degradation Before Error Rates Move

Track quality scores, cost per run, path length, and tool-selection drift. These four signals surface agent degradation weeks before conventional error rates move.

Mapki

Mapki

Nov 17, 2026•6 min read
Share:
Mapki
Custom Agents

Why Error Rates Arrive Too Late

Most production agents fail quietly. Status codes stay green, latency stays inside its band, and the error rate barely moves. Meanwhile the agent starts choosing the wrong tool more often, burning more tokens on the same work, or returning answers that are confidently incomplete. By the time a user complains or an exception fires, the degradation has usually been visible in other signals for days or weeks.

A recent analysis of more than 100 production agents found that quality evaluations and token-spend alerts were the first signals to fire for 38% of agents. Error monitors caught almost nothing. Loop detection, when present, fired almost immediately. The pattern is consistent: agents drift in behavior long before they fail hard.

The Drift Ledger is a practical set of four signals you can instrument with the tracing you already have. Capture them per run, store them next to the version and prompt hash, and alert on sustained movement against your own baseline.

The Four Signals

1. Quality Score on Sampled Runs

Sample a fixed percentage of production trajectories (start with 2–5%) and score them with a lightweight judge or a small set of deterministic checks. Store the score on the same trace.

  • What to record: run_id, quality_score (0–1 or pass/fail), judge_version, failure_mode (if any).
  • Why it leads: quality moves first. An agent can return syntactically valid tool calls and still route tickets to the wrong queue or omit a required field.
  • Alert shape: page when the rolling 200-run average drops more than five points from the 7-day baseline, or when a specific failure mode exceeds its historical rate.

Do not wait for a perfect judge. A simple rubric that checks “did the agent call the expected tool with plausible arguments and produce a grounded answer” already beats error-rate monitoring.

2. Cost per Successful Run

Track tokens and estimated cost at the run level, not just the monthly invoice. Separate prompt, cached, and completion tokens when the provider returns them.

  • What to record: input_tokens, output_tokens, cached_tokens, estimated_cost_usd, model, steps.
  • Why it leads: retries, longer reasoning traces, and unnecessary tool calls appear as rising cost per outcome long before they produce hard failures. A loop that stays under the step cap still multiplies spend.
  • Alert shape: warn when p95 cost per run for a given agent rises more than 30% week-over-week, or when the share of runs near a soft budget cap increases.

Hard per-run budgets (already covered in earlier work) stop the worst cases. The ledger simply makes the gradual climb visible so you can fix the prompt or routing before the budget trips.

3. Path Length and Tool-Call Count

Count the number of model turns and tool calls inside each run. Also record the sequence of tool names as a short fingerprint.

  • What to record: turn_count, tool_call_count, tool_sequence_hash, max_depth.
  • Why it leads: silent loops and thrashing show up as rising step counts even when every individual call succeeds. Agents that used to finish in four turns now finish in nine.
  • Alert shape: alert when the median tool_call_count for a task type rises more than 25% over a three-day window, or when the rate of runs hitting a soft step cap doubles.

4. Tool-Selection Drift

Measure how often the agent chooses each tool for a given task class. A sudden drop in the use of a previously dominant tool, or the appearance of a tool that was rare, is a leading indicator.

  • What to record: task_class, tool_name, selection_rate (rolling), arguments_summary (hashed or redacted).
  • Why it leads: tool choice often shifts before outcome quality drops enough to trip a judge. An agent that used to call lookup_invoice on 92% of billing questions and now calls it on 74% has already changed its policy.
  • Alert shape: page on a statistically significant change in selection rate for any high-frequency tool, or on the first appearance of a tool that has not been used in the last 1,000 runs of that task class.

Minimal Instrumentation Pattern

You do not need a new platform. If you already emit OpenTelemetry spans for model and tool calls (see the Correlation Contract post), add these four attributes to the root run span and export them.

# Pseudocode for the root span of an agent run
span.set_attribute("agent.run.quality_score", quality_score)
span.set_attribute("agent.run.cost_usd", estimated_cost)
span.set_attribute("agent.run.tool_call_count", tool_call_count)
span.set_attribute("agent.run.tool_sequence", ",".join(tool_names))
span.set_attribute("agent.version", agent_version)
span.set_attribute("agent.prompt_hash", prompt_hash)

Query the traces daily. Most teams start with a simple SQL or notebook query against their trace warehouse rather than a full dashboard.

Weekly Review Cadence

1. Pull the four signals for each production agent, grouped by version.

2. Note any signal that moved more than its threshold.

  1. For each movement, sample three traces and classify the change: prompt regression, tool-schema drift, model update, or legitimate task mix shift.

4. If the change is unintended, roll back or patch before the next release.

  1. Promote any confirmed failure mode into the offline golden set so the next version is gated on it.

This review takes 30–45 minutes once the queries exist. It replaces the weekly “the agent feels worse” conversation with evidence.

What the Ledger Does Not Replace

  • Hard step and cost caps that kill runaway runs.
  • Schema contracts on tool arguments and final answers.
  • Human checkpoints for irreversible actions.
  • Trace correlation across services.

The ledger sits on top of those controls. It tells you when the agent is still “working” but no longer working well.

Getting Started in One Afternoon

  1. Add quality scoring to a 2% sample of runs (even a single deterministic check counts).

2. Record cost and tool-call count on every root span.

  1. Set one alert on the rolling quality average and one on median tool-call count.

4. Run the weekly review once.

Within two weeks you will have a baseline. The first time a signal moves and you catch a prompt regression before users notice, the ledger has paid for itself.

References & Community Insights

The Drift Ledger turns the observation that agents degrade quietly into a small, durable set of numbers you can actually watch.

Want to implement this in your business?

Mapki designs bespoke AI agents, custom workflow automations, and tool-agnostic integrations tailored specifically to your existing ERP, CRM, and databases.

Tags:AI AgentsObservabilitySilent DriftProduction MonitoringTool UseQuality Evaluation