Stolen AI API keys have become a cheap way to get expensive compute, and the bill lands on whoever owns the key. Cloud hosting provider Railway just learned that lesson over a 26-hour fight with attackers who were after AI provider credentials. Those keys were headed for resale to so-called AI "transfer stations," where they'd power model distillation runs. The crooks racked up about $740,000 in fraudulent AI usage charges before Railway shut them out.
The scale is what makes this worth a closer look. Railway says the attackers potentially had access to as many as 100,000 workspace credentials. That's a platform-level exposure, not a handful of unlucky accounts.
How the intrusion unfolded
The attack started on October 20, when hackers exploited a previously unknown vulnerability in Railway's build infrastructure. They got around filesystem isolation protections and grabbed an internal credential that unlocked stored build histories. From there, they pulled a copy of Railway's internal source code and combed through it for other weak points.
They found one. An improperly configured trust relationship gave them broader access across Railway's infrastructure, including credentials that could decrypt customer environment variables. Railway's database searches went after AI provider keys first, and some queries also targeted cloud, database, and payment service credentials. That ordering tells you what the attackers valued.
Railway's engineers worked around the clock in shifts. The company described the situation as a "contest of agent speed," with the intruder chaining exploits, moving laterally across systems, and probing many routes in parallel. Defenders hardened routes in parallel too. "This was not a single breach followed by a single fix," the company wrote, and that line is the most useful sentence in the whole disclosure. Teams that treat an incident as one hole to patch will miss the next one.
Railway says the attackers were "fully evicted" on October 21. Before that, they obtained and decrypted a "subset" of customer variables, roughly 100,000 by the company's count, or "at most" 1.85% of workspaces. The breach also exposed linked-account tokens belonging to more than 1,850 users, including GitHub and OAuth tokens that Railway says it reset. The company worked with GitHub, GitLab, Anthropic, OpenAI, OpenRouter, Stripe, and others to revoke potentially compromised keys.
Customers reported that their keys had answered coding questions and handled training-data tasks they never launched. Railway is working to reimburse them, including for charges that AI providers decline to refund. The company disclosed the incident on October 22 and published a follow-up report this week. It still isn't sharing the full scope of the exploitation while the investigation continues, which means the numbers above are floors, not ceilings.
Why attackers want AI keys
AI credentials are cheap to harvest at scale. Security analyst David Shipley of Beauceron Security put it bluntly: "AI credentials are becoming the new credit card numbers." He expects so-called LLMjacking to displace cryptojacking as a cheap, scalable way to make money. The economics are simple. An attacker who compromises one platform can collect keys from thousands of customers at once, instead of breaking into them one by one.
The resale market runs through AI routers, which give buyers access to models they couldn't otherwise afford or reach. Stolen access is a hot commodity for distillation, the process of transferring a larger model's knowledge into a smaller, cheaper one. If you want the mechanics, this InfoWorld piece on subliminal learning covers how models pick up behavior from one another.
Distillation takes volume. Training one model on another's answers can require millions of questions, and that pattern is easy to spot. Frank Dickson of Dickson Research pointed out that a single account firing off millions of queries stands out immediately. Stolen keys solve that problem by spreading the traffic across thousands of real customers, so each account looks ordinary.
Dickson's analogy is the one I'd keep in mind: "Think of copying a textbook one page at a time, using library cards that belong to other people." Frontier AI is expensive to buy. The key's owner gets the bill, and the thief gets cost-free compute. "It is the 2026 version of cryptomining; [the] same playbook with a different output," he said. Cryptomining was about stealing electricity and cycles. This is about stealing expensive inference.
Managing identities when machines hold the keys
Dickson credited Railway with a "remarkably candid report." The company owns its configuration mistake, admits it can't be certain it found every account the attacker created, and commits to telling customers about problems faster in the future. That's the right posture, even if the underlying facts are ugly.
Railway is also moving to short-lived credentials and logging every decryption event. Dickson's view is that this is the correct fix, and any platform holding customer secrets should copy it. Short-lived credentials shrink the window in which a stolen key is useful. Logging decryptions turns a silent theft into a visible one.
The rotation clock matters, though. Research from Wiz found that stolen keys were tested within 30 minutes of theft, then flooded with traffic four to seven days later. If you're waiting a week to rotate, you're giving the thief time to plan. Dickson's advice to Railway customers is blunt: treat every secret stored on the platform as stolen until it's rotated.
His sequence is practical. Start with AI provider keys, then rotate cloud, database, and payment credentials. Check AI provider bills and usage logs for traffic your internal teams didn't generate, and report unauthorized charges to Railway. Set alerts for calls from addresses you don't recognize. Railway's own response included rebuilding the tooling used to run its infrastructure and adding a way to mass revoke app permissions when something looks wrong, which is worth copying if you run your own internal platform.
The bigger lesson is about limiting blast radius. Set hard spending caps and usage alerts on every AI key, and scope each one as narrowly as the provider allows. Wiz examined one case where a key restricted to a narrow set of model profiles left most of the thief's traffic throttled. Narrow scope didn't prevent the theft, but it made the stolen key much less valuable.
For teams that don't use Railway, Dickson suggests two questions for every platform provider: How are my secrets stored, and who can decrypt them? He also argues for issuing fewer keys in the first place. "No one ever said during a key rotation that they wished they had issued more keys," he noted.
Here's where I land. A stolen AI key spends real money within hours, and machine identities now outnumber human ones in most production environments. Teams still treat API keys like config values, not like the access tokens they are. "Protect machine identities like cash, because to a thief, that is exactly what they are," Dickson said. I'd expect that framing to show up in procurement checklists and cloud contracts within a year, because the first company to get burned by an AI key leak will be the last to forget it.