Our article2 min read
The OpenCode breach: how to protect the AI keys you give to apps
Attackers broke into the hosted console of the AI coding tool OpenCode and some users saw unauthorized charges on their AI accounts. Here is what was reported and what to do with your own API keys.

In this article
Key takeaways
- OpenCode said attackers broke into an older system behind its hosted Console, and keys that some users had stored there for other AI providers may have been exposed. It says about 1.4% of Console users were affected.
- Affected users reported unauthorized charges on their OpenAI, Anthropic and Google accounts. Reported amounts ranged from a few hundred dollars to more than $1,000.
- The advice in the coverage is to revoke and replace keys directly with each provider, because removing a key from the app may not stop it working.
- You can limit the damage from any app by using a separate key for each one and setting spending limits at the provider.
What was reported
OpenCode is an open-source AI coding agent that developers use alongside tools such as Claude Code and Cursor. According to TechCrunch and eSecurityPlanet, the company said on October 17, 2026 that attackers had accessed an older system behind OpenCode Console, its hosted platform where some users store the API keys that connect OpenCode to AI providers.
OpenCode says the open-source app and command-line tool were not affected, and that keys set up in the locally installed app never reached its servers. It describes the incident as a large-scale distillation attack, which is the company’s own description. Coverage notes that how the attackers got in is not stated, and some observers question the distillation explanation.
Who was affected and what happened to them
OpenCode says 1.4% of Console users were affected and that it emailed them. Users who received no email were not affected, according to the company. The total number of users is not stated.
Affected developers reported spending alerts and charges they did not make across providers. One developer cited in coverage reported $281 on OpenAI and $168 on Anthropic. TechCrunch reports amounts in the hundreds of dollars and a few totals above $1,000. The total across all users is not stated.
How the AI providers responded
- Anthropic revoked the Claude API keys it believed were exposed.
- Google blocked exposed Gemini credentials and advised users to create replacements in AI Studio and review account activity.
- OpenAI said it would refund API customers for credits consumed during the attack.
- OpenCode said refunds were underway and that the incident was still ongoing when the coverage was written.
What to do with your own API keys
If you use OpenCode Console and stored provider keys there, revoke those keys directly with each provider and create new ones. Coverage points out that deleting a key inside the app may not revoke it. Then check each provider’s usage and billing pages for requests you do not recognise.
Even if you do not use OpenCode, the same habits protect you with any app that asks for an API key:
Habits that limit the damage
- Use a separate key for each app or project, so you can revoke one without breaking the rest.
- Set a monthly spending limit or budget alert at the provider, so a stolen key cannot run up an unlimited bill.
- Prefer keys with the smallest permissions the app needs.
- Check your usage dashboard now and then, not only when a bill arrives.
- Ask vendors how they store your keys and what they do with old systems they retire.
- Never paste a key into a chat, an issue tracker or a shared document.
Why this matters beyond one tool
Agents and coding tools work by holding keys to other services on your behalf. That convenience means a breach at the tool can become a bill on your account. Our guide to using AI at work safely covers how to decide which data and keys a tool should see. We have not tested OpenCode, and the details above come from the company’s statements and the reports named below.
Go deeper
Sources
Written by an AI from the sources above and checked by a person before publishing. We have not tested products unless we say so. See our editorial policy or tell us about an error through contact.
