The short version
OpenCode, a popular open-source AI coding agent, says an intruder reached a legacy system behind its hosted Console and exposed the third-party AI API keys of 1.4% of Console users. Those OpenAI, Anthropic and Google keys were then used for unauthorized model calls, with users reporting bills from a few hundred dollars to $1,700. The local CLI was not affected. If your team stored provider keys in OpenCode Console, revoke and replace them now.
What happened at OpenCode?
OpenCode is an open-source AI coding agent that developers run in the terminal and editor. Alongside it, the team offers OpenCode Console, an optional hosted service where a workspace saves its own OpenAI, Anthropic or Google key so that team members can use those models without ever seeing the key. That convenience is exactly what made the incident costly. It is also the pattern many companies copy when they embed GenAI into their own products: one stored key, shared by many users, billed to one account.
Co-founder Dax Raad disclosed the breach on X, describing it as “a large-scale distillation attack that impacted 1.4% of OpenCode Console users.” He told reporters the attackers had been probing the company's systems for at least 48 hours using AI agents. Affected users were notified by email, and OpenCode said reimbursement was possible. According to TechCrunch, Anthropic and Google blocked the exposed keys and OpenAI refunded affected customers for the unauthorized usage.
One detail stands out for security teams. During the response, the AI models OpenCode used began refusing requests about the malicious code because their safety filters could not tell defenders from attackers. The team says it stabilized the situation only after switching to OpenAI's Daybreak model, which is built for defensive security work.
Who is affected, and who is not?
The scope is narrower than the headlines suggest, and the distinction matters for your response plan:
| Setup | Where the provider key lives | Exposed in this incident? |
|---|---|---|
| OpenCode CLI / desktop app with your own key | On the developer's machine | No, according to OpenCode |
| OpenCode Console workspace with a saved provider key | On OpenCode's hosted service | Yes, for 1.4% of Console users |
| Same key reused in CI jobs, scripts or other tools | Everywhere it was pasted | Yes, if that key was in Console |
The last row is the one teams miss. A key that was saved in Console and also reused in a CI pipeline or a local script must be replaced everywhere, or the new key will simply break those jobs while the old one keeps working for the attacker until it is revoked.
Why would attackers want AI API keys?
A distillation attack queries a strong model at volume and harvests the outputs to train a cheaper competing model. Stolen keys make that free for the attacker, because the victim pays for every token. Some observers questioned whether distillation was the real motive or simply a label for monetizing stolen keys. For the victim, the difference is academic: either way, a leaked key is a pre-paid spending account with no PIN.
This is why AI provider keys behave differently from most credentials. A leaked database password still requires a route to the database. A leaked model key works from anywhere on the internet, immediately, and every misuse shows up as a bill. Several victims learned about the breach from their invoices, and at least one had a Google Cloud project suspended for “abusive activity” it did not run.
What it means for US & EU software teams
Three practical lessons go beyond OpenCode. First, hosted AI developer tools are now part of your supply chain. Every SaaS coding assistant, agent platform or AI gateway that stores a provider key concentrates risk in a system you do not control, including its legacy components. Put these tools on the same vendor list as your CI provider and source host, and ask each one where keys live and how they are encrypted.
Second, treat model keys as budget, not just as secrets. Issue one key per tool and per environment, set hard spending limits or project budgets at each provider, and alert on usage spikes. Better still, route model calls through your own gateway or secrets manager, which issues short-lived, scoped credentials so no third party ever holds a long-lived key. This is ordinary cloud and DevOps hygiene, but few teams have applied it to AI spend yet.
Third, plan for AI-assisted attacks and AI-hampered defense. OpenCode says the attack ran for at least 48 hours with AI agents, while its own models refused to help analyze the malware. Your incident runbook should not depend on a general-purpose chatbot cooperating at 3 a.m. For EU companies, remember that a provider account linked to customer prompts or logs can turn a billing incident into a GDPR question, with its 72-hour notification clock.
What to do this week
- Revoke and replace. If you saved any provider key in OpenCode Console, revoke it in the OpenAI, Anthropic or Google dashboard and issue a new one. Changing your OpenCode password does not stop a stolen key.
- Hunt for reuse. Search CI variables, scripts,
.envfiles and other AI tools for the old key and update them all. - Review billing since October 16. Check provider usage logs for unfamiliar models, regions or volumes, and contact the provider about refunds.
- Set spend caps. Configure hard limits or budgets per project and alerts on unusual usage at every model provider.
- Split keys by tool and environment. One leak should never burn your production budget.
- Inventory hosted AI tools. List every SaaS tool that stores a model key and decide which ones really need to.
Frequently asked questions
What happened in the OpenCode Console breach?
An intruder reached a legacy system tied to OpenCode Console around the night of October 16–17, 2026. The OpenAI, Anthropic and Google API keys that 1.4% of Console users had saved in their workspaces were exposed and then used for unauthorized model calls. OpenCode called it a large-scale distillation attack and notified affected users by email.
Is the local OpenCode CLI affected?
According to OpenCode, no. The open-source app and CLI keep provider keys on the user's machine and never send them to OpenCode's servers. Only keys stored in the hosted Console were in scope.
What is a distillation attack?
It means querying a strong AI model at high volume so its answers can be harvested to train a cheaper competing model. Stolen keys are attractive for this because the victim pays for the queries. Some observers questioned whether distillation was the real goal here or simply a way to monetize stolen keys.
Does changing my OpenCode password stop the abuse?
No. A stolen provider key works independently of your OpenCode account. Revoke it at the provider, issue a new one, update every application and CI job that used it, and review billing for requests made since October 16, 2026.
How can teams limit damage from a leaked AI API key?
Use a separate, narrowly scoped key per tool and environment, set hard spending limits at each provider, alert on unusual usage, and prefer short-lived credentials issued through your own gateway or secrets manager over long-lived keys pasted into third-party tools.
Sources
TechCrunch — Hackers hit AI coding tool OpenCode, running up charges on users' AI accounts (October 19, 2026)
BleepingComputer — OpenCode hack exposes API keys amid AI distillation attacks (October 19, 2026)
The Hacker News — OpenCode Console Breach May Have Exposed OpenAI, Anthropic, and Google API Keys