Skip to content
Agentic Control Plane

AI Agent Cost Monitoring

AI agent cost monitoring means measuring what your agents spend per call, per run and per config version, and getting alerted when spend moves away from its baseline. It is not cloud cost management. Cloud FinOps watches infrastructure bills. Agent cost monitoring watches the call path: tokens, cache economics, tool results and loops.

The bill is where you find out last. The call path is where the money moves.

This page defines the metric set and the failure most teams meet first: agent cost drift.

Why agents need their own cost discipline

Quality got a discipline. Teams write evals, run them in CI and re-tune when they regress. Cost never got the same treatment. Most teams learn about cost problems from the invoice, the way teams once learned about quality problems from angry users.

Three things make “check the bill monthly” fail.

  1. Cost is objective but made of many parts. A run’s cost is tokens times price. The tokens come from parts that interact: the prompt prefix, cache reads versus writes, tool-result bytes re-sent every turn, and loop length. A 10% change in one part can move the total 2×.
  2. Cost drifts silently. A quality regression shows up fast, as bad output or a complaint. A cost regression can sit unseen for weeks. A prompt tweak that breaks the cache doesn’t error. A model swap that doubles spend doesn’t warn. Context creeps up a few KB a week. Nothing fails and the invoice grows.
  3. Nobody watches the expensive agents. The agents that spend the most are often autonomous: scheduled jobs, background loops, coding agents on long leashes. No human is in the session to notice a 180KB file being re-read forty times. For those agents, the alert is the only safety net.

Agent cost drift, defined

Agent cost drift is a sustained gap between an agent’s cost per run and its own baseline. Either a configuration change caused it (a deploy made the agent more expensive) or the traffic did (the work got heavier while the config stayed the same).

The two kinds have different fixes.

Config-change drift. The system prompt, tool set or model changed, and cost per run rose against the previous version. Common causes are a prompt edit that invalidated the provider’s prefix cache, a tool added mid-stream, or a model swap. Cache reads bill at roughly a tenth of full input price, so losing that discount on every turn can double a bill on its own.

The fix is comparing versions: since config v2, cost per run rose 2.4×, and here is the diff. That needs a fingerprint of the config on every run. Without it you can see that cost rose, but not when it started or what changed.

Same-config drift. The config didn’t change. The traffic did: inputs grew, tool results got fatter, loops run longer. The fix is different. Cap the tool output, compact the history, add a loop guard. The tell is a stable config fingerprint while cost rises.

Industry data says drift is normal. Datadog reports token use per request doubled year over year at the median and quadrupled at p90, and notes that spikes usually signal bugs (loops, misfiring retrieval, maxed context) rather than demand. A cost spike is a behavior alert wearing a billing costume.

The cost lifecycle

The workflow mirrors evals, with the weight in a different place.

  1. Baseline. When an agent ships, record its config fingerprint and its cost-per-run distribution. This is cheap. There are no datasets and no judges to set up.
  2. Monitor continuously. Meter every model and tool call in the path. Split tokens into fresh, cache-read and cache-write. Track tool-result bytes, loop versus leaf calls, and context composition. Averages hide everything, so look per run and per config.
  3. Detect drift. Compare recent runs against the per-config baseline. Alert on sustained divergence, and be conservative so an alert that fires is real. Send it somewhere a human looks (for us, the daily digest email), because the premise is that nobody watches the dashboard.
  4. Reoptimize. The fixes are well documented: stabilize the prompt prefix, cap and paginate tool results, compact history, route cheap-shaped calls to cheap models, batch latency-tolerant work. The monitoring data tells you which one applies. A low cache-hit rate with a churning prefix is a different problem from a fat tool result re-read every turn.
  5. Verify. Since the fix, cost per run moved from X to Y at the same quality. Config fingerprints make this a comparison instead of a feeling.

Cost and quality trade off. The cheapest config can tank quality, so the real target is cost per quality point. Feed in whatever quality signal you already have (evals, user feedback) rather than optimizing cost blind.

The metric set

  • Cost per run, per config version. This is the raw material for drift detection.
  • Cache-hit rate. Cache-read tokens divided by total input tokens. Define it carefully. Counting cache writes as hits overstates it, and double-counting cached tokens in the denominator understates it. We made that mistake ourselves: a real 96% rate was reported as 50% and sent us chasing a problem that didn’t exist.
  • Context composition. The share of input that is system prompt, history and tool results. Tool results above about a third of the total usually mean an uncapped tool.
  • Loop share. Orchestration re-reads versus leaf work. The loop re-pays the whole history every turn, so one early fat result compounds across every turn after it.
  • Spend rate versus budget. The hard backstop, set per agent identity, so a runaway loop is a bounded incident.

How ACP does this

Agentic Control Plane sits in the agent’s call path. It checks tool calls through harness hooks and proxies model calls. Metering comes from that position, so there is no SDK to instrument. What you get for cost:

  • Config fingerprints on every run. The prompt prefix, tool set and model are hashed at call time, so each run knows which config produced it. Prefix churn, the classic cache-killer, is detected directly.
  • Drift detection, both kinds. Per-config baselines with config-change comparison (since scout changed config v1 to v2, cost per run rose 2.4×), delivered in the daily digest. The alert comes to you.
  • Pattern suggestions with evidence. When the data shows a known cost pattern, such as an uncapped tool result or context growth worth compacting, the finding arrives as one line with the numbers inline. It is tailored to the harness you run: an agent whose harness already compacts natively gets different advice than a raw SDK loop.
  • Budget caps that stop the run. Caps are set per identity. Agents can also call tools to check their own budget and pace themselves.
  • One system for cost and actions. Cost monitoring and tool-call checks share one identity, one policy and one audit trail. A cost spike that turns out to be a misbehaving loop is one click from the rule that stops it.

Free up to 5 agents, with sixty seconds to first data. If you run agents nobody watches, that is the case this was built for.

FAQ

What’s the difference between AI agent cost monitoring and LLM cost tracking? Tracking reports what you spent, usually per request. Monitoring compares spend against a baseline over time and alerts on divergence. A token counter can’t tell you your Tuesday deploy raised cost per task 40%. That takes per-run metering keyed to config versions.

What causes AI agent cost drift? Most often: prompt or tool changes that invalidate the provider’s prefix cache, model swaps, growing tool-result payloads re-sent every turn, lengthening loops, and retry storms. Roughly, it splits between “the deploy did it” (config drift) and “the traffic did it” (same-config drift).

Do I need this if I set budget caps? Caps bound the damage, but they don’t explain it, and they fire after the money is spent. Drift detection tells you what changed and when, usually while the number is still small. Use both.

Does this apply to agents on subscription plans rather than API keys? Yes. Token waste uses up subscription quota the same way it uses API budget, and the drift causes (cache breaks, context bloat) are the same. Metering at the call path sees both.