> Markdown version of [/videos/100700-your-ai-agents-are-bleeding-tokens-building-a-runtime-cost-control-plane-for-llms](https://www.wearedevelopers.com/videos/100700-your-ai-agents-are-bleeding-tokens-building-a-runtime-cost-control-plane-for-llms). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Your AI Agents Are Bleeding Tokens: Building a Runtime Cost Control Plane for LLMs Are broken prefix caches and hidden reasoning loops quietly doubling your LLM bill? Learn to intercept runaway agent costs in real time with a zero-latency runtime control plane. - **Speakers:** [Aakriti Aggarwal](https://www.wearedevelopers.com/@aakriti-aggarwal), [Bhavishya Pandit](https://www.wearedevelopers.com/@bhavishya-pandit) - **Event:** Conference India 2026 - **Published:** November 25, 2026 - **Duration:** 32:14 - **URL:** https://www.wearedevelopers.com/videos/100700-your-ai-agents-are-bleeding-tokens-building-a-runtime-cost-control-plane-for-llms - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/1d905a8c5055405eea136d50439c36aa/thumbnails/thumbnail.jpg?time=30000ms ## Summary Deploying autonomous AI agents to production often shifts LLM spend from linear to exponential. Aakriti Aggarwal and Bhavishya Pandit examine three common cost traps: broken prefix caches caused by dynamic timestamps or reordered tool calls, runaway reasoning and retry loops hidden inside thinking tags, and deceptive HTTP 200 status responses where models bill for extensive reasoning without returning a usable output. Furthermore, hitting the 200k token cliff can suddenly double context pricing, while traditional observability tools like Langfuse, LangSmith, LiteLLM, and Portkey primarily surface these failures as post-mortem traces after the bill arrives. To prevent token wastage in real time, the speakers introduce Aurex, an open-source, privacy-first runtime cost control plane SDK. Operating locally between application code and model providers with zero latency overhead, Aurex governs the entire agent call lifecycle. Before the call, it repairs JSON schemas and enforces prefix shielding via deterministic alphabetical tool sorting and tail appending to secure 50–90% KV cache discounts. During execution, tunable live circuit breakers cap retry attempts, truncate excessive reasoning budgets, and warn or summarize context before breaching the 200k threshold. Post-call, Aurex validates outputs for CI gating, shifting engineering metrics from raw token consumption to "cost per successful task done." **Keywords:** runtime cost control plane, LLM token wastage, aurex SDK, prefix cache optimization, KV cache hit ratio, agent reasoning loops, 200k token cliff, context bloat management, live circuit breakers, tail appending prompts, cost per successful outcome, agentic AI observability, JSON schema validation, reasoning token budget, DPDP compliance ## Chapters 1. **Identifying hidden token wastage in production AI agents** (00:03) — Transitioning AI agents from development to production often triggers exponential cost spikes caused by unforeseen reasoning and retry loops. 1. **Broken prefix caches, reasoning loops, and false 200 statuses** (03:44) — Dynamic timestamps break KV prefix caching while hidden reasoning loops and empty HTTP 200 responses silently drain compute budgets without delivering outputs. 1. **Governing LLM calls before, during, and after execution** (08:28) — Controlling agent costs requires fixing JSON schemas pre-call, capping reasoning budgets and retries mid-call, and verifying actual outcomes post-call. 1. **Introducing the Aurex SDK for runtime cost control** (10:48) — Operating between application code and model providers, the Aurex SDK prevents context bloat and cache misses with zero latency overhead and full privacy. 1. **Prefix shielding, live circuit breakers, and outcome verification** (13:31) — Alphabetical tool sorting and tail appending preserve prompt caches, while tunable circuit breakers halt infinite agent loops and verify output generation. 1. **Integrating Aurex and comparing AI observability tools** (17:18) — Unlike passive tracing tools like Langfuse or AI gateways like LiteLLM, a three-line SDK integration actively blocks runaway spend and empty responses. 1. **Measuring cost per successful task and roadmap extensions** (19:56) — Shifting metrics from raw token consumption to cost per successful task ensures real value, with upcoming support planned for Claude Code, Codex, and DPDP compliance. 1. **Handling context limits, planning budgets, and graceful fallbacks** (24:47) — Configurable token thresholds warn developers at 185k tokens and summarize or cut off excess reasoning at 200k without breaking the underlying LLM call. 1. **Trade-offs between deterministic token control and context optimization** (29:23) — Relying on external LLMs to optimize context introduces latency and privacy risks, making local deterministic budget enforcement more reliable. ## Related Moments - [Architecting inference layers and meta harnesses to manage token costs](https://www.wearedevelopers.com/videos/100600-inside-the-ai-native-engineering-org) (from "Inside the AI-Native Engineering Org") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/ffe256ba71a3d5017d4ff5d033858092/thumbnails/thumbnail.jpg?time=242411ms - [Monitoring and constraining autonomous AI agent token costs](https://www.wearedevelopers.com/videos/1735-engineering-mindset-in-the-age-of-ai-gunnar-grosch-aws) (from "Engineering Mindset in the Age of AI - Gunnar Grosch, AWS") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/ead760cd99e6dff2c4c01a604a55196c/thumbnails/thumbnail.jpg?time=176445ms - [Transitioning toward AI-first coding and managing token costs](https://www.wearedevelopers.com/videos/100198-the-last-mile-of-ai-from-prototype-to-production) (from "The Last Mile of AI: From Prototype to Production") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/ff9c09619a4fcd6d8f9ced4e821a0fe9/thumbnails/thumbnail.jpg?time=108950ms - [Managing token budgets and enterprise usage of coding agents](https://www.wearedevelopers.com/videos/1841-wearedevelopers-live-bitpanda-s-ai-first-approach) (from "WeAreDevelopers LIVE - Bitpanda’s AI First Approach") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/a93a3550210466bdca13415dee11adf9/thumbnails/thumbnail.jpg?time=90620ms - [Managing costs and limits for autonomous artificial intelligence agents](https://www.wearedevelopers.com/videos/2016-move-fast-break-budgets-finops-in-the-age-of-devops-and-ai) (from "Move Fast, Break Budgets: FinOps in the Age of DevOps and AI") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/1a3939c918f98749c8b48d92112d0453/thumbnails/thumbnail.jpg?time=126920ms - [Addressing AI observability and cost transparency with Langfuse](https://www.wearedevelopers.com/videos/100240-analytics-in-the-age-of-agentic-ai-a-tour-of-clickhouse-and-langfuse) (from "Analytics in the Age of Agentic AI: A tour of ClickHouse and Langfuse") - **Thumbnail URL:** https://customer-goifxnzhrq3d0d54.cloudflarestream.com/84969b47cc8bb800c15f32af68f1cb10/thumbnails/thumbnail.jpg?time=15589ms ## Related Articles - [Infer Once, Run Everywhere: Zero-Token Architecture](https://www.wearedevelopers.com/magazine/783-infer-once-run-everywhere-zero-token-architecture) - [Your AI coding tool is getting used. But is it doing anything useful?](https://www.wearedevelopers.com/magazine/758-your-ai-coding-tool-is-getting-used-but-is-it-doing-anything-useful) - [ I Gave a Video Editor More Autonomy Than a Trading Bot. On Purpose.](https://www.wearedevelopers.com/magazine/773-i-gave-a-video-editor-more-autonomy-than-a-trading-bot-on-purpose) - [6 Open-Source Tools to Reduce Your Token Usage](https://www.wearedevelopers.com/magazine/746-6-open-source-tools-to-reduce-your-token-usage) ## Related Jobs - [Senior Software Engineer - Semantic Data Lake (Open)SDE3](https://www.wearedevelopers.com/jobs/48597-senior-software-engineer-semantic-data-lake-open-sde3) at **WEX** - [Senior AI Scientist - Model Training & Architecture](https://www.wearedevelopers.com/jobs/ext/4713481-senior-ai-scientist-model-training-architecture) at **BWI GmbH** - [Senior Data & AI Architect](https://www.wearedevelopers.com/jobs/48602-senior-data-ai-architect) at **reeeliance IM GmbH** - [AI Full Stack Engineer](https://www.wearedevelopers.com/jobs/ext/4809244-ai-full-stack-engineer) at **Almedia** - [Lead Engineer, Google Cloud](https://www.wearedevelopers.com/jobs/ext/4747258-lead-engineer-google-cloud) at **PwC** - [Director, AI & Data Solution Architect](https://www.wearedevelopers.com/jobs/ext/4863189-director-ai-data-solution-architect) at **PwC**