<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nick Hystax on Medium]]></title>
        <description><![CDATA[Stories by Nick Hystax on Medium]]></description>
        <link>https://medium.com/@NickHystax?source=rss-9e0d4f6ecae0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*J5C_W_IG7ZDaDFOQSObyVg.jpeg</url>
            <title>Stories by Nick Hystax on Medium</title>
            <link>https://medium.com/@NickHystax?source=rss-9e0d4f6ecae0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:10:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@NickHystax/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Why Claude Code Pays Twice for the Same Tokens]]></title>
            <link>https://pub.towardsai.net/claude-code-prompt-cache-costs-1987e858b56b?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1987e858b56b</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 14:17:57 GMT</pubDate>
            <atom:updated>2026-11-13T03:44:43.881Z</atom:updated>
            <content:encoded><![CDATA[<h4>On Opus 5.5 a cache write costs 25 times a read, and the cache expires after five minutes. Here is what that does to the bill, and what fixed it.</h4><figure><img alt="Claude Opus 5.5 prices per million tokens: cache read $0.20, uncached input $4, 5-minute cache write $5, 1-hour cache write $8" src="https://cdn-images-1.medium.com/max/1024/1*CnSUwkEyopMYay1S6CnTFQ.png" /><figcaption>On Opus 5.5, writing a token to the prompt cache costs 25 times as much as reading it back.</figcaption></figure><p>When much of our engineering work moved to Claude Code, we did what we always do with a new cost line: we measured it. We ran Claude Code on Opus 5.5 through Terminal-Bench 2.1, 89 command-line tasks, and priced every request at Anthropic’s real rates. The largest line on the bill wasn&#39;t the model’s output, and it wasn&#39;t the agent reading its logs. It was writing the prompt cache.</p><p>That is a strange place for money to go, because the cache exists to save money. This piece explains why it happens and what we changed in OptScale Kompressor, an open-source proxy that runs locally between Claude Code and Anthropic, to stop it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpoe.shuhuigeng.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FcIkBZoqEQg8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fpoe.shuhuigeng.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DcIkBZoqEQg8&amp;image=https%3A%2F%2Fpoe.shuhuigeng.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FcIkBZoqEQg8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/588c31e9367c79fb6900867fb54dfda2/href">https://medium.com/media/588c31e9367c79fb6900867fb54dfda2/href</a></iframe><h3>How Claude Code uses the cache</h3><p>Claude Code re-sends the whole conversation on every request and marks it with explicit cache breakpoints. So almost every request is a long prefix the provider has already seen, plus a short new tail. In our runs, 92–95% of billed prompt tokens were cache reads.</p><p>Reads are cheap: on Opus 5.5, a cached token costs $0.20 per million, a twentieth of the normal input price. Writes are not. Putting a token into the default five-minute cache costs $5 per million, 25 times a read, and a one-hour entry costs $8.</p><h3>Where the money leaks</h3><p>A cache entry lives five minutes. That is plenty while the agent thinks and edits, but not while it waits on a tool. A full build, a training run or a long simulation often runs past that, and by the time the agent returns, the cached prefix is gone, and the next request writes the whole conversation to the cache again at the write price.</p><p>Without compression, this happened 33 times in an 89-task run and re-wrote 927K tokens, a third of everything billed at full price.</p><figure><img alt="Timeline: without Kompressor the 5-minute cache expires during a long tool run; a ping at 4.5 minutes keeps it valid" src="https://cdn-images-1.medium.com/max/1024/1*fXEGb3YKzv9zBH1VZrHaZw.png" /><figcaption>The cache expires five minutes after its last use. A ping at 4.5 minutes reads it and restarts the clock.</figcaption></figure><h3>Why more compression doesn’t fix it</h3><p>The obvious move for a compressor is to remove more text. On Claude Code that backfires: rewriting even one byte inside the cached prefix invalidates it, and the next request pays the write price for everything after the change. Until this release, Kompressor left Claude Code uncompressed for exactly that reason.</p><p>The safe place to compress is the tail the provider hasn’t cached yet. Kompressor now touches only that part, the first time it is sent, and skips any cut under 4,000 characters. If the model asks for a removed piece back, that retrieval round re-sends the large prefix, so a small cut would cost more than it saved. Function bodies are left alone on this provider too. On Claude Code, compression removes only 5–8% of the tail, and that is by design.</p><figure><img alt="A Claude Code request: the cached prefix stays byte-identical and only the new tail is compressed, removing 5–8% of it" src="https://cdn-images-1.medium.com/max/1024/1*VftyPTylIBKLv5zyoAzPzw.png" /><figcaption><em>The cached prefix stays byte-identical. Only the new tail is compressed.</em></figcaption></figure><h3>Keeping the cache warm</h3><p>The bigger lever is not letting the cache expire. While the agent runs a tool, Kompressor re-sends the last request every 4.5 minutes with <strong><em>max_tokens: 1</em></strong>. The provider reads the cached prefix at the read price, and that read restarts the five-minute clock. Pinging stops when the agent sends its next request, after 11 pings (about 50 minutes), when a ping fails, or as soon as a ping finds nothing cached.</p><p>After a conversation’s first idle gap longer than five minutes, Kompressor also switches it to one-hour cache entries. Using them all the time cost more in our replay of earlier runs, so the switch happens only when the pauses show up. Every one of these decisions is priced on Anthropic’s per-model rates.</p><h3>What it did to the bill</h3><p>On the same 89 tasks, the Anthropic API bill dropped from $35.35 to $28.30 per run (20%), and tasks solved rose from 89.9% to 90.6%. Prompt tokens lost to cache expiry fell from 927K to 13K per run. The pings added about 2% to the bill and avoided rewrites worth about 13%. On the 14 tasks that wait on long-running tools, cost fell 34%.</p><figure><img alt="Waterfall of the Anthropic API bill per run, from 100% to 80% of the bill without compression, mostly from 15.4 points less in cache writes" src="https://cdn-images-1.medium.com/max/1024/1*EBgwIa6OBqTG39qEkj-7hw.png" /><figcaption><em>Where the 20% came from. Cache writes account for about 15 of the 20 points.</em></figcaption></figure><h3>Reading the numbers honestly</h3><p>No agent solves a task the same way twice, and in this run four tasks produced the whole net difference. On three of them, the uncompressed agent simply took a much longer route. So the 20% is what we measured, and we expect to repeat about 11% from keeping the cache warm, plus a few percent from compressing the tail.</p><h3>Try it</h3><p>Kompressor is one Rust binary under the MIT license. It runs on your own machine as a local proxy, and requests go from there to Anthropic with your own API key or Claude login. The packaged config already turns on tail-only compression and the adaptive one-hour cache for Claude Code. Keep-warm is off until you turn it on, because it is the only request the proxy sends that no client asked for:</p><pre>[proxy.providers.anthropic]<br> cache_keep_warm = true</pre><p>Then start Claude Code through it:</p><pre>kompressor wrap claude</pre><p>Code and README: <a href="https://github.com/hystax/optscale-kompressor">https://github.com/hystax/optscale-kompressor</a></p><p>The full write-up, with the cost breakdown: <a href="https://optscale.ai/blog/claude-code-prompt-caching">https://optscale.ai/blog/claude-code-prompt-caching</a></p><p><em>Disclosure: I work at Hystax, which builds OptScale AI and the open-source Kompressor discussed here, so I think about this professionally — and, yes, with some bias. I’ve tried to keep this piece focused on the problem: what the prompt cache really costs on Claude Code. The tool is the worked example, and I also show which part of the saving we expect to repeat and which part came from agents taking shorter paths.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1987e858b56b" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/claude-code-prompt-cache-costs-1987e858b56b">Why Claude Code Pays Twice for the Same Tokens</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Compressing Your AI Agent’s Context Can Raise Your LLM Bill]]></title>
            <link>https://pub.towardsai.net/context-compression-prompt-caching-ai-agents-d9aa61796dd1?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9aa61796dd1</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 14:15:13 GMT</pubDate>
            <atom:updated>2026-10-16T11:00:42.399Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Prompt caching rewards repetition, and a compressor can quietly break it. What we learned while building a cache-safe compressor for coding agents.</strong></h4><figure><img alt="Bar chart of one 100,000-token turn: $0.08 with no compression, $0.06 with stable compression that keeps the cache, and $0.35 with unstable compression that breaks the cache." src="https://cdn-images-1.medium.com/max/1024/1*gy4hGfNsYGrXOzTbqSwVFw.png" /><figcaption><em>One illustrative 100,000-token turn at GPT-5.5 list prices. Compression that breaks the prompt cache costs more than no compression at all.</em></figcaption></figure><p>A coding agent never forgets a log. On every turn, it sends its whole working history back to the model, so the build output it read at step three is still being sent, and paid for, at step forty.</p><p>The obvious fix is to compress that history. We built a compressor for this, and the first lesson was that compression can increase the bill. This piece explains why, which design rules fixed it, and what the result saved on 89 real coding tasks.</p><h3><strong>Most of the prompt is the agent reading its own logs</strong></h3><p>A coding agent works in a loop: run a command, read the output, think, run the next one. Each turn, the model sees the whole conversation.</p><p>In our traces, tool output makes up about half of all prompt bytes; almost all the rest is encrypted reasoning, which cannot be compressed. That tool output is also highly redundant: progress bars redraw, package managers repeat themselves, and test runners print near-identical lines. And about 93% of input tokens are cache reads, billed in our runs at a tenth of the normal price.</p><p>That last fact changes the economics.</p><h3><strong>How a compressor breaks the cache</strong></h3><p>Prompt caching works on prefixes. If this turn’s prompt starts with exactly the same bytes as the last one, the provider bills those bytes at the cached rate. Change something early in the conversation, and everything after it is billed at full price again.</p><p>Here is the arithmetic for one illustrative 100,000-token turn, at GPT-5.5’s list prices of $5.00 per million uncached and $0.50 per million cached input tokens, shown in the chart at the top: $0.08 with no compression, $0.06 compressed by 30% with the cache intact, and $0.35 compressed by 30% with the cache broken.</p><p>The last case is the trap. The compressor removed 30% of the tokens and made the turn more than four times as expensive.</p><p>So a compressor must produce the same output for the same input on every turn. Two common designs make that hard.</p><p>The first is query-aware compression: the compressor reads the user’s latest message to decide what to keep, so the same log compresses differently when the question changes. The second is machine learning under a time budget: a model that stops at a deadline can return different output depending on machine load.</p><p>Headroom, an established open-source compressor and the project our engine started from, does both. That trade-off suits a single developer’s desktop. It did not suit a shared gateway serving many teams.</p><h3><strong>The five rules we built around</strong></h3><p>Our compressor, Kompressor, began as a port of Headroom’s algorithmic compressors. We kept the core idea, compress and retrieve, and rebuilt everything else around five rules.</p><p>1. <strong>Same input, same bytes.</strong> No clock, no randomness, no query and no machine learning model. The output depends only on the input, so the cache survives.</p><p>2. <strong>Remove redundancy, not meaning.</strong> Summarization scores well on compression ratio but loses facts. When we ported Headroom’s prose compressor, it removed 6.2 points more text but lost 12.9 points of details the agents later reused. So we de-duplicate instead: the model always keeps at least one real instance of every distinct line.</p><p>3. <strong>Label every cut and make it recoverable.</strong> Each removal becomes a marker such as [… 412 log lines omitted [ref:k_…]; 3 ERROR, 1 WARN]. The model can pass that reference to a retrieval tool and get the original back for an hour.</p><p>4. <strong>Never worse, fail open.</strong> A result that is not smaller is discarded. Any error sends the request through unchanged.</p><p>5. <strong>Only machine output.</strong> System, developer and assistant messages, outputs under about 512 characters, and blocks carrying cache breakpoints are never touched.</p><p>The rest is format work. Each tool output is classified and sent to a compressor built for its format: build logs, compiler diagnostics, JSON, diffs, search results, source code and more. A few results from that work:</p><ul><li>A 30,807-character training progress stream became 274 characters, because only the final frame of a redrawn progress bar matters.</li><li>On a 27.6K apt install log, Headroom removed 15% and Kompressor 97%, while keeping every “Setting up &lt;package&gt; (&lt;version&gt;)” line.</li><li>In one GCC output, 1,873 of 2,334 characters were echoed source and carets that the error message already described.</li></ul><p>All of this runs as a single Rust binary at about 0.2 milliseconds per kilobyte of tool output.</p><h3><strong>What it saved on a real benchmark</strong></h3><p>We measured on Terminal-Bench 2.1, a public benchmark of 89 command-line tasks (87 ran in every setup), with the Codex CLI agent running GPT-5.5. Each saving below is the difference between real provider bills, including cache discounts, paired task by task. We didn’t price removed tokens at the list rate, which inflates self-reported savings.</p><figure><img alt="Table comparing three setups per full benchmark run. Cost: $107.89 with no compression, $99.04 with Headroom at default settings, $83.40 with Kompressor. Input tokens: 96.1M, 95.5M and 72.2M. Tasks solved: 82.2%, 81.6% and 81.1%." src="https://cdn-images-1.medium.com/max/1024/1*p1ixI3H4xPIhcbzxI7lMRw.png" /><figcaption><em>Per full run on Terminal-Bench 2.1 (87 tasks), Codex CLI with GPT-5.5. Real provider bills, prompt-cache discount included.</em></figcaption></figure><p>That is 22.7% off the bill and 25% fewer input tokens, with no statistically significant change in tasks solved. Headroom saved 8.2% at its defaults and 11.6% at its most aggressive setting.</p><p>The savings did more than lower the bill. Because less text went back to the model on each turn, requests got smaller too: the 90th-percentile request fell from 106.9K to 66.5K tokens, and the share of requests over 200K tokens, close to GPT-5.5’s 258K context window, dropped from 1.9% to 0.13%. Most of the money came from the tasks with the longest logs. Machine learning training and evaluation tasks cost 26% less, and building from source costs 28% less; together with data pipelines, these groups accounted for 83% of the total savings.</p><h3>Where it does not help</h3><p>Compression is not free money everywhere, and the per-task results show it:</p><ul><li><strong>Short tasks.</strong> In algorithm and puzzle tasks, the median tool output is 270 characters, below the compression floor. There is nothing to save.</li><li><strong>Prose.</strong> We leave human-written text alone by design. LaTeX in one document task compressed only 18%.</li><li><strong>Cheaper context changes agent behavior.</strong> In one training task, 96% of tool output was removed, but the cheaper context let the agent keep polling a long training run. It cost $5.12 per trial, against $3.16 without compression and $8.85 with Headroom.</li><li><strong>The other tool sometimes wins.</strong> In reverse-engineering and security tasks, Headroom came out cheaper and solved more. On one DNA assembly task, it also compressed more than we did.</li></ul><p>Short, cheap tasks swing more with the agent’s path than with its context. Judge compression on the long, log-heavy work, where the money is.</p><h3><strong>What to check before you trust a compressor</strong></h3><p>If you run agents at scale and are evaluating any context compressor, five questions will tell you more than its compression ratio:</p><p>1. <strong>Is the saving measured on the billed cost, with the cache discount included?</strong> Tokens removed are not money saved.</p><p>2. <strong>Is the output deterministic?</strong> Feed it the same input twice and compare the bytes.</p><p>3. <strong>Can the model get the original back?</strong> Every cut should be labeled and retrievable.</p><p>4. <strong>What does it never touch?</strong> System and developer prompts and cache breakpoints should be off limits.</p><p>5. <strong>Where does it lose?</strong> A credible benchmark shows the task types where the tool does not help.</p><p><strong>Code and full results</strong></p><p>Kompressor is open source on GitHub: <a href="https://github.com/hystax/optscale-kompressor">https://github.com/hystax/optscale-kompressor</a>. The <a href="https://optscale.ai/blog/context-compression-coding-agents/?utm_source=socials&amp;utm_medium=Medium&amp;utm_campaign=optscale-kompressor">full benchmark report</a>, with per-task results and methodology, is available on our blog.</p><p><em>Disclosure: I work at Hystax, which builds OptScale AI and the open-source Kompressor discussed here, so I think about this professionally — and, yes, with some bias. I’ve tried to keep this piece focused on the problem. The tool is the worked example, and I also cover cases where it helps less.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9aa61796dd1" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/context-compression-prompt-caching-ai-agents-d9aa61796dd1">Why Compressing Your AI Agent’s Context Can Raise Your LLM Bill</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chargeback Was Built for Servers. AI Agents Broke It]]></title>
            <link>https://pub.towardsai.net/ai-agent-chargeback-shared-llm-spend-960fff461339?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/960fff461339</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 13:20:16 GMT</pubDate>
            <atom:updated>2026-10-08T06:18:46.253Z</atom:updated>
            <content:encoded><![CDATA[<h4>Shared agents, nested calls, and retries make AI spend hard to pin on anyone. Here is an attribution model that survives all three</h4><figure><img alt="A server rack tied to a single tag labeled Team A, next to a shared AI agent whose tangled threads lead to tags for Sales, Research, Support, Legal and Finance. One thread loops, one passes through a smaller sub-agent, and a loose orange thread ends at a tag marked with a question mark." src="https://cdn-images-1.medium.com/max/1024/1*U2yZDJA-5HlwE_USS4f9PA.png" /></figure><p>Picture a document-triage agent your platform team built last spring. Support uses it to summarize tickets. Sales uses it to pull clauses out of contracts. Legal uses it to flag risky terms. All three call the same endpoint, and the endpoint calls the model provider with one API key. At the end of the month, the provider’s usage report shows one total for that key, and finance asks the obvious question: whose number is it? Nobody can answer, because the information needed to answer it was never recorded.</p><p>That is the core of the AI cost attribution problem. It looks like a reporting problem, but it is a data-capture problem that only becomes visible in reporting.</p><h3>The spend grew faster than the ownership</h3><p><a href="https://menlovc.com/perspective/2025-the-state-of-generative-ai-in-the-enterprise/">Menlo Ventures</a> puts enterprise spending on generative AI at $37 billion in 2025, more than triple the $11.5 billion of a year earlier. The estimate comes from a bottom-up market model plus a survey of about 500 U.S. enterprise decision-makers.</p><p>Ownership has not kept pace. In <a href="https://www.doit.com/blog/ai-spending-survey">DoiT’s AI Spend Reality Check</a>, which Sapio Research ran in February 2026 among 500 finance leaders at U.S. and U.K. organizations with 1,000 or more employees, 79% reported AI-related cost overruns in the previous twelve months. Just 15% could work out AI ROI without significant bottlenecks. Among the obstacles, 36% cited unclear financial attribution, behind the pace of technological change (40%), and finance and engineering defining success differently (37%). Asked who is accountable for AI spend, 55% pointed to technology leadership and 53% to finance. Those figures add up to more than 100%, so in many organizations both functions claim the budget, which in practice often means neither owns it.</p><h3>Why the old allocation model breaks</h3><p>Chargeback and showback have allocated shared IT costs for decades. Showback reports each team’s consumption while the cost stays in a central budget; chargeback moves the cost onto the consuming team’s budget. Both work cleanly when a resource has one owner: a virtual machine, a database, a software license. Tag the resource with its owner and the allocation follows. Shared resources were always the hard part, handled with allocation keys such as headcount or usage share. AI agents turn the hard part into the normal case.</p><p>AI agents break the one-owner model in three ways.</p><ul><li><strong>One agent, many consumers.</strong> The triage agent above has one owner, the platform team that built it, and three consumers. Tagging it with its owner sends the entire bill to a team that may not use it at all.</li><li><strong>Cost per task is volatile.</strong> Two calls to the same agent can differ by an order of magnitude depending on context length, the model selected, and how many retries the call needed. A monthly split by headcount or seats hides that variance, and the variance is often where the waste hides.</li><li><strong>The consumer may be another agent.</strong> An orchestrator calls a research agent, which calls a summarizer, which calls a model. If attribution stops at the credential that made the final model call, everything lands on the summarizer.</li></ul><p>The vocabulary of chargeback still applies. The tagging model underneath it does not.</p><h3>Attribute the request, not the resource</h3><p>The fix is to change the unit of attribution. Instead of asking who owns the agent, ask who caused each call. Identity has to travel with the request itself rather than live in an infrastructure tag.</p><p>In practice, every model call needs two identities, not one:</p><ul><li><strong>The executor:</strong> the agent or service that actually made the call. Engineering needs this for debugging, performance work, and per-agent usage.</li><li><strong>The payer:</strong> the team, product, or department the work was done for. Finance needs this to allocate the cost.</li></ul><p>For a single-purpose service, executor and payer point to the same owner, which is why the problem stays hidden until the first shared agent ships. For a shared agent, they diverge on every call. I think of this as the two-identity rule: if a request record cannot name both the executor and the payer, you can&#39;t allocate that request&#39;s cost without guesswork.</p><p>Beyond the two identities, a usable attribution record carries four more fields:</p><p>• a root trace ID shared by every call in a chain, so nested calls roll up to the request that started them;</p><p>• the use case or task type, so cost can be read per unit of work rather than as raw volume;</p><p>• the model, with input, cached input, and output tokens priced at the rate actually billed;</p><p>• the outcome: success, failure or retry, plus latency.</p><h3>Where to capture identity</h3><p>There are three places to record it, and each trades coverage against effort.</p><p><strong>In application code.</strong> Each service attaches metadata to its own calls. It is flexible and free to start, but coverage depends on every team remembering to do it, in every service, indefinitely. The first agent written in a hurry breaks the ledger.</p><p><strong>At the provider.</strong> <a href="https://help.openai.com/en/articles/9186755">OpenAI projects</a> split usage by project, with project-scoped API keys and per-project spend limits. <a href="https://platform.claude.com/docs/en/manage-claude/workspaces">Anthropic workspaces</a> offer workspace-scoped keys and monthly spend limits, with up to 100 workspaces per organization. Both are reliable and require no code. Their limits are scope and silos: each provider keeps its own ledger, a team using several providers has to stitch those ledgers together, and a project or workspace alone does not carry a payer identity through a shared agent.</p><p><strong>At a gateway.</strong> A proxy between your applications and the providers issues its own credentials, usually called virtual keys, one per team, service, or agent, and logs every request with its key, model, tokens, cost, and outcome. Applications change a base URL and a key rather than their code. The result is one ledger across providers and complete capture of the traffic that crosses it. The trade-offs are real: the gateway adds a hop to the request path, must run with the same availability as everything else on that path, and traffic that bypasses it stays invisible.</p><p>For shared agents, the gateway pattern has one more advantage: identity can follow the caller instead of the agent. Support’s requests to the triage agent carry one identity, sales’ requests carry another. This requires one change inside the shared agent, which must forward the caller’s credential or an identifying header with each model call. After that, the payer is captured when the call happens, not reconstructed later.</p><h3>Five edge cases that break naive attribution</h3><p>Most attribution schemes look correct in a demo and drift within a month. These are the usual reasons.</p><p>1. <strong>Retries.</strong> An agent that re-asks the model twice because the output failed validation pays for three full calls. Charge the cost to the payer, but report retry overhead as a separate line for the agent’s owner. The payer did not cause the failures; the agent’s owner can fix them.</p><p>2. <strong>Nested calls.</strong> Without a root trace ID propagated through the chain, an orchestrator’s work is billed to whichever sub-agent made the last model call. Propagate the original payer identity with the trace, the same way you propagate a request ID for logging.</p><p>3. <strong>Cached tokens.</strong> Major providers bill cached input at a different rate from standard input. If your ledger prices every token at the standard rate, attributed totals will not match the invoice, and the gap will be blamed on attribution itself. Record cached tokens separately and price them at the rate actually billed.</p><p>4. <strong>Shared fixed costs.</strong> Embedding a document corpus, maintaining a shared vector index, or running nightly evaluations are costs no single request causes. Decide explicitly whether to allocate them in proportion to usage or hold them centrally and show them separately. Either works. Leaving the decision open produces a different answer every month.</p><p><strong>Unattributed traffic.</strong> Some calls will arrive without a usable identity: legacy scripts, a forgotten prototype, a vendor integration. Report this as its own figure, with its share of total spend. Spreading it silently across teams makes every team’s number wrong and hides the coverage gap you should be closing.</p><h3>Reconcile against the invoice</h3><p>Attribution is trusted only when it adds up. Once a month, add attributed spend to unattributed spend and compare the total with the provider invoices. A small difference is normal because of timing and rounding. A large or growing one usually means one of two things: the price table is stale after a provider price change, or traffic is reaching providers without passing through your capture point. Both are fixable, and both stay invisible if nobody runs the check.</p><h3>From who spent it to what it bought</h3><p>Attribution tells you who spent the money. It does not tell you whether the spend was worth it. A team that spends twice as much as another but resolves five times as many support tickets is not the problem, yet a spend-only report makes it look like one.</p><p>Once identity is recorded on every request, the next step becomes possible: join cost to outcomes your other systems already record, such as tickets resolved, pull requests merged or documents processed, and compare value per dollar rather than dollars alone. That comparison is where the useful conversations start, and you can&#39;t build it without per-request attribution underneath.</p><h3>A rollout that doesn’t stall</h3><p>1. <strong>Start with showback.</strong> Show every team its numbers before anyone is billed. Disputes about the data are cheaper to settle before money moves.</p><p>2. <strong>Give every payer-and-agent pair its own identity,</strong> a credential or a forwarded header, with names a finance colleague can read.</p><p>3. <strong>Route all model traffic through one capture point,</strong> and measure what still bypasses it.</p><p>4. <strong>Give every credential a budget owner.</strong> A number with no person attached gets reported and ignored.</p><p>5. <strong>Set caps and alerts per credential,</strong> so a looping agent hits a limit within minutes rather than at month end.</p><p>6. <strong>Review weekly.</strong> By the time a monthly invoice arrives, the behavior behind a spike is weeks old.</p><p>7. <strong>Move to chargeback only once the numbers are trusted,</strong> and only if your accounting model needs it. Some organizations never do, and that is a legitimate choice.</p><h3>The short version</h3><p>AI spend is hard to attribute because the old unit of allocation, the resource, no longer maps to a single owner. Moving the unit to the request, recording executor and payer on every call and capturing both at one point solves most of the problem. Handling the edge cases (retries, nested calls, cached tokens, shared costs and unattributed traffic) solves the rest. None of it needs a new discipline. It needs one more fact recorded at the moment it is cheapest to record: when the call is made.</p><p><em>Disclosure: I work on tooling for AI agent governance, so this is a problem I think about professionally — and, yes, with some bias. I’ve kept this piece about the problem, not any product.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=960fff461339" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/ai-agent-chargeback-shared-llm-spend-960fff461339">Chargeback Was Built for Servers. AI Agents Broke It</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Fix Was Already Shipped: Lessons From LiteLLM’s 2026]]></title>
            <link>https://pub.towardsai.net/self-hosting-litellm-lessons-2026-1133fa37e16b?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1133fa37e16b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 21:11:55 GMT</pubDate>
            <atom:updated>2026-10-06T03:24:36.436Z</atom:updated>
            <content:encoded><![CDATA[<h4>Two flaws on CISA’s exploited list and a documented gateway breach, each after a fix had shipped. Running an LLM gateway is an operations job.</h4><figure><img alt="Chart titled “Fixed upstream. Exploited anyway.” showing three LiteLLM vulnerabilities from 2026. For each, a green dot marks when a fix was released and an orange dot marks confirmed exploitation, with gaps of days, weeks, and more than two months." src="https://cdn-images-1.medium.com/max/1024/1*AFvvg3VwBWM6FZVzABJBpA.png" /><figcaption>Data: LiteLLM advisories, GitHub Advisory Database, Sysdig, CISA KEV catalog</figcaption></figure><p>In late August, Microsoft’s security researchers <a href="https://www.microsoft.com/en-us/security/blog/2026/08/26/when-ai-infrastructure-becomes-target-securing-gateways-control-points/">published a detailed account</a> of an intrusion into a LiteLLM gateway. The attackers read the gateway’s process environment and pulled out model-provider API keys, the LiteLLM master key, and the database connection string. They used that connection string to dump the tables holding model configuration and proxy-issued virtual keys. Then they installed a cryptominer, added an SSH key to a service account, and locked down their files so cleanup would be harder.</p><p>Microsoft assessed that the way in was most likely a known vulnerability chain involving LiteLLM’s MCP test endpoints. LiteLLM had shipped the fix for its side of that chain months earlier.</p><p>That detail ran through LiteLLM’s whole year. It is one of the most popular open-source LLM gateways, and in 2026 it took a series of serious hits. In almost every case where attackers actually got in, the code had already been fixed. The deployments had not.</p><h3>What happened, roughly in order</h3><p>The year started with a supply-chain attack. On 24 March, two malicious releases, 1.82.7 and 1.82.8, were published to PyPI with stolen publishing credentials. They were built to steal whatever credentials they could find, from SSH keys and Kubernetes tokens to cloud secrets. The second one hid its payload in a .pth file. Python processes those files every time the interpreter starts, so the package never even had to be imported. According to <a href="https://docs.litellm.ai/blog/security-update-march-2026">LiteLLM’s own incident report</a>, teams running the official proxy Docker image were not affected, because that image pins its dependencies.</p><p>April brought two critical authentication bugs. <a href="https://github.com/advisories/GHSA-jjhc-v7c2-5hh6">CVE-2026–35030</a>, rated 9.4, let attackers bypass JWT authentication on deployments that had it enabled. <a href="https://docs.litellm.ai/blog/cve-2026-42208-litellm-proxy-sql-injection">CVE-2026–42208</a>, rated 9.3, was worse: a SQL injection in the code that checks API keys, reachable with no credentials. The project fixed it in a stable release before publishing the advisory. <a href="https://www.sysdig.com/blog/cve-2026-42208-targeted-sql-injection-against-litellms-authentication-path-discovered-36-hours-following-vulnerability-disclosure">Sysdig</a> still saw targeted exploitation about 36 hours after the advisory was indexed, aimed squarely at the tables that store keys and credentials.</p><p>June put MCP in the spotlight. CVE-2026–42271, a command injection disclosed in April in the endpoints used to preview MCP servers, originally required a valid API key. <a href="https://horizon3.ai/attack-research/vulnerabilities/cve-2026-42271-chained-with-cve-2026-48710/">Horizon3.ai showed</a> it could be chained with a host-header bypass in Starlette, the web framework under LiteLLM, to achieve remote code execution without credentials. On 8 June, CISA added the flaw to its <a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">Known Exploited Vulnerabilities catalog</a>. A week later, <a href="https://www.obsidiansecurity.com/blog/litellm-privilege-escalation-rce">Obsidian Security</a> disclosed a chain of three CVEs, rated 9.9, that let a default low-privilege user promote themselves to proxy admin and run code on the host.</p><p>The Microsoft report followed on 26 August. Seven days later, on 2 September, a second LiteLLM vulnerability went onto CISA’s list. <a href="https://github.com/advisories/GHSA-7488-6r32-c95q">CVE-2026–59822</a> let anyone open an authenticated MCP session with a made-up bearer token, then list and call whatever MCP tools the gateway had configured. The fix, in version 1.84.0, had been public since the end of June.</p><h3>Every exploited bug already had a fix</h3><p>Put the dates side by side, and a pattern appears. The SQL injection was patched before anyone outside the project knew about it, and exploitation still began within two days of disclosure. CISA confirmed attacks on the MCP command injection weeks after the fixed release shipped. The MCP authentication bypass had been fixed for two months by the time CISA listed it. Microsoft’s case involved a chain whose LiteLLM half was fixed in the spring.</p><p>None of this describes a project that ignores security. The maintainers fixed problems quickly, ran a bug bounty, published advisories, and kept the official Docker image locked down well enough to dodge the March attack. The weak point was somewhere else: the time between a fix existing and that fix running on someone’s server.</p><p>That gap is an operations problem. It is also the one part of an open-source gateway that nobody can ship for you.</p><h3>Why the gateway is such a good target</h3><p>Most internal services hold a secret or two. A gateway holds nearly all of them. It keeps an API key for every model provider the company uses, a master key that can mint new keys, a database full of virtual keys, and, increasingly, connections to MCP tools that reach code repositories, ticketing systems, and databases. It also sees every prompt and every response in plain text.</p><p>The first line of Microsoft’s mitigation guidance is blunt:</p><blockquote><em>“Treat AI gateways as Tier-0 secrets stores.”</em></blockquote><p>Tier-0 is the label security teams normally reserve for domain controllers and identity systems, the components that grant access to everything else.</p><p>Obsidian Security made a related point in June. A compromised gateway sits between your agents and the model, so it can alter answers on their way back. When those answers drive tool calls, whoever controls the gateway is effectively steering your agents.</p><h3>If you run LiteLLM yourself, start here</h3><p>Most of what follows comes from the advisories themselves and from Microsoft’s mitigation list. None of it is exotic.</p><p>1. <strong>Check your version today.</strong> Anything below 1.84.0 is exposed to a flaw CISA lists as exploited. While you’re at it, find out who would apply the next fix and how long it would take them.</p><p>2. <strong>Keep management surfaces off the internet.</strong> The admin UI and management endpoints should not be reachable from outside, and both the API and the UI should require authentication.</p><p>3. <strong>Switch off what you don’t use.</strong> Two of this year’s worst bugs lived in MCP endpoints. If your gateway doesn’t serve MCP, the CVE-2026–59822 advisory’s own workaround is to disable MCP routes or block /mcp/ at your reverse proxy.</p><p>4. <strong>Get provider keys out of environment variables.</strong> In Microsoft’s case, the attackers read them straight from the process environment. A managed secret store, per-team virtual keys with spend limits, and a master key nobody uses day to day all shrink what a single compromise exposes.</p><p>5. <strong>Install from pinned, verified artifacts.</strong> The official image with pinned dependencies came through March untouched. If you install from PyPI, pin exact versions and hashes so a poisoned release can’t slip in during a routine rebuild.</p><p>6. <strong>Restrict outbound traffic.</strong> A gateway needs to reach a known list of provider endpoints. Deny the rest by default, and stolen keys and data have a much harder time leaving.</p><p>7. <strong>Watch the gateway process.</strong> A model proxy has no business starting a shell, running curl, or reading /proc/1/environ. If it does, treat it as an incident.</p><p>8. <strong>If any environment ever installed 1.82.7 or 1.82.8, rotate everything it could reach.</strong> Removing the package doesn’t undo what was copied off the machine.</p><h3>Deciding whether to keep running it</h3><p>That checklist is routine for some teams and unrealistic for others. Three questions usually settle which group you’re in.</p><p><strong>Can you ship a gateway upgrade within days, including on a Friday?</strong> CISA gave federal agencies two weeks to patch the September listing, and a regulator set that deadline. The April SQL injection showed attackers working on a 36-hour clock.</p><p><strong>Is there a named owner?</strong> “The platform team” is not an owner. A gateway looked after in whatever time is left over from product work tends to fall a few versions behind, and this year showed exactly what a few versions behind can cost.</p><p><strong>Does the gateway have to live inside your perimeter?</strong> Data residency or air-gapped requirements can rule out hosted services. They don’t automatically mean your own engineers have to operate the software, since some vendors support on-premises deployments.</p><p>If the first two answers are yes, running an open-source gateway yourself is a reasonable choice, and LiteLLM is still capable. If either one is no, the third question points to the alternative: a managed service where hosting is allowed, or a vendor-supported install where it isn’t. Swapping one self-hosted gateway for another won’t help much either way, because the upgrade work comes along with you.</p><h3>What the year actually showed</h3><p>Open-source gateways earned their popularity. They are flexible, support a huge range of providers, and let you read every line of code. What they can’t do is upgrade themselves. In 2026, the gap between “fixed upstream” and “fixed in production” is where the damage happened, and closing it is work someone has to own.</p><p>• • •</p><p><em>Disclosure: I work on tooling for AI agent governance, so this is a problem I think about professionally — and, yes, with some bias. I’ve kept this piece about the problem, not any product.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1133fa37e16b" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/self-hosting-litellm-lessons-2026-1133fa37e16b">The Fix Was Already Shipped: Lessons From LiteLLM’s 2026</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What the LiteLLM Breach Teaches Us About Securing LLM Gateways]]></title>
            <link>https://pub.towardsai.net/litellm-breach-llm-gateway-security-637932ef0bda?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/637932ef0bda</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 10:03:28 GMT</pubDate>
            <atom:updated>2026-09-30T04:34:06.661Z</atom:updated>
            <content:encoded><![CDATA[<h4>A poisoned scanner, a stolen publishing token, and all your API keys in one place. How the attack worked and the controls that limit the damage.</h4><figure><img alt="The scan passed. The keys left.” A four-step pipeline of trivy scan, PyPI publish, pip install and your gateway shows green passed checks, until API key names leak out of the gateway." src="https://cdn-images-1.medium.com/max/1024/1*2FLhLMXdd-7znL3JzIn--g.png" /><figcaption>The LiteLLM attack chain</figcaption></figure><p>On March 24, 2026, production systems running LiteLLM started falling over. Processes multiplied until CPUs sat at 100%, and containers were killed for running out of memory. The cause turned out to be a bug in someone else’s malware.</p><p>Two versions of LiteLLM, 1.82.7 and 1.82.8, had been published to PyPI with a credential stealer inside. A mistake in the payload made it spawn processes without limit, and that noise is what got it noticed. A researcher at FutureSearch spotted it while testing a Cursor MCP plugin that pulled in LiteLLM as a transitive dependency. Without the bug, the stealer could have run quietly for much longer.</p><p>The incident is worth studying closely, because the gateway is the part of the AI stack most teams trust without a second thought. This piece covers how the attack worked, why a gateway is so expensive to lose, and the controls worth putting in place now, no matter which gateway you run.</p><h3>How a security scanner became the way in</h3><p>The group behind the attack, tracked as TeamPCP, never went after LiteLLM directly. It went after Trivy, a popular open-source vulnerability scanner that thousands of projects run in CI through a GitHub Action.</p><p>In late February, someone exploited a misconfigured workflow in Trivy’s repository and stole a bot account’s access token. Aqua Security rotated credentials, but not all at once, and a working token survived. On March 19, TeamPCP used it <a href="https://www.trendaisecurity.com/en-us/resources-insights/trendai-security-blog/inside-litellm-supply-chain-compromise">to force-push 76 of the 77 release tags of trivy-action to malicious commits</a>. Every pipeline that referenced the action by tag now ran the attackers’ code. The real scan still ran afterward, so the output looked normal.</p><p>LiteLLM’s CI was one of those pipelines. The poisoned scanner ran in a job that also had access to the project’s PyPI publishing token, and it took the token. Five days later, the attackers used it to publish the two malicious releases. CloudSEK summed up the chain as “one unrevoked token, three tools deep”.</p><p>The payload was careful work. Version 1.82.7 hid the malicious code in the proxy server module. Thirteen minutes later, 1.82.8 added a .pth file, which Python executes every time the interpreter starts, whether or not anything imports LiteLLM. It swept each machine for more than 50 kinds of secrets, including cloud credentials, SSH keys, Kubernetes tokens, database passwords, and the LLM API keys for every configured provider. It encrypted the haul and sent it to a lookalike domain, models.litellm.cloud. On non-CI machines, it installed a systemd user service called sysmon.service that checked in for new payloads every 50 minutes. The code could also create privileged pods on every Kubernetes node it could reach.</p><p>How long the packages stayed live depends on whose timeline you read. CloudSEK puts it at about 40 minutes, while Trend Micro’s analysis has PyPI quarantining them roughly three hours after publication. Either way, it was long enough. CloudSEK reconstructed potential exposure across more than 2,500 organizations and about 434,000 CI/CD pipelines, and carefully notes <a href="https://www.securityweek.com/over-2500-organizations-impacted-by-litellm-supply-chain-attack/">this is exposure rather than confirmed compromise</a>. At the time of its analysis, Trend Micro had found no public confirmation that stolen credentials were used, and the Kubernetes spreading was present in the code but not confirmed in the wild. That uncertainty is part of the problem. Most affected teams had no reliable way to know what had been taken.</p><h3>Why the gateway is the worst place to get hit</h3><p>Most compromised libraries leak whatever happens to be lying around on the machine. A gateway is different, because concentrating secrets is its job. A LiteLLM proxy typically holds the API keys for every model provider the company uses and the virtual keys issued to internal teams and agents. It also sees every prompt and response in plain text.</p><p>Trend Micro draws a useful distinction here. If you use LiteLLM as a library and pass credentials per request, the blast radius is smaller. If you run it as a central proxy, as most production deployments do, one compromised host exposes every model relationship at once.</p><p>Transitive dependencies widen the net. DSPy, MLflow, CrewAI, and OpenHands all pull in LiteLLM, and several of them opened pull requests the same day to pin away from the bad versions. Wiz reported finding LiteLLM in 36% of the cloud environments it analyzed. Plenty of teams that would have said “we don’t use LiteLLM” were running it anyway.</p><h3>Stolen AI keys get used</h3><p>Security teams usually learn about stolen cloud keys from an alert. With LLM keys, finance often finds out first.</p><p>Sysdig’s threat research team named the pattern LLMjacking in 2024. Attackers use stolen credentials to run models on someone else’s account, often reselling the access through a reverse proxy. In its first analysis, Sysdig estimated a single case could cost the victim more than $46,000 a day. Later research put the figure above $100,000 a day for the most expensive models, and found attackers switching on models the victim had never enabled. Some checked the account’s logging configuration before using the keys, which tells you they know where defenders look.</p><p>The bill is only part of it. To a model provider, traffic sent with your keys is your traffic. If the resold access is used for phishing kits or malware, the abuse report lands on your account, and the provider may suspend it while you work out what happened. Sysdig found that at least some LLMjacking users were based in Russia, where sanctions restrict access to Western AI services, which can turn a billing problem into a compliance one. And if you run systems classed as high-risk under the EU AI Act, Article 12 expects automatic event logging over the system’s lifetime. Logs kept on an attacker-controlled host won&#39;t carry much weight when you need to show which activity was yours.</p><h3>Seven controls that limit the damage</h3><p>None of these is tied to one product. They apply to LiteLLM, to other open-source gateways, and to anything you buy.</p><p><strong>1. Pin CI actions to commit SHAs, not tags. </strong>The Trivy compromise worked because tags are mutable. The attackers rewrote them, and every pipeline followed. A full commit SHA cannot be moved.</p><p><strong>2. Keep scanners away from publishing secrets. </strong>The scanner never needed the PyPI token to do its job. Run scanning and publishing in separate jobs, and give the publish job nothing else. PyPI’s trusted publishing replaces long-lived tokens with short-lived ones, which shrinks the window, although it will not help if malicious code runs inside the publishing job itself.</p><p><strong>3. Pin dependencies by hash, and wait before adopting new releases. </strong>pip install — require-hashes refuses anything that does not match your lockfile. A short delay before new versions reach production, which uv supports with — exclude-newer, lets the rest of the ecosystem trip over a bad release before you do.</p><p><strong>4. Restrict egress from gateway hosts. </strong>A gateway needs to reach a known list of provider endpoints. The stolen data went to a domain set up for the attack, and an outbound allowlist would have blocked it.</p><p><strong>5. Put a hard ceiling on every key. </strong>Set per-key and per-team spend caps in the gateway, and use provider-side limits and alerts where they exist. Prefer short-lived, narrowly scoped keys for apps and agents. A capped key turns an open-ended loss into a known one. Test that the caps hold under concurrent requests, not just that the dashboard displays them.</p><p><strong>6. Keep the audit log outside the gateway’s blast radius. </strong>Ship request logs to a separate account or an append-only store that the gateway host cannot modify. If the host is compromised, those logs are how you prove what was yours.</p><p><strong>7. Treat resource anomalies as security signals. </strong>This attack was caught because of a fork bomb. An unexplained CPU spike on a gateway host, or a sudden jump in token usage on one key, deserves the same attention as a burst of failed logins.</p><p>If you think one of the affected versions reached your systems, these checks are a starting point. Run them in every environment that might have it, including each virtualenv, container image, and CI runner, and run the systemd checks for each user account.</p><p><em># Is LiteLLM installed, which version, and what pulled it in?</em></p><p><em>pip show litellm # check “Version” and “Required-by”</em></p><p><em># The .pth file used by 1.82.8</em></p><p><em>find / -iname “litellm_init.pth” 2&gt;/dev/null</em></p><p><em># Persistence left on non-CI machines</em></p><p><em>systemctl —— user status sysmon.service</em></p><p><em>ls -la ~/.config/sysmon/</em></p><p>If anything shows up, removing the package isn&#39;t enough. Rotate every credential the process could have read, including cloud IAM, repository tokens, Kubernetes service accounts, SSH keys, registry logins, and LLM API keys. Then review provider usage for activity you do not recognize.</p><h3>The next one is already being built</h3><p>In May, the source code of Shai-Hulud, <a href="https://www.theregister.com/security/2026/05/13/malware-crew-teampcp-open-sources-its-shai-hulud-worm-on-github/5239319">an offensive framework attributed to TeamPCP</a>, appeared on GitHub under a permissive MIT license, with a README signed by the group. The tooling behind this kind of campaign is now available to anyone who wants it.</p><p>LiteLLM’s maintainers disclosed publicly and moved quickly, and open-source gateways remain a reasonable choice for many teams. The incident changes the question worth asking about any gateway. Code quality matters, but the more useful question is what a compromise would cost you and who would notice first. If the honest answer is “our finance team, next month,” the seven controls above are a good place to start.</p><p><strong>Disclosure:</strong> I run a company that builds AI gateway and governance software, so this is a problem I think about professionally, and yes, with some bias. I’ve kept this piece about the attack and the controls any team can apply, regardless of which gateway they run.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=637932ef0bda" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/litellm-breach-llm-gateway-security-637932ef0bda">What the LiteLLM Breach Teaches Us About Securing LLM Gateways</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The AI Agent Failure That Never Throws an Error]]></title>
            <link>https://pub.towardsai.net/the-ai-agent-failure-that-never-throws-an-error-e87ca9e639e5?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e87ca9e639e5</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 08:41:01 GMT</pubDate>
            <atom:updated>2026-08-24T03:24:16.174Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Loops, drift, and recursion don’t crash your system. They just spend. Here are the three patterns and the four numbers that catch them.</em></h4><figure><img alt="the AI-agent failure that never throws an error" src="https://cdn-images-1.medium.com/max/1024/1*_0u7Txyd7Lg-0WDqJMokKw.png" /></figure><p>An agent burns a month of its budget over a single weekend, and nothing on the dashboard looks wrong. I’ve seen this happen more than once, and it always has the same shape.</p><p>Every request returns a 200. Latency sits inside the SLO. CPU is flat. The on-call graphs are the calm, boring green you want them to be.</p><p>The only sign anything has happened is the bill. An agent that normally costs a few dollars a day has spent a few hundred over two nights — calling the same tool with almost the same arguments, over and over, thousands of times, getting a clean response every single time, and never once deciding it was done.</p><h3>Why your monitoring can’t see it</h3><p>That’s the strange thing about how agents fail. We spent fifteen years learning to monitor software that fails <em>loudly</em> — it throws, it times out, it returns a 500, and something pages you. Agents have invented a new category: the failure where everything works, and money disappears. The tell isn’t an error. It’s the absence of progress underneath a stack of perfectly successful calls.</p><blockquote>Agents have invented a new category: the failure where everything works and money disappears.</blockquote><p>Application monitoring answers three questions: is the service up, how fast does it respond, what fraction of requests fail. Uptime, latency, error rate. Those signals were designed for a world where one request produces one response, and cost depends on how many servers you rent.</p><p>An agent breaks every one of those assumptions. One goal goes in. An unknown number of steps come out. It carries state between calls, takes actions through tools, and decides for itself how hard to try before it stops. Its real behavior doesn’t exist in the code you deployed—it exists only at runtime, in the specific path it took this time.</p><p>So the object you need to watch changes. Traditional monitoring tracks the <em>request</em>. What you actually need to track is the <em>goal</em>: how many reasoning steps the agent took, how many tool calls it made, how many tokens the whole session consumed, and whether the same move keeps repeating without getting closer to done. A single goal can fan out into hundreds of model calls, and each can succeed while the session as a whole goes nowhere.</p><p>This stays invisible because each piece reports success on its own. A per-call rate limit caps one request; it has no idea that one goal just triggered nine hundred of them. A health check confirms the service is alive — and a perfectly alive service can loop forever.</p><p>And the money moves faster than in any system you’re used to. Anthropic <a href="https://www.anthropic.com/engineering/multi-agent-research-system">reported</a> that in its own production data, agents tend to burn through roughly 4× the tokens of a chat interaction, and multi-agent setups around 15×. Sit with that multiplier for a second. A glitch that would have cost you two dollars in a chatbot costs thirty in an agent — before anything on your dashboard so much as blinks.</p><h3><strong>Three patterns worth naming</strong></h3><p>Most writing on this topic stops at “you should monitor your agents,” which is about as useful as being told to watch your spending. The interesting question is <em>what specifically to watch for</em>. In practice, three patterns account for most runaway spend, and each leaves a distinct, catchable signature.</p><p><strong>Loops.</strong> The agent repeats the same action without making progress. In a trace, this is a run of sibling calls with the same tool name and near-identical arguments, each returning fine, with none adding anything new to what the agent knows. The nice part is that catching this is a comparison problem, not a machine-learning one — you hash the tool name plus its normalized arguments and count how many times it repeats in a row. Three in a row can be a retry. Ten in a row is a loop.</p><p>This isn’t a rare corner case. A team at UC Berkeley built <a href="https://arxiv.org/abs/2503.13657">MAST</a>, a taxonomy of how multi-agent systems fail, from more than 1,600 annotated execution traces across seven frameworks. Two of the fourteen failure modes they documented are<em> essentially that the agent repeats itself and doesn’t know when to stop</em>. This is one of the most common ways these systems break.</p><p><strong>Drift.</strong> The agent’s behavior slides away from the task it was given, without any single step being obviously wrong. Nobody makes a mistake; the goal just quietly mutates. What makes drift expensive is that it <em>produces work</em> — plausible, well-formed, completely billable work that nobody asked for. You catch it by comparison too: embed the original goal, embed each new output, and watch the semantic distance between them over the session. One far-off step is noise. A curve that climbs, step after step, is drift.</p><p><strong>Recursion.</strong> The agent spawns sub-agents, and those sub-agents spawn their own, with no ceiling on how deep it goes. Picture a planner that splits a goal into four sub-tasks, and each sub-agent decides its slice is still too big and splits it into four more. Every individual decision looks reasonable. But at a depth of five with a branching factor of four, one request quietly becomes more than a thousand leaf calls. Recursion has the ugliest cost curve of the three, because it multiplies instead of adds — and, happily, the simplest fix, because a hard cap on depth just ends it.</p><h3>The four numbers that catch it</h3><p>Naming a pattern is useless without a number attached. Four metrics do most of the work, and all four fall out of standard trace data you may already be collecting.</p><p><strong>Token burn rate per session</strong> — total tokens over the session’s duration or completed steps. When it runs above roughly 3× an agent’s own rolling baseline, something’s wrong. This is your cheapest, bluntest catch-all for drift and runaway fan-out.</p><p><strong>Recursion depth</strong> — the deepest the sub-agent call stack goes in a single run. For most production agents, a hard cap somewhere between 3 and 5 is plenty.</p><p><strong>Repeated-call ratio</strong> — identical calls divided by total calls in a session. Above 0.3, go look. Above 0.5, it’s almost certainly a loop.</p><p><strong>Cost per completed task versus cost per abandoned task.</strong> This is the one most teams skip, and the one your finance people actually care about. The first number tells you what the agent is worth. The second tells you what it costs you when it fails. Two agents with the exact same average session cost can have completely different economics if one abandons 5% of its runs and the other abandons 40% — and you can’t see that difference at all until you split the cost by outcome.</p><p>One caveat on all four: treat those thresholds as starting points, not gospel. The honest baseline is empirical and per-agent. Run the thing for a week, take the median of its own behavior, and set your ceilings relative to that — not to a number you read in a blog post, including this one.</p><h3>Watching is not the same as stopping</h3><p>Here’s the part that’s easy to get wrong, and that took us a while to accept.</p><p>There’s a good, mature ecosystem for the <em>watching</em> half of this. Tools like Langfuse, Arize’s Phoenix, and LangSmith give you tracing, session grouping, cost attribution, drift analysis, evaluation scoring — a genuinely rich picture of what your agent did and why. If you don’t have any observability on your agents yet, start there; that’s the first, non-optional step, and I’m not knocking any of it.</p><p>But observation ends at the alert. These tools mostly sit <em>beside</em> the execution path, consuming telemetry after the fact. They can tell you, brilliantly, that an agent spent four hundred dollars looping last night. What they structurally can’t do is refuse the four-hundred-and-first call, because by the time the trace reaches them, the call already happened.</p><p>And the timing math is brutal. An agent looping at 30 calls a minute, dragging 10,000 tokens of accumulated context along each time, moves something like 300,000 tokens a minute — on the order of a dollar a minute, per agent, for as long as it runs. An alert that reaches a human in fifteen minutes has already let the whole incident play out. Overnight, “fifteen minutes” becomes eight hours.</p><p>Stopping it — actually stopping it — means putting the limit <em>in</em> the path, not beside it. Every model call, tool call, and retrieval an agent makes has to leave the process to go somewhere. Route that outbound traffic through a single choke point, and you get the one place where a ceiling can be <em>enforced</em> rather than merely recorded: max cost per task, max tokens, max time, max recursion depth, with an automatic stop the instant one is crossed. Watching catches the pattern. Only enforcement ends it. Mature teams run both — alerts to investigate, hard ceilings to contain.</p><h3>Why this matters more than it should</h3><p>You could read all of the above as a niche ops problem. It isn’t. Gartner <a href="https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027">forecast</a> that more than 40% of agentic AI projects will be canceled by the end of 2027, and it named escalating costs and inadequate risk controls as reasons. Those aren’t model failures. Nobody’s canceling these projects because the LLM wasn’t smart enough. They’re governance failures — the gap between an agent that works in a demo and an agent you can safely let run unattended against a live budget.</p><p>Runaway agents live right in the center of that gap. They’re not a sign your model is bad. They’re a sign you’re flying an autonomous system with instruments built for a manual one. The fix isn’t a smarter model. It’s naming the failure modes — loops, drift, recursion — measuring the handful of numbers that expose them, and putting the stop where it can actually stop something.</p><p>Disclosure: I work on tooling for AI agent governance, so this is a problem I think about professionally — and, yes, with some bias. I’ve kept this piece about the problem, not any product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e87ca9e639e5" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/the-ai-agent-failure-that-never-throws-an-error-e87ca9e639e5">The AI Agent Failure That Never Throws an Error</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Company Is Already Running AI Agents It Can’t See]]></title>
            <link>https://medium.com/@NickHystax/ai-agent-governance-the-new-shadow-it-problem-9cc64df34145?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cc64df34145</guid>
            <category><![CDATA[enterprise-technology]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 09:11:59 GMT</pubDate>
            <atom:updated>2026-07-22T09:11:59.948Z</atom:updated>
            <content:encoded><![CDATA[<h4>The risk isn’t only what a model says. It’s what an agent can reach, spend, and do in production.</h4><p>When I talk with engineering and security leaders about AI agents, I usually open with a simple question.</p><p><strong>How many agents are running in or near your production environment right now? → </strong>The answer is almost never zero.</p><p>Then I ask the harder version. Who owns each one? What did it cost last week? Which models, databases, APIs, and external services did it touch?</p><p>That’s where the room goes quiet.</p><p>Most companies already have agents doing real work. Some were introduced deliberately by a platform team. Others began as experiments in product or data teams and quietly became part of a process nobody wants to turn off. A growing number arrived inside software the company bought rather than built — <a href="https://www.gartner.com/en/newsroom/press-releases/2025-08-26-gartner-predicts-40-percent-of-enterprise-apps-will-feature-task-specific-ai-agents-by-2026-up-from-less-than-5-percent-in-2025">Gartner expects 40%</a> of enterprise applications to embed task-specific AI agents by the end of 2026, up from under 5% a year earlier.</p><p>By the time leadership asks how these systems are governed, they are already calling tools, consuming budget, reading internal data, and making decisions at runtime. It reminds me of shadow IT, with one critical difference. Shadow IT stored and moved data. Agents act.</p><figure><img alt="Your Company Is Already Running AI Agents It Can’t See" src="https://cdn-images-1.medium.com/max/500/1*iQZmRXhj8k7gCUEwkoq_rQ.png" /></figure><h3>The new shadow IT makes decisions</h3><p>Ungoverned technology rarely enters a company because someone decided to ignore policy. It starts as a reasonable attempt to solve a problem quickly.</p><p>A product team wires an agent into a customer workflow ahead of a deadline. A data scientist builds a research assistant that becomes too useful to retire. A vendor adds agentic features to a product you already run.</p><p>None of it feels like a governance event at the time. The problem shows up later, when an experiment becomes an operational dependency, and nobody ever stopped to say: this thing now needs an owner, an access policy, a budget, and a review.</p><p>That moment is easy to miss, because an agent usually isn’t a single application you can point at. It’s spread across orchestration code, model calls, memory, retrieval, and tool integrations. A company can depend on an agent without having any reliable view of what it can reach.</p><blockquote><strong>Before you can govern an agent, you have to know it exists.</strong></blockquote><h3>A chatbot can be wrong. An agent acts on being wrong</h3><p>Most AI governance work of the past few years focused on prompts and outputs. Can sensitive data appear in a prompt? Could the model generate something harmful? Is PII detected? Those questions still matter, but they were built around a simple interaction: one request in, one response out.</p><p>An agent doesn’t work that way. It receives a goal and decides how to pursue it — retrieving documents, calling several models, querying a database, invoking a tool, checking the result, revising its plan, continuing. Along the way, it writes prompts the original user never saw, from information it gathered itself.</p><p>The number of actions isn’t known in advance. Neither is the cost, the duration, or the blast radius.</p><p>That’s the whole shift. A chatbot gives someone a wrong answer. An agent uses a wrong answer to update a record, send a request, expose a document, or burn budget for hours after the task should have ended.</p><p>Agent governance isn’t a more advanced version of chatbot governance. It’s a different problem.</p><h3><strong>Your existing controls only see part of the run</strong></h3><p>Companies aren’t starting from zero. Most have application monitoring, code review, identity management, cost dashboards, and model guardrails. All of it helps. The limitation is that each was built to answer a different question.</p><p>A content filter inspects a prompt or a response, but not what the agent does next. Application monitoring shows a service is healthy while the agent inside it is stuck in a loop. Code review examines the logic you shipped, but the agent picks which tool to call after the application is already running. A cost dashboard explains yesterday’s spending — it doesn’t stop the task generating tomorrow’s bill right now.</p><p>None of these controls sits at the wrong layer. The issue is that no single one of them sees the full, goal-driven execution: the original goal, the calls it triggered, the tools it reached, the data it moved, and the point where it should have stopped.</p><p>Without that context, every individual request looks legitimate even when the overall behavior clearly isn’t.</p><figure><img alt="Four failures that look completely normal" src="https://cdn-images-1.medium.com/max/600/1*5ImB34fOugfSI7dkSFV0jw.png" /></figure><h3>Four failures that look completely normal</h3><p>Agent risk is usually described in abstract terms. In practice, the same four patterns keep showing up.</p><h4><strong>Runaway cost</strong></h4><p>A large AI bill rarely comes from one expensive request. An agent splits a goal into subtasks, retries failed calls, consults several models, and refines the same answer repeatedly. Every call is cheap and valid on its own. The problem only becomes visible when thousands of them belong to a single task — and per-call limits let all of them through, because none is individually abnormal.</p><h4><strong>Non-termination</strong></h4><p>An agent doesn’t always crash when something goes wrong. Sometimes it just keeps working: revising the same plan, passing work back and forth with another agent, retrying a failing tool. Infrastructure looks healthy, requests are processing, logs are flowing. But activity isn’t progress.</p><h4><strong>Data egress</strong></h4><p>Sensitive information can leave the company even when the user never put it in the prompt. An agent retrieves internal documents, combines them with earlier tool outputs and stored context, then sends that payload to an external model. The risky part gets assembled halfway through the run, which is why inspecting the initial prompt tells you very little.</p><h4><strong>Unauthorized action</strong></h4><p>An application can pass code review and still do something nobody approved. The agent decides at runtime which API, database, tool, or MCP server to call — and the Model Context Protocol keeps expanding the set of capabilities it can discover. A tool assumed to be read-only turns out to have write access. Several permitted calls combine into an outcome no one authorized.</p><p>None of this requires a malicious agent. It emerges from broad permissions, weak stop conditions, and ordinary software failures meeting autonomous behavior.</p><h3><strong>Start with a list, not a platform</strong></h3><p>Whenever agent governance comes up, there’s a pull toward technology first. I think the first step is simpler. <strong>Make a list.</strong></p><p>Every agent gets a name, an owner, a purpose, and a description of where it runs. You should know which models it uses, which tools and data sources it can reach, whether it can write as well as read, and what limits apply. Include the agents embedded in software you purchased — the ones you built are only part of the picture.</p><p>This exercise will surface systems that security, platform, or finance teams didn’t know existed. That’s not a failure of the exercise. That’s the reason for doing it.</p><p>And once the inventory exists, vague concerns become answerable questions. Can this agent access customer data? Can it send internal information to an external model? Can it change a production record without approval? How much can it spend on one task?</p><figure><img alt="Put the limits outside the agent" src="https://cdn-images-1.medium.com/max/500/1*j6K0S2KjaltbWkSJo1Hdig.png" /></figure><h3>Put the limits outside the agent</h3><p>You can’t realistically rewrite every framework, vendor SDK, and piece of custom agent code to enforce the same rules. And you shouldn’t rely on each agent to police itself.</p><p>The more practical option is to place controls outside the agent, along the paths it uses to reach models, tools, APIs, and data stores. It’s the logic of a network gateway: rather than asking every application to invent its own enforcement, traffic passes through a shared point where access can be observed and restricted.</p><p>That layer isn’t a complete answer — it won’t see local computation, browser actions, or connections that bypass it. But most consequential agent actions eventually have to reach a model, a tool, an API, or a data source, which makes outbound traffic one of the few places you can enforce limits consistently across every framework in the building.</p><p>On that foundation, five controls are worth having early:</p><p>1. <strong>Identity and ownership.</strong> An unregistered agent can’t be governed — no team, no policy, no escalation path.</p><p>2. <strong>Hard runtime limits.</strong> Ceilings on cost, execution time, token use, and recursion depth. Start conservative.</p><p>3. <strong>Explicit access scope.</strong> Models, tools, MCP servers, and data stores permitted deliberately, not by default. Read and write are not the same privilege.</p><p>4. <strong>Task-level monitoring.</strong> Watch the run, not just the request. A burst of tool calls says more than any single event.</p><p>5. <strong>A reliable audit trail.</strong> Reconstruct what the agent did, what it accessed, what it sent, and why it stopped.</p><h3><strong>Governance is not the opposite of autonomy</strong></h3><p>Governance still gets treated as something you add after innovation, usually once the risk team gets uncomfortable. That won’t work with agents.</p><p>Teams will keep experimenting. Vendors will keep shipping agentic features. Frameworks will keep getting easier, and connections into business systems will keep standardizing. And the gap is already open: <a href="https://www.avepoint.com/blog/manage/state-of-ai-2026-report">in AvePoint’s 2026 survey</a> of 750 IT leaders, roughly nine in ten reported at least one agent-related security incident in the past year, with data leakage the most common. So the real question isn’t whether to allow agents. It’s whether you can see enough of what they do to move forward with confidence.</p><p>Good governance shouldn’t make every agent action wait for a committee, or reduce an autonomous system to a chain of manual approvals. It should define the space in which autonomy is allowed: what an agent can access, how far it can go, how much it can spend, when it has to stop, and what evidence remains afterward. That’s what turns an interesting experiment into infrastructure a company can actually depend on.</p><p>The agents are already running. The only question is whether anyone can explain, with confidence, what they’re doing.</p><p><em>This is the problem we built </em><a href="http://optscale.ai/?utm_source=blog&amp;utm_medium=medium&amp;utm_campaign=ai_agent_governance"><em>OptScale AI</em></a><em> to solve — an operational layer that routes, secures, observes, and governs AI usage and agent activity across the models, tools, and frameworks a company already runs.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cc64df34145" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why AI Governance Became the Missing Layer in Enterprise AI Adoption]]></title>
            <link>https://medium.com/@NickHystax/why-ai-governance-became-the-missing-layer-in-enterprise-ai-adoption-7fc07cfd19dd?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fc07cfd19dd</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Thu, 28 May 2026 19:16:00 GMT</pubDate>
            <atom:updated>2026-05-28T19:16:00.728Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Most companies are not struggling to adopt AI anymore — they are struggling to control it. From invisible AI spending to ungoverned AI agents and data leakage risks, the real challenge is no longer access to AI, but operational oversight.</em></h4><figure><img alt="OptScale AI — AI Governance platform" src="https://cdn-images-1.medium.com/max/900/1*kBFjZDhcQBH-_oxyHRBmoA.jpeg" /></figure><p>What surprised me most over the past year wasn’t how quickly companies adopted AI. It was how quickly AI adoption escaped governance.</p><p>A few years ago, cloud adoption followed a relatively predictable pattern. IT teams evaluated vendors, procurement reviewed contracts, security teams approved architecture, and eventually organizations standardized around a stack. AI is unfolding very differently.</p><p>Today, every employee can independently connect to powerful models in seconds. Engineering teams deploy AI agents into production without centralized oversight. Departments choose their own LLMs, build internal workflows around them, and integrate AI into daily operations long before leadership has visibility into what is actually happening.</p><p>At first, this looks like innovation. But underneath it, a completely new operational problem is emerging.</p><h3><strong>AI adoption escaped IT faster than anyone expected</strong></h3><p>Most organizations no longer know:</p><ul><li>which AI models are being used,</li><li>what data employees are sending into prompts,</li><li>how much departments are spending,</li><li>which AI agents are operating autonomously,</li><li>or what actions those agents are taking inside internal systems.</li></ul><p>And this is not theoretical anymore. We increasingly see companies where dozens — sometimes hundreds — of AI workflows already exist informally across teams. Employees use ChatGPT, Claude, Gemini, Copilot, local models, and internal assistants simultaneously. Engineering groups experiment with LangChain, CrewAI, AutoGen, MCP-connected agents, and vector databases. Meanwhile, security, compliance, and finance teams are trying to catch up after the fact.</p><p>The problem is not AI itself. The problem is that organizations accidentally created distributed AI infrastructure without creating operational governance for it.</p><h3><strong>AI agents are becoming operational infrastructure</strong></h3><p>AI agents amplify this challenge dramatically. Unlike traditional SaaS tools, AI agents are not static systems. They make decisions, invoke tools, chain prompts, access data sources, and sometimes recursively call themselves or other systems. Once connected to internal infrastructure, they become operational actors — capable of generating costs, exposing sensitive information, or triggering unintended actions at machine speed.</p><p>Many organizations still treat agents like experimental automation. In reality, they are quickly becoming part of the production infrastructure. That changes everything.</p><p>The conversations we have with customers increasingly revolve around the same concerns:</p><ul><li>“How do we know what our agents are actually doing?”</li><li>“How do we prevent sensitive data from reaching external models?”</li><li>“Why are our AI costs becoming impossible to predict?”</li><li>“How do we stop one broken agent from generating massive token spend overnight?”</li><li>“How do we standardize AI usage across departments without slowing innovation?”</li></ul><p>Interestingly, these are not model-quality questions, but governance questions.</p><h3><strong>Artificial Intelligence is starting to repeat the early cloud story</strong></h3><p>What’s happening with AI inside companies today reminds me a lot of the early years of cloud adoption.</p><p>At first, cloud spread across organizations faster than governance could keep up. Teams moved quickly, adopted tools independently, and only later did companies realize how difficult it had become to manage costs, visibility, and security consistently.</p><p>AI feels very similar — except the pace is much faster, especially now that autonomous agents are starting to interact with real business systems.</p><figure><img alt="OptScale AI — the unified platform for efficient, secure AI adoption" src="https://cdn-images-1.medium.com/max/600/1*jr-DQbnvpf_EM2-YzryKZA.png" /></figure><h3><strong>Why we built OptScale AI differently</strong></h3><p>That realization is what led us to build <a href="http://optscale.ai/?utm_source=blog&amp;utm_medium=medium&amp;utm_campaign=OptScale_AI_release_1.0">OptScale AI</a>.</p><p>We did not want to create another AI wrapper, another standalone assistant, or another isolated framework that organizations would eventually have to manage separately.</p><p>What we kept hearing from companies was surprisingly consistent: they already had models, AI tools, and internal agents. The real problem was the lack of visibility and control across all of them.</p><p>In many organizations, AI adoption is outpacing governance. Different teams use different models, connect different tools, and build their own AI workflows independently. Over time, this creates operational fragmentation that becomes difficult to secure, monitor, or optimize.</p><p>We approached <a href="http://optscale.ai/?utm_source=blog&amp;utm_medium=medium&amp;utm_campaign=OptScale_AI_release_1.0">OptScale AI</a> as an operational layer rather than another AI destination. The idea was simple: give organizations a centralized way to route, secure, observe, and govern AI usage without forcing them to rebuild everything around a new ecosystem.</p><p>That is why the platform combines AI gateway capabilities, security guardrails, analytics, tracing, and AI agent governance in a single control plane.</p><p>The goal was never to slow AI adoption down. It was to make large-scale AI adoption manageable.</p><h3><strong>The uncomfortable reality of autonomous AI agents</strong></h3><p>I also think the industry is still underestimating the operational risks around AI agents.</p><p>Most conversations today focus on what agents can do. Much less attention is given to what happens once those agents begin interacting with real infrastructure, internal systems, customer data, or financial operations. At that point, they stop being experiments and start behaving more like autonomous operational software. And that changes the conversation entirely.</p><p>Companies eventually begin asking very practical questions:<br>Who approved this action? Why did the agent access this system? What data was involved? Why did costs suddenly spike overnight?</p><p>These are not futuristic concerns anymore. They are operational questions that organizations are already facing as AI agents move from demos into production environments.</p><p>The companies that solve governance early will likely scale AI much more confidently than those trying to retrofit controls later.</p><h3><strong>AI governance is what makes AI scalable</strong></h3><p>One thing I increasingly disagree with is the idea that governance somehow slows AI adoption down. In practice, I think the opposite happens. Without structure and visibility, AI usage inside companies eventually becomes chaotic. Costs become unpredictable, security teams lose visibility, and leadership starts worrying more about risk than innovation.</p><p>That is usually the moment when organizations begin slowing themselves down.</p><p>Good governance should not block experimentation. It should create enough control and transparency for companies to feel comfortable scaling AI further across the business. To me, that is the real shift happening now.</p><p>AI is moving from isolated experiments into core operational infrastructure. And once that happens, governance stops being optional — it becomes part of making AI sustainable at scale.</p><p>🎁 <strong>Early Bird OFFER </strong>— Get 30% off any annual plan. Valid until June 30, 2026. <em>Early Bird discount is not combinable with the annual billing discount.</em></p><p>Learn more ➡️ <a href="http://optscale.ai/?utm_source=blog&amp;utm_medium=medium&amp;utm_campaign=OptScale_AI_release_1.0">optscale.ai</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fc07cfd19dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why the future of AI may belong to Smaller Models]]></title>
            <link>https://medium.com/@NickHystax/why-the-future-of-ai-may-belong-to-smaller-models-1542a7f2d082?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1542a7f2d082</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 21:33:06 GMT</pubDate>
            <atom:updated>2026-08-22T11:52:02.564Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical perspective on where large language models and smaller AI systems actually fit</h4><figure><img alt="Why the future of AI may belong to Smaller Models" src="https://cdn-images-1.medium.com/max/500/1*ZD-mLMVVf4jIi-6yV63FCg.png" /></figure><p>Over the past two years, the AI conversation has centered on a single idea: bigger models are better.</p><p>Each new release — GPT-5, Claude Opus, DeepSeek, Gemini — pushes the frontier of what language models can do. They write code, analyze documents, generate software prototypes, and increasingly act like autonomous agents.</p><p>But behind the excitement, many engineering teams are quietly discovering something unexpected:</p><p><strong>The most practical AI systems often rely on much smaller models.</strong></p><p>In 2026, the real discussion inside many companies is no longer just about which giant model is the smartest.<br>It’s about <strong>where large models make sense — and where smaller models are actually better.</strong></p><h3>The hidden cost of very large models</h3><p>Large language models are extraordinary general tools. They can reason across domains, summarize complex material, and help people build things that once required entire teams.</p><p>But they come with real operational trade-offs.</p><p>Large models typically mean:</p><ul><li>higher latency</li><li>higher infrastructure costs</li><li>stricter data-handling constraints</li><li>dependence on external APIs</li><li>less control over deployment environments</li></ul><p>For many organizations, those constraints become visible only when AI moves from experimentation to production.</p><p>What works beautifully in a demo can become expensive or difficult to operate at scale.</p><h3>Why smaller models are quietly gaining importance</h3><p>Smaller language models — often called SLMs — are designed with a different goal in mind.</p><p>Instead of maximizing universal intelligence, they optimize for <strong>specific tasks and controlled environments</strong>.</p><p>This approach offers several advantages:</p><p><strong>Lower cost</strong><br>Smaller models require significantly less compute to run and scale.</p><p><strong>Lower latency</strong><br>They respond faster, which matters in real-time systems.</p><p><strong>Deployment flexibility</strong><br>Many can run locally or inside private infrastructure.</p><p><strong>Greater predictability</strong><br>Narrower models often behave more consistently for well-defined workflows.</p><p>For companies building AI systems that must run continuously — inside products, internal tools, or operational pipelines — these advantages are often decisive.</p><h3>The emerging pattern: hybrid AI systems</h3><p>What many teams are discovering is that the future of AI systems is not a single model.</p><p>Instead, it looks more like a <strong>layered architecture</strong>.</p><p>Large models handle:</p><ul><li>reasoning</li><li>complex generation</li><li>exploratory tasks</li><li>human-facing interactions</li></ul><p>Smaller models handle:</p><ul><li>structured tasks</li><li>classification</li><li>automation workflows</li><li>high-volume operations</li></ul><p>In other words, large models provide intelligence, while smaller models provide <strong>operational efficiency</strong>.</p><p>Together, they create systems that are both powerful and sustainable.</p><h3>AI infrastructure is becoming the real challenge</h3><p>As organizations adopt AI more deeply, the focus is shifting.</p><p>Two years ago, the biggest question was:</p><blockquote>“Which model should we use?”</blockquote><p>Today, the more difficult question is:</p><blockquote>“How do we design systems that combine models effectively?”</blockquote><p>This includes:</p><ul><li>routing tasks between models</li><li>managing latency and cost</li><li>controlling data flows</li><li>orchestrating AI agents</li><li>maintaining reliability at scale</li></ul><p>These challenges look less like machine learning research and more like <strong>infrastructure engineering</strong>.</p><p>And that shift is likely to define the next stage of AI development.</p><h3>The AI industry is moving past the “bigger is always better” phase</h3><p>Large models will continue to advance. They will remain essential for creativity, reasoning, and complex problem-solving.</p><p>But the systems that actually power products, automation pipelines, and enterprise workflows will increasingly rely on a <strong>combination of models of different sizes</strong>.</p><p>The future of AI is not a single super-intelligent system.</p><p>It is an ecosystem.</p><p>And the organizations that succeed will be the ones that learn how to orchestrate that ecosystem effectively.</p><h3>The real AI race isn’t about size</h3><blockquote>“AI progress is impressive, but the real breakthroughs will come from how we combine intelligence with systems that can actually run reliably.”</blockquote><p>The AI race is often described as a competition to build the largest and smartest models.</p><p>In reality, the more interesting question may be how those models are used.</p><p>In many practical systems, intelligence alone is not enough.<br>Efficiency, reliability, and architecture matter just as much.</p><p>That is why the next phase of AI development may belong not only to the biggest models, but also to the <strong>smarter ways of combining them</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1542a7f2d082" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Most AI Models Fail Before Training Even Begins]]></title>
            <link>https://medium.com/@NickHystax/why-most-ai-models-fail-before-training-even-begins-b3149308b8e0?source=rss-9e0d4f6ecae0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3149308b8e0</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nick Hystax]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 17:05:48 GMT</pubDate>
            <atom:updated>2026-02-13T17:05:48.832Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical perspective on why most AI failures begin before model training</h4><p>Over the past few years, I’ve noticed a pattern that rarely shows up in AI success stories.</p><p>When an AI project fails, the algorithm is usually the first suspect. Teams question the architecture, model choice, hyperparameters, and training duration. Yet in many real-world cases, none of these is the actual root cause.</p><p>The failure often happens <strong>long before the model ever sees its first dataset</strong>.</p><p>In 2026, as AI experiments accelerate across industries, the uncomfortable truth is that<strong> most AI setbacks are not model failures—they are data and pipeline failures.</strong></p><figure><img alt="Why Most AI Models Fail Before Training Even Begins" src="https://cdn-images-1.medium.com/max/500/1*mWwF_4SuZ3pBpm9JhoiqAQ.png" /></figure><h3>The illusion of “good enough data”</h3><p>Many organizations still treat data preparation as a preliminary step rather than a continuous process. The assumption is that once the dataset is assembled and cleaned, the real work begins.</p><p>In practice, data rarely stays stable.</p><ul><li>Sources change</li><li>Schemas evolve</li><li>Labels drift</li><li>Edge cases accumulate</li><li>Business logic shifts silently</li></ul><p>By the time a model underperforms, the issue is no longer visible in a spreadsheet — it’s embedded in the pipeline itself.</p><p>What looks like a <strong>model-accuracy problem is often a data-integrity problem that started months earlier</strong>.</p><h3>Experiments succeed. Production fails.</h3><p>Another recurring pattern is the gap between experimentation and production.</p><p>In controlled environments:</p><ul><li>datasets are curated</li><li>metrics are clear</li><li>compute resources are predictable</li><li>workflows are simplified</li></ul><p>But once a model moves into production, new variables appear:</p><ul><li>inconsistent data feeds</li><li>latency in pipelines</li><li>incomplete records</li><li>version mismatches</li><li>environment differences</li></ul><p>The model didn’t “fail.”<br>The <strong>system surrounding it changed</strong>.</p><p>This is why teams frequently celebrate strong prototype results only to encounter instability weeks later.</p><h3>The pipeline is the real product</h3><p>In many organizations, the focus remains on the model as the centerpiece of AI. Yet the model is often the smallest and most replaceable component.</p><p>The real complexity lies in:</p><ul><li>data ingestion</li><li>validation logic</li><li>feature engineering workflows</li><li>monitoring</li><li>feedback loops</li><li>version control of datasets and experiments</li></ul><p>In other words, <strong>AI reliability depends less on model sophistication and more on pipeline discipline</strong>.</p><p>This is also why improvements in accuracy rarely solve systemic issues.<br>You can tune a model endlessly, but if the data flow is inconsistent, results will drift regardless.</p><h3>Data drift is not a rare event anymore</h3><p>In earlier phases of AI adoption, drift was considered an edge case.<br>In 2026, drift is the norm.</p><p>Markets change faster.<br>User behavior shifts more quickly.<br>Regulations evolve.<br>External signals fluctuate.</p><p>A model trained on last quarter’s data may already be outdated before deployment completes. Without continuous monitoring and dataset versioning, performance decay is inevitable.</p><p>The problem is not that models become obsolete — it’s that <strong>teams often lack mechanisms to notice in time</strong>.</p><h3>Why infrastructure thinking matters more than ever</h3><p>AI discussions often revolve around accuracy percentages and benchmark scores.<br>But reliability, scalability, and governance now play a much larger role.</p><p>Teams that approach AI with infrastructure discipline tend to perform better over time. They treat:</p><ul><li>datasets like code</li><li>pipelines like production systems</li><li>experiments like auditable processes</li><li>models like evolving services, not finished artifacts</li></ul><p>This mindset reduces the likelihood of sudden failure by recognizing that AI systems are <strong>living systems</strong>, not static deliverables.</p><h3>What strong teams do differently</h3><p>From what I’ve observed, teams that avoid major AI setbacks share a few consistent habits:</p><ul><li>They version datasets and pipelines, not just models</li><li>They monitor data quality continuously</li><li>They design feedback loops early</li><li>They treat experimentation and production as connected environments</li><li>They assume drift will happen and plan for it</li></ul><p>None of these practices is glamorous.<br>They don’t make headlines.<br>But they are often the difference between stable systems and repeated restarts.</p><h3>Final thoughts</h3><p>AI doesn’t usually fail because of mathematics.<br>It fails because of <strong>assumptions about data, pipelines, and stability</strong>.</p><p>In 2026, the most successful AI initiatives aren’t those with the most advanced algorithms — they are the ones that recognize AI as an operational discipline, not just a technical challenge.</p><p>The model is only as strong as the ecosystem that feeds and monitors it.<br>And that ecosystem is where most real failures — and real improvements — actually begin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3149308b8e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>