When Railway disclosed a breach in October, the first sign that my key had been abused was a billing email. I hadn't touched that key in months.
Bereket Takiso
November 6, 2026
5 min read
Late on October 21, Google AI Studio sent me an email. One of my Gemini API projects had hit its monthly spend cap and been paused.
That made no sense. I hadn't used Gemini on that project in months.
There was another email, less than four hours older. Railway was writing about a security incident. I had a project hosted there, and an old Gemini key was still sitting in its environment variables.
An unused key, it turns out, is still a live key. I had stopped thinking about this one. Someone else may not have.
What Railway found
Railway's preliminary report laid out the outline. On October 21, an attacker queried encrypted environment variables and decrypted a subset of them. Railway estimates that at most 1.85% of workspaces, about 100,000, had variables potentially exposed. The attacker appeared to be looking for AI provider keys.
Railway can't say exactly which variables were decrypted, so I can't prove mine was one of them. But the key on Railway belonged to the capped project, and that project had shown no usage in the previous 28 days.
The charge I could confirm was $95.25 net. It stopped there because of a $100 cap. No security tool warned me. A billing limit did. And even that isn't a guarantee, since Google notes that overages are possible during roughly 10 minutes of latency. A cap limits the damage, but it can't promise an exact stopping point.
Shutting it down
I lowered spending limits, deleted the exposed AI keys, and disabled billing on the affected project. Then I called each provider's API with the old keys to confirm they were dead.
Railway said it had asked providers to revoke keys. More than a day later, two of my exposed keys from other providers still worked. If I had waited for someone else to clean this up, they would still have been live.
Next I went through the logs and audit trails I could access, and found no other signs of abuse. That is weaker than it sounds, because some log retention was short and not every provider gave me usage data.
I worked through most of this with an AI coding agent, which handled a lot of the log checks and API verification. Approvals and password prompts stayed with me.
Then the rotation fought back
Over about four days, I worked through database, auth, email, and third-party credentials. Changing them was the easy part.
When I reset a database password, an old deployment kept retrying the old one. Those failures tripped the connection pooler's circuit breaker, which then blocked the new deployment too and caused an outage. Rotating a secret, I learned, is a deployment. Now I check what is still using a credential before I change it.
Then my builds started failing with 429 errors. It took a while to find the cause, because I had only been looking in environment variables. The old token was written as plain text into the expression of a firewall rule.
On another service, I disabled a legacy key and assumed that was the end of it. The token still worked until I revoked the old signing key behind it. A rotation isn't finished until the old value gets rejected.
Getting the money back
Railway says it can't refund spend made with compromised keys and points affected users to the AI providers. Google's billing assistant declined too, so I got the case to a human. Three days later, Google credited the full $95.25.
What I'd do on a quiet afternoon
Before the next breach, delete the keys you don't use, set a cap with every provider that offers one, and write down everywhere each secret lives. All three are much easier before anything has gone wrong.
As of this writing, Railway's final forensic report hasn't been published, so some of the details may still change.