{"slug": "catch-token-misuse-with-agent-anomaly-detection", "title": "Catch token misuse with Agent Anomaly Detection", "summary": "Google added a Token Misuse detector to Agent Anomaly Detection, now in Private Preview on the Gemini Enterprise Agent Platform, to flag sessions where agents generate tokens nobody reads. In a seven-hour A/B test across six simulated agents including 106 runaway-token abuse sessions, enabling the detector raised recall on runaway-token abuse from 29% to 76% and precision from 94% to 98%, with zero false positives on honest power-user sessions. The detector runs a cheap statistical first pass over Agent Development Kit traces and logs, then sends flagged sessions to Gemini for deeper review about two minutes behind the agent, adding no latency and never blocking execution.", "body_md": "Every token an agent generates ends up on your bill, even the ones nobody reads. Once you open an agent to external users, some will test the agent’s limits. They may push an agent to write far more than anyone could use, or they keep it going and never let it stop. Those tokens used by the agent come out of your quota and your budget. Nothing errors out, so these sessions look like normal traffic.\n\nTo catch those sessions without flagging the heavy, honest work your best users do, we added the Token Misuse detector to Agent Anomaly Detection, now in Private Preview on the Gemini Enterprise Agent Platform (see our [launch post](https://developers.googleblog.com/agent-anomaly-detection-now-in-private-preview-on-the-gemini-enterprise-agent-platform/)). In this post, we cover the three token-waste patterns we see most, how a two-stage pipeline separates identifying them from power users, and what we found testing on simulated traffic.\n\nThe first fix most teams reach for is a cap on tokens per user or per session. The problem is that a cap also flags the wrong people. An attorney drafting a partner memo over several turns can use as many tokens as someone abusing the agent. So can a team running due diligence over a long list of documents. Both need every token they use. The abusive user produces output nobody reads or spends inefficiently, and you still pay for every token. A token count tells you how much the agent wrote, not how useful or impactful the output was.\n\nInstead of counting tokens, the Token Misuse detector looks at how a session behaves.\n\nThe abusive sessions we looked at tend to fall into three patterns:\n\nAn honest power user's session looks different. It has a real goal and a plan, each turn goes back to the source documents, and it ends once the deliverable is done.\n\nRunning an LLM over every session just to catch wasted tokens would burn its own budget, so the Token Misuse detector analyzes traces and logs from your Agent Development Kit (ADK) agent in two stages. A cheap statistical first pass screens all traffic; one of its checks, token usage escalation, watches how token counts grow across LLM calls. Sessions that have leading indicators of abusive patterns are then evaluated deeper by an LLM for Token Misuse, where Gemini reads the full session and decides whether it's abuse or heavy, honest work. All of this runs in the background, about two minutes behind your agent, so it adds no latency and never prevents agent execution.\n\nWhen the Token Misuse detector flags a session, you get a finding with a severity, a probability score, a plain-language explanation, and recommended fixes. In Figure 3, it catches a user looping the legal-review agent over its own prior answers and recommends breaking recursive meta-operations and capping follow-up turns that add no new source material.\n\nWe tested the Token Misuse detector on simulated legal document-review sessions at three levels: everyday use, heavy power-user work, and abuse. The power-user sessions ended up being the most important part of the test. If a test set only has everyday sessions and abuse, the abusive sessions are simply the ones with the most tokens, so a plain token threshold scores well. Real traffic also has heavy, honest sessions that use just as many tokens, and that same threshold flags your best customers.\n\nWe then ran a seven-hour A/B test across six simulated agents (including 106 runaway-token abuse sessions), comparing our existing detectors alone against the pipeline with the Token Misuse detector enabled. With the detector, recall on runaway-token abuse (the share of abusive sessions that got a finding) rose from 29% to 76%, precision (the share of findings that were actually abuse) rose from 94% to 98%, and the detector added zero false positives on honest power-user sessions. Precision and recall across our other five anomaly scenarios held steady. We tuned and tested the detector on this document-review workflow; token growth looks different in code-generation or data-pipeline agents. Even so, the core trade-off holds: a threshold sees the same count for the attorney and the abusive session, while the detector reads what each session did and flags only the waste.\n\nThe Token Misuse detector is enabled by default in Agent Anomaly Detection, now in Private Preview for teams deploying agents on the Gemini Enterprise Agent Platform with ADK 2.1.0 or later. The [documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agent-anomalies-overview) covers Private Preview access, prerequisites, and one-click setup.\n\nOnce findings start coming in, use the recommended guardrails, such as capping single-turn output length or follow-up turns that add no new source documents, rather than setting a flat session token cap. Detection runs about two minutes behind the session, so for longer sessions like an endless-variations loop, an ADK callback can check for findings through the API and stop the session before its next turn.", "url": "https://wpnews.pro/news/catch-token-misuse-with-agent-anomaly-detection", "canonical_source": "https://developers.googleblog.com/catch-token-misuse-with-agent-anomaly-detection/", "published_at": "2026-12-03 21:44:17.162094+00:00", "updated_at": "2026-12-03 21:44:19.474404+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "ai-products", "mlops"], "entities": ["Google", "Gemini", "Agent Anomaly Detection", "Token Misuse detector", "Gemini Enterprise Agent Platform", "Agent Development Kit"], "also_reported_by": [], "takeaway": "The two-stage Token Misuse detector raised runaway-token abuse recall from 29% to 76% and precision from 94% to 98% with zero false positives on honest power users by screening ADK traces statistically before an LLM review, rather than capping tokens per user.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/catch-token-misuse-with-agent-anomaly-detection", "markdown": "https://wpnews.pro/news/catch-token-misuse-with-agent-anomaly-detection.md", "text": "https://wpnews.pro/news/catch-token-misuse-with-agent-anomaly-detection.txt", "jsonld": "https://wpnews.pro/news/catch-token-misuse-with-agent-anomaly-detection.jsonld"}}