Last month, some software developers woke up to discover more than $1,000 in overnight charges on their AI accounts. Attackers had stolen the API keys their software uses to reach AI services. Those thefts were part of a wider wave of attacks in October, many of them targeting cloud services that store customer keys.
A credit card for your AI account
Companies that build AI into their products and internal tools typically connect them to models from providers such as OpenAI, Anthropic and Google. Every request the software sends carries an API key, a long string of characters that identifies the customer’s account. Because providers bill by usage, a key works like a corporate credit card: anyone holding it can run up charges on the owner’s account.
A company may have dozens of these keys, one for each application, chatbot, AI agent or developer’s coding assistant. An application must present its key every time it calls the AI model, so the key usually sits with the application’s other settings, often in environment variables. Many companies run their applications on third-party cloud hosting services, which store those settings, keys included, for all of their customers. A break-in at one of those services can expose keys belonging to multiple companies.
Black October
On October 30, Northflank, a managed Kubernetes application platform for developers, advised customers to assume that every environment variable stored on its systems had been decrypted, and to replace all of their secrets. Some customers reported that their AI keys had already been used. Two weeks earlier, OpenCode, which makes an AI coding tool, said attackers had taken AI keys from about 1.4 percent of its paying users. That was the theft behind the overnight charges. Around the same time, security researchers reported that new versions of Aoki, an infostealer that pulls passwords from infected computers, had begun targeting the login credentials developers use for AI coding assistants.
On October 21, attackers used stolen publishing credentials to release a tainted version of LiteLLM, widely used open-source software that connects applications to AI models. The altered version stole AI keys and cloud account credentials from computers that installed it. By month’s end, the security firm Wiz had counted at least nine similar attacks on services used to build AI software and named the month “Black October.”
No traffic, no alerts, and a $100K-a-day problem
Once attackers have a key, they don’t need your network. They send requests straight to the AI provider from their own servers, so firewalls, proxies and endpoint security tools have nothing to inspect. For many victims, the first indication of a breach is the invoice.
Criminals profit from a stolen AI key in two ways: they run their own AI workloads on it, or they sell access to others. Either way, the key’s owner pays. In a report released earlier this week, Mandiant, Google’s incident response unit, said the charges can exceed $100,000 a day. Some companies had been billed $1 million by the time they discovered the theft and revoked the keys.
What else a stolen AI key exposes
The financial loss may be the least of it. Depending on the provider and how the account is configured, an AI key may also unlock files and conversation histories stored with that provider. And the secrets kept alongside an AI key are often more sensitive than the key itself. When Trigger.dev, a service for running AI agents and automated workflows, disclosed its breach, the stolen data included credentials for the payments company Stripe, the database service Supabase and the messaging app Slack.
Protecting AI keys with Zero Trust
The same Zero Trust principles applied to users, applications and devices work for AI keys: grant least privilege access and verify continuously. Six steps put those principles into practice.
- Inventory every AI key: who owns it, what it’s for and where it’s stored, including on third-party hosting services and developer laptops.
- Issue a separate key for each application or agent, limited to the models and permissions it needs. If one is compromised, you’ll know where it came from and can revoke it without disrupting anything else.
- Replace long-lived keys with short-lived credentials wherever the provider supports them.
- Keep provider keys in one place. A secrets manager or AI gateway can be a central repository, so copies never sit in applications or on hosting services.
- Set spending alerts and usage caps on every key and route alerts to the security team as well as finance. Treat a sudden spike in usage as a security event.
- Have a plan to replace every AI key quickly and test it.
Three questions for your security team...
- Do you know where every AI key your company uses is stored today?
- If one were stolen tonight, how would you know, and how quickly could you replace it?
- What other credentials are stored alongside each key, and what could an attacker reach with them?
AI keys need the same protection as any other privileged credential. Black October showed the cost of leaving them exposed.