Someone spent your AI credits while you were asleep
Keys stolen in October's AI platform breaches ran up an estimated $740,000 from one host alone. Where AI keys leak, and how to cap the damage.

On 10 November Railway, a platform that builds and hosts apps for developers, put a number on its October breach. The attacker who got in on 20 October went looking specifically for customers' AI provider keys, decrypted stored variables in up to about 100,000 workspaces, and the keys taken were used for an estimated $740,000 of AI usage. Railway believes they were passed on to resellers for use in distillation, and says it will cover the token losses that AI providers decline to refund (Railway, 10 November 2026).
Railway wasn't alone. Wiz, a cloud security vendor, counted at least nine AI developer platforms that disclosed incidents in October, among them Fireworks AI, OpenCode, Lightning AI and Warp. Every public report described attackers hunting for stored environment variables, especially ones that unlock AI services (Wiz, 30 October 2026). None of these attacks was aimed at a model. They went after the keys sitting next to one, and for many developers the first sign of trouble was the bill.
What happened at OpenCode
OpenCode, one of the nine, is an open-source coding agent that a lot of developers run as an alternative to Claude Code or Cursor. The app itself runs on your machine. OpenCode Console is the company's hosted platform, and some users stored their provider keys there.
On 17 October OpenCode said attackers had broken into an older system overnight, in what it called a large-scale distillation attack affecting 1.4% of Console users (TechCrunch). Distillation means training a cheaper model on a stronger model's answers, so the idea is that someone used other people's keys to pay for millions of queries. Users posted charges from several hundred dollars to more than $1,700, and some said Google Cloud suspended their projects for activity consistent with hijacked resources (BleepingComputer). OpenCode's email put the earliest possible exposure at 00:30 UTC on 17 October (BleepingComputer).
Co-founder Dax Raad drew a line between the hosted Console and the app, saying keys used with OpenCode itself "never come to us" (TechCrunch). Anthropic and Google blocked the keys they believed were exposed, OpenAI said it would refund API credits used in the attack, OpenCode said refunds for unauthorised charges were under way, and it told affected users to revoke and replace their keys with each provider. It hasn't said how the attackers got in or how the keys were stored, and some sceptics doubt the distillation story, arguing it was an ordinary breach (TechCrunch).
Eleven days earlier, at Fireworks
Fireworks AI runs and fine-tunes open models for other companies. On 6 October it spotted someone using internal Fireworks credentials. The intruder had accessed environment variables in customers' evaluation jobs, and Fireworks believes API keys and tokens stored there as secrets were captured in a limited number of accounts. It found no sign that models, datasets or training data were touched within its own systems, and says its review of other possible access is still going (Fireworks AI).
Its advice to customers has the one sentence we'd put on every developer's wall: "Removing a stored secret alone does not invalidate the underlying credential" (Fireworks AI). Fireworks also told people to rotate the affected keys even if they found nothing suspicious in their logs. We think that's right. If you can't say where a key has been, assume someone else has a copy.
Why a key to an AI model is worth stealing
A leaked AWS key used to mean someone might mine crypto on your account or poke around your buckets. Keys to AI models are more direct. In our view that's what changed the economics. They turn into money straight away: inference is expensive, the bill lands on somebody else's card, and there's a steady market of people who'd like frontier models for a fraction of the list price.
The pattern has a name. In May 2024 Sysdig's threat research team, which works for a cloud security vendor, called it LLMjacking: attackers broke into a server through an old Laravel bug, took the AWS credentials on it, and checked which hosted models those credentials could call. Their tooling included a reverse proxy which, the researchers said, could let them sell the access on, so buyers could use the model without ever seeing the key. Sysdig estimated an attack like that could cost the victim more than $46,000 a day in model usage (The Hacker News). Two years on, the estimate has real bills behind it. Google Threat Intelligence Group reported in November that in incidents it looked at in 2026, fraudulent charges passed $100,000 in a single day, and reached $1 million at some organisations before access was revoked. One attacker made more than 500,000 calls in under eight hours with stolen keys to feed a resale service called Jet Night, passing nearly $1 million in costs to the victim. In several cases the AI service hadn't even been switched on; the attackers used stolen cloud keys to turn it on themselves (Google, 2 November 2026).
And there are more keys lying around to take. GitGuardian's 2026 report counted about 29 million secrets leaked on public GitHub in 2025, up 34% on the year before, and leaks of AI-service credentials up 81% to 1,275,105. It also found that 64% of valid secrets it detected in 2022 still hadn't been revoked in 2026 (GitGuardian). GitGuardian sells the tools that find these, so it has a commercial interest in the problem. The 64% is the figure we'd worry about most anyway. A key that's been public for four years and still works is a leak that happened years ago and was never cleaned up, and anyone who scraped GitHub in 2022 still has it.
Four places your keys leak in an AI workflow
You paste them
The oldest one. You're debugging, you paste the stack trace or the config file into a chat, and the database password goes with it. We covered where chats end up in What you paste into an AI chat doesn't stay in the chat, so we won't repeat it here. Short version: assume the chat is stored and possibly read, and that a key you pasted is no longer only yours.
The agent reads them
A coding agent works in your project folder, and your project folder has a .env in it.
In January 2026 The Register tested whether Claude Code would stay out of .env files listed in .claudeignore. It didn't. Claude Code v2.1.12 read the file and printed the secrets to the console, and it ignored the .env entry in .gitignore too. When asked how to keep it out, Claude itself suggested .claudeignore, which was the thing that hadn't worked. What did work in the test was a deny rule in the project's .claude/settings.json permissions, though the paper found that fiddly to get right (The Register). Anthropic didn't respond to its questions. That was one version, in January. Claude Code has changed a lot since. The lesson holds for every agent, though: don't assume an ignore file is a security boundary until you've watched the agent respect it.
Once a secret is in the agent's context it can end up in a log, a commit message, a tool call, or, if someone has planted instructions in a web page or issue the agent reads, in a request to somebody else's server.
The AI commits them
GitGuardian reports that commits made with Claude Code's help leaked secrets at about 3.2%, roughly twice the rate across public GitHub (GitGuardian). We haven't seen the method behind that comparison, and it's one vendor measuring another vendor's product, so treat it as a signal and not a verdict. The mechanism is easy to believe, though. An agent that writes a working config file in thirty seconds will happily hard-code the key you just showed it, and a person reviewing forty changed files is less likely to spot one line than a person who typed every line themselves.
The same report found 24,008 unique secrets in MCP configuration files (GitGuardian), the files that tell an agent which tools it can use and how to log in to them. Developers tend to treat those as settings. Plenty of them hold live tokens.
The middleman stores them
This is the OpenCode and Fireworks story. Every AI tool that offers to keep your provider key for you (a hosted console, an evaluation platform, a model router, a browser extension) becomes another place that key lives, protected by someone else's security on someone else's schedule. Convenience is the whole point of these tools. It also means a breach at any one of them is a breach of your account with OpenAI or Anthropic, and you'll hear about it from your bank alerts before you hear about it from them.
What we'd do
Most of this is old advice. We won't pretend otherwise. What's new is how quickly a missed step turns into an invoice.
We'd start by giving every tool its own key, per project, and never putting the main provider key into someone else's console. If a platform you use gets breached, you want to revoke one key and carry on, not rotate everything you own on a Saturday morning. Then we'd cap the damage before it happens: a spending limit and a usage alert with each model provider, at the project or key level where the provider allows it. We'd set the first alert low, at something like £50. Nobody enjoys the email, and it'll arrive at 2am, but it's a lot cheaper than the overnight bills OpenCode users described.
When a tool tells you it's been breached, we'd go to the provider that issued the key and revoke it there, because deleting it from the tool does nothing to a copy that's already gone. For coding agents, we'd keep real secrets out of reach. Load them at runtime from a secret manager, so the agent sees a reference and not the value, and add a deny rule for .env and similar files in the agent's own permission settings. Then test it by asking the agent to read the file.
We'd run a secret scanner in a pre-commit hook and in CI, and treat AI-written changes as the ones most worth scanning. MCP and agent config files get the same treatment as any other secret: tokens out, environment variables in, never committed with real values. Where a provider allows it, we'd use short-lived, narrow tokens, because a key that only works for one model, one project and one week is a much smaller prize than a root key that never expires. And we'd practise the rotation. Pick a quiet Tuesday and rotate one production key end to end. If it takes more than an hour, or breaks something, you've found the problem while it's cheap.
If you run the team
Somebody needs to know which AI keys exist, who created them, which tools hold them and who gets the invoice. In most small companies the honest answer is nobody, because keys were created by whichever developer tried the tool first. Start with that list. Then make sure provider billing alerts go to a shared inbox and not to one person's personal email, because the alert is often the first and only warning you'll get.
Where we'd stop short
These breaches are recent, and most of the platforms haven't published a full account yet. Railway's report is the most detailed so far, so details may still change. None of the advice above depends on how they end. We'd do every step even if each number in this piece turned out half as bad.
If you kept a provider key on any of the platforms in Wiz's list, revoke it at the provider. Do it even if you weren't told you were affected and your bill looks normal.


