In the early hours of 21 October 2026, someone took from Railway, a hosting platform used by thousands of software teams, the keys that customers had stored to connect their applications to artificial intelligence services. In the report published on 10 November, Railway itself estimates that the unauthorised usage made with those keys reaches about 740,000 dollars.

Most of those affected did nothing wrong. The keys were where they should have been: in the hosting provider's environment variables, encrypted. The problem is that an AI key works like a credit card without a PIN: whoever holds it can spend in your company's name until someone cancels it.

If your company has a chatbot on its website, an automation that replies to clients or a program that uses ChatGPT, Claude or Gemini behind the scenes, it has at least one of these keys. This article explains what happened, where a small business's keys usually sit, and which controls separate a scare from a bill of thousands of euros.

What happened at Railway, in facts

According to the company's report, on 20 October the attacker exploited an unknown vulnerability in the application build infrastructure and chained internal credentials until decrypting customers' environment variables, between 04:42 and 07:15 (UTC) on 21 October. The attacker was evicted at 09:24 that day.

Three details matter to anyone running a business:

Railway notified GitHub, GitLab, Anthropic, OpenAI, OpenRouter, Google and Stripe to revoke the compromised keys. Even so, the advice to customers in the preliminary report of 22 October was clear: revoke and replace every sensitive variable stored on the platform before 21 October. As The Hacker News noted, asking for a refund does not revoke the key.

The useful conclusion: an AI key can be stolen without your company making any mistake, so protection also has to cover what the key can do once it has left the building.

Why an AI key is different from a password

A stolen password usually gives access to data. A stolen AI API key gives access to paid usage, and that usage starts the next minute.

Three reasons make this attractive to attackers:

  1. It turns into money without going through you. The attacker uses the key to make requests to the models, or passes it to someone who does. Railway believes the credentials were forwarded to distributed setups used to extract model answers in bulk.
  2. The cost scales. The same key that spends little per month in a clinic's chatbot, used non-stop from hundreds of machines, can spend in a day what the clinic would spend in a year.
  3. Many companies only look at the bill at month end. Without a limit that stops requests, the first sign may be the charge on the card.

The risk grew precisely because AI became cheaper and easier to connect to everything (we covered that in AI just got 50% cheaper). More connections, more keys scattered around.

Where your company's AI keys are

In most small businesses, nobody has a list. The keys were created by whoever set up each project, at different times. The most common places:

The first step is not technical. It is making the list: which keys exist, in which account they were created, which card pays for them and where they are stored.

Five controls that limit the damage

None of these controls prevents a provider from being attacked. All of them reduce what a stolen key can spend and for how long it keeps working.

1. A spending limit that stops requests, not just an alert

This is the control with the most impact and the most misunderstood. Many dashboards have "budgets" that only send an email. The difference between warning and blocking is written in each provider's documentation:

Provider What the official documentation says
OpenAI The hard limit makes requests fail with error 429 once spending reaches it; it can be set at organisation or project level. Spend alerts impose no cap. Enforcement is not instant (OpenAI)
Google (Gemini API) An alert-only budget does not limit spending. A budget with a spend cap pauses the Gemini API until the end of the month, per project and per service, with some delay (budgets, spend caps)
Anthropic (Claude) Allows monthly spend limits and alerts per workspace, but not in the default workspace; organisation limits always apply (Anthropic)

In practice: create a project or workspace for each use and give it a cap close to normal usage, with some margin. If the chatbot spends 30 euros a month, a 100-euro cap does not hurt it and cuts the damage of a leak. Because accounting lags, the cap should sit below the amount the company is willing to lose.

2. One key per use, never one key for everything

If the website, the invoicing automation and the internal assistant all use the same key, a leak forces you to change everything at once and gives no clue where it came from. OpenAI organises keys and limits by project. Anthropic allows keys scoped to a single workspace and recommends service account keys for new integrations, instead of personal keys that stop working when the person leaves.

3. Keys out of the browser and out of the code

The key should live in a secrets vault or in the server's environment variables, and the browser should talk to your server, never directly to the AI provider. It is one of the rules we follow on websites with AI features. GitHub has secret scanning that recognises many types of keys, including Anthropic's (GitHub); it is worth switching on in the company's repositories.

4. Expiry and rotation

At Anthropic, a key's lifetime is chosen when it is created (from 3 hours to 30 days, a custom period or no expiry) and cannot be changed afterwards. A test key should expire in days; a production key should have an agreed rotation date. If you have never rotated a key, you do not know how long it takes, and you find out on the worst day.

5. Knowing where requests come from

Some providers let you restrict the addresses a key can be used from (Anthropic has this option in beta). If the integration always runs from the same server, a stolen key becomes almost useless outside it.

If a key has already been exposed: what to do in the first hour

Order matters. The most common mistake is to investigate first and leave the key working.

  1. Revoke the key at the AI provider. It is the only step that stops the spending. At Anthropic, disabling is reversible and deleting is permanent; if in doubt, disable first.
  2. Create a new key and replace it everywhere on the list. This is where one key per use pays off.
  3. Check the last few days' usage in the provider's dashboard and save screenshots, with dates and amounts.
  4. Review what sat next to the key. In the Railway case, the same search picked up database and payment credentials. If the AI key leaked, assume the neighbouring variables did too.
  5. Ask for a refund, knowing that policies vary. According to Railway's report, AWS and Google started refunds under their fraud policies, OpenAI reviews case by case through support requests, Anthropic was still in discussions and OpenRouter refused to refund.

If the key has access to clients' personal data (for example, an assistant connected to the CRM), also speak to whoever handles data protection in the company, because the GDPR may require notification. We are not lawyers: that point belongs to whoever advises the company in that area.

Questions to ask whoever set up your AI

If the chatbot, the automation or the software was built by an agency, a freelancer or an employee, these questions fit in one email:

If any answer is "I don't know", you already know where to start. The same goes for third-party plugins and apps in the online shop, as we explained in Online store security.

What changes for a small business

The Railway case is not a reason to stop using AI or to flee hosting platforms. It is a reminder that every AI integration has a variable cost tied to a credential, and that this cost should have a ceiling set by the company, not by the attacker. A well-built integration has four things: its own key, a limit that blocks, a safe place to store it and someone who knows how to replace it. None of this costs more than an afternoon of configuration.

How Digito helps

Digito is not a cybersecurity company. Our work is building and connecting software, automations and AI assistants, and setting those connections up with limits, separate keys and a replacement plan is part of that work. If your company already uses AI and cannot say where the keys are or whether there is a limit that stops the spending, we can do that inventory with you and leave each connection with its own key, a usage cap and a replacement plan.

Get in touch at digitosolutions.com.

Sources