
In this article 11 sections
An AI API key is now worth real money to an attacker. Keys that unlock large language models can be used within hours, and the bill lands on the account owner. The November 2026 disclosure from cloud hosting platform Railway shows how quickly a breach can turn into a six-figure charge. This guide explains what happened, how the attack works and what developers should do right now.
What Railway disclosed
Railway, an application hosting platform, published an incident report on November 10, 2026. The company said attackers had used stolen customer AI credentials to generate about $740,000 in unauthorized usage. According to BleepingComputer, Railway worked with affected providers to reimburse customers, and it said it would cover charges that providers declined to refund.
The report also covered tokens beyond AI keys. The breach exposed linked-account tokens for 1,852 users, including GitHub OAuth tokens and AI agent keys. Railway said it reset those tokens and notified the affected users.
These are the figures from the company’s own disclosure and the reporting that followed. The full picture may change as the investigation continues, so check the latest Railway update before you quote a number.
How the attack unfolded
According to Let’s Data Science, attackers who breached Railway’s infrastructure starting on October 20 stole decrypted customer environment variables. Environment variables are where many applications store API keys, database passwords and other secrets.
The scope was limited but serious. Railway estimated that up to about 100,000 workspaces could have had their decrypted environment variables accessed. That is at most 1.85 percent of the platform’s total workspaces. Not every workspace was necessarily compromised, but every affected team should assume its secrets may have been read.
Railway’s own timeline also shows a delay that matters for customers. It told affected customers on October 26 that it could not refund charges generated through compromised keys. Its later disclosure changed that position, saying it would cover breach-related charges where AI providers declined reimbursement.
What LLMjacking is
The attack pattern has a name. LLMjacking is the theft of access to large language models, usually through stolen cloud credentials or API keys. The stolen access is then resold or redistributed, and the victim pays for the usage. The iTnews report on the Railway case describes this same model.
Railway believes the attackers targeted AI keys for distribution through services that relay or resell access to commercial models. Those intermediaries make it hard to trace who is using a key and who ends up paying for it. A key stolen on Monday can be generating charges by Tuesday, long before the victim notices.
The volume can be large. Security firm Wiz said it traced two stolen enterprise keys linked to one such breach. Attackers used them for roughly 800,000 and 1.7 million calls to Amazon Bedrock, which Wiz estimated would cost more than $100,000 at list prices. That is a reminder that stolen keys scale fast when they are automated. For a wider view of how attackers are using AI, read our guide on AI-powered cyberattacks and how to protect your business.
Why AI keys are so attractive
Most stolen credentials need work before they become money. A stolen password may need to be tested on other sites. A stolen cloud account may need to be sold to a buyer. An AI key can be used directly. The attacker sends requests, and the model provider returns answers. The provider bills whoever owns the key.
That speed is what makes AI keys so valuable. The same reporting notes that such keys can be converted into cash within hours. Attackers also use them for coding agents and training pipelines, which means a single key can power many kinds of misuse.
For developers, the risk is that AI keys often look like ordinary configuration values. They sit alongside database URLs and deployment settings, and they are copied into many places during development. Each copy is another place where a breach can happen.
Who pays for stolen keys
The answer depends on the provider. Railway said it would cover charges that providers declined to refund, but other platforms may not be as generous. Reporting on the case noted that the AI model gateway OpenRouter declined refunds in this incident.
That makes the first hours after discovery important. Affected customers should document the spike in usage, contact each provider’s support team quickly and keep records of every request. A clear record makes a refund claim much easier to win.
Do not assume the platform that leaked the key will pay for everything. Read the terms of each AI provider you use, and set LLM API spending limits and alerts so you learn about unusual activity before the bill arrives.
Incident response: what to do first
If your keys were stored on an affected platform, treat them as compromised. The priority order matters, because the fastest damage comes from AI usage.
- Rotate every AI provider key that was stored on the platform. Revoke the old key first, then create a new one.
- Check the billing dashboard and usage logs for each provider. Look for requests at times nobody on your team was working, or for usage from tools that nobody runs.
- Rotate cloud, database and payment credentials. Stolen environment variables can contain more than AI keys.
- Rotate linked-account tokens, such as GitHub OAuth tokens and agent keys, and review the permissions they grant.
- Report unauthorized charges to the platform and the provider, and keep copies of every message and invoice.
Work through the list in one session if you can. Attackers reuse stolen secrets quickly, so a partial rotation can leave a live door open.
Prevention: how to keep AI keys safe
Rotation is the emergency response. Prevention is what stops the next incident from becoming expensive. Several practices reduce the risk considerably.
First, keep AI keys out of client-side code. A key placed in a front-end bundle can be read by anyone who loads the page. One developer forum post described a Gemini key leaking through a built client bundle and leading to about $2,200 in unauthorized charges. Keys belong on the server, behind an API route that you control.
Second, use a secrets manager rather than plain environment variables where your stack supports it. A secrets manager can limit who can read a key, log every access and make rotation easier.
Third, create separate keys for each project and environment. If a development key leaks, production stays protected. Narrow scopes help too: a key that only needs one model should not be able to call every model.
Fourth, set spending limits and alerts on every AI account. A hard cap stops a runaway bill, and an alert tells you within minutes when usage spikes.
Fifth, review access regularly. Remove old keys, unused integrations and agent tokens that no one remembers creating. A quarterly review catches many forgotten secrets.
Why AI agents raise the stakes
Many teams now run AI agents that hold their own keys and call tools automatically. Each agent is effectively a service account with its own access. If an agent’s key is stolen, the attacker inherits everything the agent can do.
Treat agent credentials with the same care as staff accounts. Give each agent the smallest set of permissions it needs, track what each one does and revoke access as soon as a project ends. The same discipline applies to coding assistants that can read repositories or deploy code. If you are planning to use agents in your business, our post on AI agents that use your computer explains the access they need.
How to spot unusual AI usage early
Most teams find out about stolen keys from an invoice. A better approach is to watch usage daily. Check spend by API key, not only by account, so a single compromised key stands out. Compare today’s usage with the same key’s average over the previous two weeks, and set an alert for any jump above a threshold that suits your business.
Look for patterns that do not match your own activity. Requests at night or on weekends, models your team never uses and sudden jumps in token counts are common warning signs. Many providers let you filter usage by model and date, so spend a few minutes each week learning what normal looks like for your product.
Treat any unexplained spike as an incident until proven otherwise. Revoke the key first and investigate second. A revoked key can interrupt your service for a short time, but a live stolen key can run up a large bill within hours.
Choosing a secrets setup for a small team
Small teams often keep keys in a local .env file, paste them into a hosting dashboard and then lose track of where they went. A simple baseline helps. Keep secrets out of source code and out of client-side bundles. Use one secrets store for each environment, and give each developer access only to the environments they need.
Add automated secret scanning before code reaches the main branch. Pre-commit hooks and repository scanners can catch a key before it is pushed to a shared repository. If a key ever enters git history, rotate it. Deleting the commit does not make the key safe, because copies may already exist.
Write the setup down on one page: where each key lives, who can read it, how it is rotated and whom to call when a provider reports unusual charges. A written record turns a stressful rotation into a routine task.
What this means for businesses in Pakistan
Pakistani software houses and startups increasingly build products on hosted platforms and AI APIs, often with small teams and tight budgets. That combination makes a single leaked key especially painful. A few hundred dollars of unauthorized usage can be a serious cost for a small company. Many of these teams are also adopting business automation in Pakistan, which means more keys and more places where they can leak.
The practical step is to add AI key hygiene to onboarding and handover. New developers should learn where keys live and how they are rotated. Departing developers should have their access revoked on the same day. Finance teams should know that AI usage can spike without warning, so they should review AI invoices alongside cloud bills.
If you need help building a secure web platform or mobile app, explore our web design and development services and mobile app development services, or contact our team to talk about your project.
FAQs


