On October 17, 2026, OpenCode, a popular open-source AI coding agent, said a security incident had hit some users of its paid Console service. The stolen prize wasn’t passwords or card numbers. It was the AI provider keys people had saved in their workspaces, the keys that let anyone run Anthropic, OpenAI or Google models on the owner’s bill. Some users woke up to charges they never made. Here is what is known about the OpenCode breach so far, why it matters even if you never used OpenCode, and the steps that limit the damage from the next one.
What happened in the OpenCode breach
OpenCode said on X that the breach was “related to a large scale distillation attack” and affected 1.4% of OpenCode Console users, specifically those who had linked external providers. Its email to affected users, reported by The Latent, said someone had gained access to a legacy system the company was decommissioning, and that keys saved in the workspace may have been exposed. It asked users to revoke those keys at each provider and watch for unexpected usage. OpenCode says it is working with Anthropic, OpenAI and Google, and that anyone who didn’t get the email wasn’t affected.
What is not known yet: how many people that 1.4% represents, how the attackers got in, who they were, and whether anyone will be refunded. In his video on the incident, David Ondrej showed users’ posts about overnight bills from $168 to $1,700 and suggested a Chinese lab was behind it. OpenCode has not said who was responsible.
What is a distillation attack?
Distillation means training a smaller model on the answers of a bigger one, so it learns to imitate it cheaply. Done without permission, at scale, it’s a distillation attack. Anthropic said in February 2026 that DeepSeek, Moonshot and MiniMax used about 24,000 fraudulent accounts to generate over 16 million exchanges with Claude for this purpose. In October it said new safeguards had cut the data distillers harvest by roughly 90 to 99%.
Why the OpenCode breach targeted users, not labs
When the labs lock the front door, the pressure moves to anyone holding a key. A tool that stores keys for several providers in one place offers several ways in at once. Traffic from stolen user keys also looks like ordinary customers, which makes it harder for the labs to spot. That is the real lesson: your API key security now depends partly on every vendor you’ve handed a key to.
How to protect API keys after a breach
If you use any tool that stores provider keys, do this today, whether or not you got an email:
- Revoke and reissue. In each provider dashboard, delete keys saved in third-party tools and create new ones.
- Check usage. Look at the last 30 days of usage per key for spikes you can’t explain.
- Cap spending. Set monthly limits and alerts where the provider offers them.
- One key per tool. Never reuse a key across tools, so one leak doesn’t expose everything.
- Least privilege. Give each key the narrowest scope and project access the provider allows.
- Remove what you don’t use. Old keys in abandoned tools are exactly what a legacy system leaks.
Rotate API keys on a schedule, not after the news
Rotating only after a breach headline means you are always late. Put key rotation on the calendar. Every 90 days is a common rhythm. And treat any tool you stop using as a reason to revoke its key that day.
Why boring habits win here
I’ve built, scaled, and sold three companies, generated over $85 million in the last seven years in my own companies. The losses that stung were rarely clever attacks. They were doors we forgot to close. The numbers say the same is true now.
| Evidence | Source |
|---|---|
| 1.4% of OpenCode Console users affected through a legacy system holding provider keys | OpenCode, Oct 17, 2026 |
| About 87% of exploited bugs are attacked on or before disclosure, vs 23% in 2020 | a16z, Oct 6, 2026 |
| About 24,000 fraudulent accounts used to distill Claude | Anthropic, Feb 23, 2026 |
Then scan yourself before someone else does
Key hygiene covers what vendors hold. For your own code, the answer is scheduled AI scans that look for weak points while you sleep. Our guide to automated security scanning with AI walks through the seven-step setup, with the exact prompts.
Want your keys and AI tools audited?
We list every AI tool and key in your business, rotate and cap them, remove the ones nobody uses and set a rotation schedule. You approve every change before we make it, so nothing your team relies on breaks without warning. Why now: the next leak won’t send a warning first.
| What you get | Where |
|---|---|
| An AI tool and key inventory, rotation, spend caps, a schedule | AI automation |
FAQ
Was I affected if I use the free OpenCode agent?
OpenCode says the incident affected a subset of Console users with external providers linked, and that it emailed all of them.
Should I stop using AI coding tools?
No. Give each one its own key, cap its spending and remove keys you no longer use.
Can I get refunded for stolen usage?
OpenCode hasn’t said yet. Contact each provider with the dates and amounts.
How often should I rotate keys?
On a schedule, such as every 90 days, and immediately after any vendor incident.
Sources
- The Latent, OpenCode breach report (Oct 17, 2026): https://thelatent.co/models/opencode-says-breach-tied-to-distillation-attack-exposed-users-ai-provider-keys
- TSN, OpenCode disclosure (Oct 17, 2026): https://tsnmedia.org/opencode-console-breach-distillation/
- Anthropic, “Detecting and preventing distillation attacks” (Feb 23, 2026): https://www.anthropic.com/news/detecting-and-preventing-distillation-attacks
- Anthropic, “Strengthening our defenses against distillation attacks” (Oct 12, 2026): https://www.anthropic.com/research/distillation-defenses
- a16z (Oct 6, 2026): https://x.com/a16z/status/2107565314410230224
- David Ondrej, “OpenCode hack is INSANE.” (Oct 18, 2026): https://youtu.be/YaK6cnET2IE
Want your keys locked before the next leak?
Book a call and we’ll find every AI key your business has handed out.