November 22, 2026

Stolen AI Keys Cost One Platform $740,000

Stolen AI Keys Cost One Platform $740,000

Your API keys are a billing liability, not just a security problem

In October 2026, Railway, a platform-as-a-service company, suffered a breach that exposed customer API keys stored as environment variables. The attacker used those keys to rack up an estimated $740,000 in unauthorized AI provider charges. Railway has promised to cover costs that AI providers won’t refund, but the situation is messy and some refunds are still being negotiated as of the company’s November 2026 incident report.

If you’re a small or mid-size business using any cloud platform to build or run software, this matters to you. API keys for OpenAI, AWS Bedrock, Google Gemini, or Anthropic are sitting in environment variables on platforms you probably don’t think about much. If those platforms get compromised, your AI bill can explode overnight and getting a refund is not guaranteed.

How the attack actually worked

The attacker didn’t phish anyone or guess a password. They exploited a previously unknown flaw in Railway’s build system on October 20, 2026, partially escaping the filesystem isolation around a build to read files on the host virtual machine. That gave them a credential used by build servers.

From there, it escalated. A misconfigured OIDC binding let the attacker obtain short-lived cloud credentials. Those credentials unlocked an SSH key. The SSH key opened an orchestration machine that held a credential capable of decrypting customer environment variables. Between 04:07 and 05:21 UTC on October 21, the attacker pulled encrypted variables from Railway’s production database, specifically hunting for names matching AI provider keys. They decrypted a portion of them and were fully removed from Railway’s systems by 09:24 UTC that same day.

The attacker hit at most 1.85% of workspaces, roughly 100,000. They also accessed linked-account tokens for 1,852 users, including GitHub OAuth tokens. Railway reset all of them.

What this looks like for a small business

Most small businesses aren’t building on Railway specifically. But the pattern here is universal. Your team stores an OpenAI key in a .env file, a CI/CD platform, a deployment tool, or a shared notes app. Someone gets access to that platform. Your key gets used. You get billed.

The refund situation from this breach illustrates the risk clearly. AWS Bedrock and Google Gemini had existing fraud policies and started refunds. OpenAI reviews cases individually. Anthropic was still negotiating. OpenRouter had a no-refund policy entirely, so Railway had to cover those costs itself. You can’t count on an AI provider making you whole.

What to do right now

  • Audit where every AI API key lives. That means .env files, CI/CD platforms, deployment configs, shared drives, and any SaaS tool your developers use.
  • Rotate keys on a schedule. A key that’s been sitting in a platform for six months has had six months of exposure window.
  • Set spending limits and alerts on every AI provider account. OpenAI, AWS, and Google all support this. An alert doesn’t stop an attack, but it stops a large bill from growing into a catastrophic one.
  • Use short-lived credentials where the platform supports it. The Railway breach escalated partly because long-lived credentials were accepted in places they shouldn’t have been.
  • Check GitHub audit logs and which third-party OAuth apps have access to your organization’s repositories.

The broader credential hygiene problem connects to identity and access management across your whole environment. The same principles that apply to securing Microsoft Entra ID in an SMB environment apply here: least privilege, short-lived tokens, and regular audits of what has access to what.

If you’re not sure where your team’s API keys actually live, that’s the first thing to find out. It’s not a developer problem, it’s a business risk. Exine works with NJ and NYC businesses on exactly this kind of credential and access audit as part of managed IT and cybersecurity for businesses.

FAQ

How do I know if my API keys have been compromised?

Check your AI provider billing dashboards for unexpected usage spikes. Review access logs if your provider offers them. Set up spend alerts so unusual activity triggers a notification immediately. If a key was stored on a third-party platform that reports a breach, treat it as compromised and rotate it right away.

Will OpenAI or Anthropic refund me if my key is stolen?

It depends. OpenAI reviews refund requests case by case. Anthropic was still in negotiations as of Railway’s November 2026 incident report. AWS Bedrock and Google Gemini have existing fraud policies. OpenRouter maintained a no-refund policy entirely. Don’t assume you’ll be made whole automatically.

Is storing API keys in environment variables safe?

Environment variables are a standard practice, but they’re only as safe as the platform storing them. If that platform is breached and variables are encrypted with a recoverable key, attackers can get to them. Use secrets management tools, rotate keys regularly, and limit key permissions to only what each service actually needs.

How do attackers find and use stolen AI keys so fast?

In the Railway breach, the attacker’s database queries specifically searched for variable names matching AI provider keys. Once found and decrypted, keys can be fed into services that resell AI access. The whole cycle from initial access to unauthorized charges can happen within hours, as the October 21, 2026 timeline shows.

Tomasz Sobolewski, founder of Exine LLC
About the author
Tomasz Sobolewski
Founder of Exine LLC. Hands-on IT, cybersecurity and backup for growing New Jersey businesses, with 15+ years in the field. The kind of support that knows your systems and picks up the phone.