For small firms
Your host holds
your AI keys too
A hosting platform holds the environment variables your apps run on, including AI provider keys. Railway's report on its October incident shows what happens when those keys are the target, and what to do about the ones you have stored anywhere.
Earlier this week we wrote about keys that leak into a public GitHub repository. That is one way an AI key gets stolen. There is another, quieter one: the same key, sitting in an environment variable on the platform that runs your app.
On 10 November 2026, Railway published a full incident report on an attack that began on 20 October. An attacker broke into Railway's own systems, moved through them, and was able to obtain and decrypt a subset of customer environment variables. Railway says at most 1.85% of workspaces, about 100,000, could have had any of their environment variables decrypted, and that the figure is an upper bound: the logs identify a subset of environments, not individual variables. The attacker was removed from Railway's systems on 21 October.
Railway's investigation found the attacker was specifically hunting for AI provider credentials. Database logs showed queries that selected variables whose names matched AI provider key patterns. Railway estimates unauthorised spend on the stolen keys reached about $740,000. It is working with providers on refunds, and says it will cover costs where a provider will not.
You do not need to be a Railway customer for the lesson to land. If a host stores your environment variables, it holds your keys too.
Why AI keys are worth stealing
A database password is valuable if you can reach the database. An AI provider key is valuable on its own. It is a direct line to a paid service. Steal it, and you can run usage on someone else's bill, from anywhere the provider will accept the key.
That is why these keys are a target. Railway believes the stolen credentials were passed on to "distributed transfer stations" for use in distillation, a way of training or copying model behaviour. The unauthorised usage it has observed ranges from coding agents to AI training pipelines. It also assesses this as one of a series of attacks on platforms that hold AI keys, and notes that OpenCode, Warp, Fireworks AI and several others disclosed similar thefts between 6 and 23 October.
The practical point for a small firm is simpler than the motive. A stolen AI key spends money until someone rotates it or a cap stops it.
Rotate the keys your host is holding
If you store AI provider keys (or any other secrets) as environment variables on a hosting platform or in a deploy pipeline, treat a host incident as a reason to rotate them. That includes keys that were never in source code and never appeared in a public repository.
Do it even if you have not had an email. Replace the keys that lived on the host, then check the provider's usage logs for anything you did not run. The same habit applies to any host that injects secrets into your app when it starts.
Put a cap on what a stolen key can spend
Rotation stops a stolen key. A spend cap limits the bill if you do not notice in time.
The main providers do not usually cap a single key. They cap a project or a workspace, which is why the next habit (one key per app, in its own project or workspace) matters. The controls that exist today, as described in the providers' own documentation, are these:
- OpenAI lets you set a monthly spend limit at the organisation level and at the project level, plus spend alerts that notify you when a threshold is reached. Alerts do not stop traffic on their own. To stop requests once tracked spend hits the limit, you have to turn on "Enforce a hard limit". OpenAI notes that enforcement is not instantaneous, so recorded spend can slightly exceed the amount you set.
- Anthropic lets you set your own organisation spend limit on the Billing page in the Claude Console, below the cap for your usage tier. You can also cap monthly spending for a workspace, and configure alerts when spending reaches certain thresholds, from the Workspaces page. Anthropic says you cannot set a spend limit on the Default Workspace, so keys that should be capped need to live in a workspace you create.
If your provider offers a hard cap and an alert, set both. The alert is how you find out. The cap is what stops the meter.
One key per app, not one key for everything
A single shared key, reused across every app and every environment, turns one leak into a problem for all of them. It also makes a spend cap almost useless: the cap has to be high enough for everything, so it will not catch a stolen key running one of those apps hard.
Give each app, and each environment, its own key, in its own OpenAI project or Anthropic workspace (or the equivalent your provider offers). Then the cap on that project or workspace is the cap for that app. If the staging key leaks, production is not automatically spent as well.
None of that makes you "secure". It means a stolen key has a smaller reach, and a smaller bill, which is the useful part.
A free check for keys that leaked another way
The Railway incident was about keys stored on a host, not keys sitting in a public repository. Those are different doors, and both are worth closing.
If you want a quick look at whether AI provider keys are sitting in a public GitHub repository, we have a free browser check: Are there AI keys in your public repo? Paste a public GitHub repository link. The page reads the files on the default branch and points out anything that looks like an AI provider key, shown redacted. It is a report only: it never uses or tests a key, and it changes nothing. There is no sign-in, and we keep no record of what you checked.
It is pattern matching, not a proof. A match means a string looks like a key, not that it is a live one, and a clean report does not prove there is nothing there. It looks for OpenAI (sk-, sk-proj-), Anthropic (sk-ant-), Google (AIza), AWS access key IDs and Azure OpenAI-style key variables. It does not check old commits, and it does not inspect the environment variables on a host. It will not replace a proper secret scan. It is a fast way to catch the other common leak: a key that was committed to a public repo.
Where to start
- List the hosts and deploy pipelines that hold your AI provider keys as environment variables, and rotate those keys if you are not sure they are still only in your hands.
- In your provider console, set a monthly spend limit and an alert on each project or workspace. For OpenAI, turn on "Enforce a hard limit" if you want requests to stop. For Anthropic, put keys that need a cap in a workspace other than the Default Workspace.
- Split any shared key so that each app and each environment has its own.
- Run the AI-key check against any public repos your firm (or your contractors) still have open, then rotate anything it finds.
The rest of our free checks live on the tools page. Answer honestly. The finding that makes you rotate a key, or put a cap on one, is the useful one.
Free check, the check in this post
Are there AI keys in your public repo? Paste a link, get a report.
Free. Runs in your browser. We keep no record of what you checked.