DET-230 · agent · confidence Medium
Watching the Bill for Agent Abuse
Use token, API and cloud spend as a detection surface for abnormal agent consumption.
Some misuse leaves ordinary-looking successful calls but a strange invoice: crypto mining on a GPU, runaway loops, mass calls to a paid API, or heavy data egress. This detection collects usage and cost data from model providers, gateways, cloud billing and third-party platforms, and attributes each cost to an agent, task, identity and requester.
Baseline by agent and service. Alert on sudden spend, token spikes, new expensive models, and costs with no matching task. Set budgets with hard limits so abuse stops itself.
- Data sources
- LLM gateway usage logsCloud billing exportGPU usage recordsAPI provider usage reportsNetwork egress billing
- Platforms
- AI PlatformAWSAzureGCP
Logic
Daily per agent: cost = sum(cost_usd); tokens = sum(tokens_in+tokens_out). Alert when cost > 3x the 14-day median or tokens per task > p99. SQL on a billing export: SELECT agent_tag, date, sum(cost) FROM billing GROUP BY 1,2 HAVING sum(cost) > 3*median_14d. Enforce per-key budgets in the gateway.
False positives
Launches, evaluations and load tests. Tag planned runs so they are excluded.