The hidden cost of a security breach on your AI infrastructure (2026)
A breach on an LLM app costs more than the tokens a thief burns. Stolen keys, exposed prompts, downtime and cleanup add up. The full bill, and the price of prevention.
Key takeaways
- IBM's 2026 report puts the global average data breach at USD 4.99 million. About one in five organizations reported an AI-related breach, and 92% of those lacked proper AI access controls.
- A stolen LLM key spends until you revoke it. Sysdig estimated over $46,000 a day in LLM consumption for one LLMjacking attack.
- The token bill is one line. Exposed prompts and logs, downtime of the AI feature, key rotation, and customer trust are the others.
- Provider spend limits are free and cap your worst month. Set one on every account, below your tier cap.
- A one-time outside test of your live app costs €49. At Sysdig's rate, a thief spends that in about two minutes.
When an LLM app is breached, the first number you see is the provider invoice. It is only the first line of the bill. A stolen key spends your budget, the same incident exposes the prompts and data that passed through your stack, and the cleanup pulls your team off the roadmap.
IBM's 2026 Cost of a Data Breach Report puts the global average breach at a record USD 4.99 million, up 12% in a year. Roughly one in five organizations in the study reported an AI-related breach, and 92% of those lacked proper AI access controls. This guide breaks the bill into its parts, then compares it with the price of prevention.
Cost 1: a stolen key spends without asking
An LLM API key is a spending credential. Whoever holds it can call the provider directly, from any machine, on your account. There is no login page to get past and no user to impersonate.
Sysdig's threat research team documented the pattern in 2024 and named it LLMjacking: attackers used stolen cloud credentials to run hosted models at the victim's expense. Sysdig's estimate was "over $46,000 of LLM consumption costs per day for the victim" if the attack went unnoticed.
Your real ceiling is the limit on your provider account. Anthropic's monthly spend caps run from $500 on the Start tier to $200,000 on the Scale tier. OpenAI lets you set a monthly spend limit per organization or per project and enforce it as a hard limit, with a caveat in its own documentation: "Enforcement is not instantaneous, so recorded spend can slightly exceed the configured amount." If you never set a limit of your own, your tier's cap is the size of your worst month.
Keys leak in volume. GitGuardian's State of Secrets Sprawl 2026 counted 28.65 million new hardcoded secrets in public GitHub commits in 2025. Leaked AI service secrets reached 1,275,105, up 81% in a year. Leaked keys also stay live: more than 64% of the secrets found valid in 2022 still worked in January 2026.
Cost 2: an open endpoint spends the key for anyone
The key can stay on the server and still get spent. An API route that calls a model without checking who is asking works as a free proxy to your account. OWASP lists this as Unbounded Consumption (LLM10:2025). One of its scenarios is Denial of Wallet, where an attacker sends a high volume of requests and exploits the pay-per-use pricing of AI services.
Agents multiply the damage. One task can chain many model calls and tool calls, so one abusive request costs far more than one chat completion. Tool-calling endpoints have their own list of risks, covered in AI agent security: protecting tool-calling endpoints from abuse.
Cost 3: the data that leaves with the tokens
An LLM stack concentrates sensitive data. Prompts carry customer messages, documents, and personal data. Logs and observability tools store prompts and completions. Retrieval stores hold internal documents. A breach of any of them is a data breach in the legal sense, with its own costs:
- Notification. If you process personal data of people in the EU, GDPR Article 33 requires you to report a personal data breach to the supervisory authority within 72 hours of becoming aware of it, unless it is unlikely to put people's rights at risk.
- Fines. Infringements of the security and notification obligations fall under Article 83(4): up to €10 million or 2% of worldwide annual turnover, whichever is higher.
- AI-specific losses. In IBM's 2026 study, prompt injection attacks on an organization's AI models or applications led to average losses of USD 5.89 million.
- The control gap. Only 40% of organizations in the same study reported using access controls on AI models and data.
IBM's averages come from a study of 602 breached organizations. A solo maker's numbers will be smaller. The line items are the same.
Cost 4: downtime, cleanup, and trust
- The AI feature goes dark. When a spend limit trips or you revoke the key, the feature stops for every user, paying customers included. OpenAI returns
429once a hard limit is reached. Anthropic pauses API usage until the first day of the next month once the tier cap is reached, unless you request a higher limit. - Rotation is work. Every leaked key has to be revoked, reissued, and redeployed in every service that used it. Deleting it from the code leaves it in caches, old bundles, and Git history.
- Investigation needs logs. You have to establish which key, which route, since when, and what data went through. Without per-request logs you are guessing.
- The abuse runs under your name. Whatever a thief generates with your key is generated on your account.
- Customers ask questions. A breach notice goes to the same people you asked to trust your AI feature with their data.
What prevention costs
Put the bill above next to the price of the controls that prevent it. The first two are free.
| Control | What it prevents | Cost |
|---|---|---|
| Spend limit at the provider | An open-ended bill from a stolen key | Free |
| Keys in server-side secrets, one key per app | Keys in the browser bundle, and one leak draining every app | Free |
| Session check and per-user quota on every AI route | Denial of Wallet through your own endpoint | Development time |
| Outside test of the live app | Exposed keys, open AI routes, open MCP servers | Free check, then €49 for a one-time report |
| Spend monitoring with alerts and budget caps | Abuse that runs for days before the invoice arrives | See Tokenwise pricing |
For the outside test, Keybrum is an automated pentest for web apps. It runs 338 attacks against your live app the way a stranger would, and every finding comes with the request that worked and a fix prompt for your coding agent. On an LLM app, it scans your JavaScript for provider keys and checks whether a found key still works, calls your AI routes signed out to see whether a model answers, and looks for an MCP server that runs its tools for anyone. It only attacks apps whose owner has proved ownership. At Sysdig's estimate of $46,000 a day, a thief spends the price of that report in about two minutes.
Start with the free check: paste your app's address, and in about ten seconds it shows the backend your app talks to, the keys its JavaScript exposes, and the tables it names. Then keep watching spend. Tokenwise sends cost spike alerts by email and, on Pro, enforces daily and monthly budget caps at the proxy.
The first hour after you suspect a breach
- Replace and revoke the key at the provider. Deploy a new key kept only on your server, revoke the old one, and confirm it fails. Clean up the code afterwards. Keybrum's guide on what to do when an API key leaks gives the order and the per-provider steps.
- Put a spend limit on the new key's project. If the same door is still open, the next bill is capped.
- Read usage for the exposure window. Find when the abnormal traffic started, which models it used, and what it cost.
- List the data that passed through. Prompts, completions, retrieved documents. This decides whether you have a notification duty.
- Close the door and test again from outside. Confirm that the request that worked now fails.
Try this week
- Set a monthly spend limit on every provider account, below your tier cap, with an alert under it.
- Give each app its own key or project, so one leak cannot drain the others.
- Call each AI route with no session. A model answer means anyone can spend your key.
- Search your built files for provider keys, then read how to detect leaked LLM API keys and how to secure them in production.
- Run an automated pentest on your live app before the next launch, and fix what it proves.
- Work out what a bad day would cost with the token cost calculator and current LLM prices, then set your alert below that number.
Frequently asked questions
- How much does a security breach on an LLM app cost?
- It depends on what was exposed. IBM's 2026 report puts the global average data breach at USD 4.99 million. For a small team the bill is smaller and has the same parts: tokens spent by the attacker, downtime of the AI feature, key rotation, investigation, and any notification duty.
- What happens if my OpenAI or Anthropic API key is stolen?
- The thief can call the provider directly on your account until you revoke the key. Spending is capped only by the limit you set or by your account tier. Sysdig estimated over $46,000 a day in LLM consumption for one such attack if it went unnoticed.
- Do provider spend limits stop a breach?
- They cap the bill, and they are worth setting on every account. They do not protect your data, and when a limit trips your AI feature stops for every user. OpenAI also notes that enforcement is not instantaneous, so spend can slightly exceed the limit.
- Is a leaked LLM API key a data breach?
- A leaked key is a security incident. It becomes a personal data breach when personal data was accessed or disclosed, for example through logged prompts, retrieval stores, or files the key could read. Under GDPR Article 33 that starts a 72-hour notification window, unless the breach is unlikely to put people's rights at risk.
- How do I test my AI app for exposed keys and open endpoints?
- Start from outside, the way a stranger would. Keybrum's free check at keybrum.com/check shows the keys your JavaScript exposes in about ten seconds. Its paid attack run calls your AI routes signed out and reports each finding with the request that worked.
More guides
- AI agent security: protecting tool-calling endpoints from abuseAI agents that call tools add three doors to your app: an open endpoint, prompt injection that triggers a tool call, and keys in config files. How to check each.
- How to Detect Leaked LLM API Keys in Deployed Web AppsLLM API keys leak through JavaScript bundles, source maps, and environment variables. Learn how automated security scanners find them before an attacker runs up your bill.
- How to Secure LLM API Keys and Endpoints in ProductionLLM API keys are the most expensive secrets in your codebase. This guide covers key rotation, endpoint hardening, proxy-layer security, and automated vulnerability scanning for AI-powered apps.
- How to Reduce OpenAI API Costs Without Hurting QualityLearn how to reduce OpenAI API costs with live spend tracking, risk-based routing, caching, framework controls, and a proxy baseURL setup.
- How to Reduce LLM Costs When Building with CursorLearn how to reduce LLM cost in Cursor with model routing, context trimming, caching, batching, and monitoring tactics I use in production.
- How to Reduce LLM Costs in LlamaIndex RAG AppsLearn how to reduce LLM cost in LlamaIndex with model routing, context trimming, caching, batching, and monitoring tactics that cut RAG spend fast.