News · 14 min read

OpenCode Breach: What Happened to Users' AI Keys and What to Do Now

On October 17, 2026, OpenCode said it had a security breach the night before. The OpenCode breach hit 1.4% of OpenCode Console users, who may have lost the keys they use to pay for AI. A few saw surprise charges before they knew why.

The worry is simple. A stolen AI key lets a stranger run up charges on your account until you switch it off, and OpenCode has not said how many keys were taken.

Here is what is known, what is still unclear, and what to do if your key was in OpenCode Console.

Executive Summary

  • OpenCode says someone got into an old system and that AI provider keys saved by some OpenCode Console users may have been exposed. On October 17 it said the incident was ongoing.
  • The breach touched the hosted OpenCode Console service. Dax Raad of OpenCode says this was the Console, not the coding agent, and that those keys never come to the company.
  • OpenCode linked the breach to a distillation attack but has not explained what that means here, and many developers questioned the label.
  • Affected users reported drained balances and surprise charges, though OpenCode has confirmed no amounts, and it told them to replace their keys.
  • With Elephas, your own API key's requests go straight to your AI company, personal details are hidden before a question goes to the cloud, and Elephas AI or a local model needs no key at all.

What Happened in the OpenCode Breach

The OpenCode breach reached the public on October 17, 2026, first through users and then through OpenCode's own post saying 1.4% of Console users were hit.

Timeline of the OpenCode breach: spend alerts on the night of October 16, an early user report, Matt Johansen's warning and OpenCode's post on October 17
Timeline of the OpenCode breach: spend alerts on the night of October 16, an early user report, Matt Johansen's warning and OpenCode's post on October 17

OpenCode is a popular open source coding agent (an AI helper that writes and runs code for you). In its post on X, the company wrote: "We had a security breach last night related to a large scale distillation attack that impacted 1.4% of OpenCode Console users."

The post added that it "was a subset of users who had external providers linked." An API key is the secret code that lets an app use your paid AI account, so these were the people who had saved such keys.

Users shared the email they got. It said OpenCode found "unauthorized access to a legacy system that we were in the process of decommissioning." It told them to replace their keys, update their apps, and check recent usage.

Posts on X from Lydia Hallie of Anthropic, saying Anthropic worked with OpenCode and revoked affected Claude API keys, and from Thibault Sottiaux of OpenAI, saying OpenAI worked with OpenCode to refund credits drawn in the attack
Posts on X from Lydia Hallie of Anthropic, saying Anthropic worked with OpenCode and revoked affected Claude API keys, and from Thibault Sottiaux of OpenAI, saying OpenAI worked with OpenCode to refund credits drawn in the attack

Who the OpenCode Breach Hit, and Who It Did Not

OpenCode says the breach hit only the 1.4% of Console users it emailed, and that anyone who got no email was not affected.

OpenCode Console compared with the OpenCode coding agent: where provider keys are kept and which one the breach touched
OpenCode Console compared with the OpenCode coding agent: where provider keys are kept and which one the breach touched

OpenCode Console is an optional web service from the same company. Its docs say teams can connect AI accounts they already pay for, such as Anthropic or OpenAI, by pasting in the key. The docs then say: "Console stores the credential and serves each provider through its gateway."

A gateway here is a middle server that passes requests on to the AI company. Console held users' keys on its side. The email says only that those keys "may have been exposed," so OpenCode has not confirmed that every key was taken.

Dax Raad, who builds OpenCode, wrote on X: "this is the OpenCode Console, not OpenCode itself, those keys never come to us."

What the Distillation Attack Label Means

A distillation attack is when someone pulls huge numbers of answers from a strong AI model to train a copy, and Anthropic says three labs used about 24,000 fake accounts to do it.

Distillation attacks in numbers from Anthropic: over 16 million exchanges, about 24,000 fake accounts, and early evidence that new defenses cut harvested data by 90 to 99 percent
Distillation attacks in numbers from Anthropic: over 16 million exchanges, about 24,000 fake accounts, and early evidence that new defenses cut harvested data by 90 to 99 percent

Anthropic describes distillation as "training a less capable model on the outputs of a stronger one." In its February 2026 report, it said those three labs ran over 16 million exchanges (questions and answers) with Claude.

Stolen keys can feed this kind of copying. Anthropic's September 2026 threat report says distillation done without permission usually runs on fake accounts made with stolen credit cards, logins and API keys. Nobody has shown that this is what happened to the OpenCode keys.

OpenCode never explained the link. AI researcher Nathan Lambert wrote: "There's something very odd going on with 'distillation' if a cyber attack to steal api keys is looped under the same term." Security firm Cyera wrote that "No one has publicly attributed the OpenCode attack."

What Users Said About the OpenCode Breach

Some of the earliest signs came from users watching their bills, with one user reporting $281 of OpenAI use and $168 of Anthropic use in a single night.

User reports after the OpenCode breach: $281 on OpenAI and $168 on Anthropic for one user, $20 of Anthropic credits for another, and spend alerts at three providers
User reports after the OpenCode breach: $281 on OpenAI and $168 on Anthropic for one user, $20 of Anthropic credits for another, and spend alerts at three providers

That user, Colin Parsons, wrote on X that both keys "are only used in opencode; none of my other openai / anthropic keys have been hit." Chris Sinco, who says in his X bio that he designs Android developer tools, wrote that his "Open AI, Anthropic, and Google AI spend alerts all fire off before going to bed."

Analyst Max Weinbach said he was hit too. He wrote: "My OpenAI and Anthropic balances got drained, Google account got limited and drained a bit and OpenCode did email me."

Max Weinbach's post on X saying his OpenAI and Anthropic balances were drained after the OpenCode breach
Max Weinbach's post on X saying his OpenAI and Anthropic balances were drained after the OpenCode breach

The anger on Hacker News was mostly about trust. One commenter said saving a key in Console was like "handing your password" to someone else. Another said the team "did a terrible job of communicating this," because Console and the coding agent share one name and the notice did not tell them apart.

Is OpenCode Safe to Use After the Breach

Dax Raad, who builds OpenCode, says the breach was in OpenCode Console, not in the coding agent on your computer, but the agent has had at least two serious public bugs of its own in 2026.

OpenCode security history in 2026: a January remote code bug, a September Datadog report on a second bug, and the October Console breach
OpenCode security history in 2026: a January remote code bug, a September Datadog report on a second bug, and the October Console breach

In January, a bug tracked as CVE-2026-22812 (a public ID for a known security bug) let any website or local program run commands on a user's computer. It scored 8.8 out of 10 for severity and was fixed in version 1.0.216.

In September, Datadog Security Labs published a second remote code bug (one that lets an outsider run commands on your machine if you run OpenCode's local web server, for example by visiting a bad web page). It was fixed in version 1.18.22 in August. Datadog counted more than 647,000 npm downloads of the affected versions from September 17 to 23, though that does not show how many people were exposed.

Both bugs are fixed in current versions, so updating matters. The October breach was in the hosted service, Console, not in the agent.

What to Do If Your Key Was in OpenCode Console

If you ever pasted an AI key into OpenCode Console, switch that key off at the AI company today, make a new one, and set a hard spending limit.

Four steps after the OpenCode breach: switch off the old key, make a new one, set a hard spending limit where the provider offers one, and check usage logs at OpenAI, Anthropic and Google
Four steps after the OpenCode breach: switch off the old key, make a new one, set a hard spending limit where the provider offers one, and check usage logs at OpenAI, Anthropic and Google

Deleting the key inside OpenCode does not stop a copy that someone may already have. The key has to be switched off at the AI company that issued it. Anthropic's key safety guide warns that putting your key in a third party tool gives "the developer of that tool access to your Claude Console account."

Google's Gemini key guide gives a short leak checklist: make a new key, update your app, disable the old key, and check billing logs.

OpenAI's docs say to revoke a compromised key "promptly and replace it with a new key." Spending alerts alone will not stop the charges, and the same docs say plainly that "Spend alerts do not enforce a cap." At OpenAI and Anthropic, a hard limit makes requests fail once you reach it, so turn that on. Google's Gemini API has a monthly spend cap, but Google says it is experimental and can run over by around 10 minutes of spending.

How Elephas Keeps Your Questions and Personal Details Safer

Elephas avoids the problem that hit OpenCode Console, because your own API key's requests go straight to your AI company, and it adds an extra layer on top by hiding personal details such as names, email addresses and phone numbers before a question goes to the cloud.

The Elephas security page showing three ways to get an answer: Elephas AI, your own API key sent straight to your provider, and an on-computer model that sends nothing
The Elephas security page showing three ways to get an answer: Elephas AI, your own API key sent straight to your provider, and an on-computer model that sends nothing

Image: elephas.app/security, captured October 18, 2026.

In OpenCode Console, users pasted their AI keys into a hosted service. That service kept the keys and sent requests to OpenAI or Anthropic for them. So when its old system was broken into, the saved keys may have been exposed.

Elephas is private AI for your documents on Mac. It answers questions from your own files, which stay stored on your computer, and every answer cites the files it came from. Here is how it handles your questions and your data.

Your own key goes straight to your AI company

When you add your own API key to Elephas, your questions go straight to the AI company you picked. They never pass through an Elephas server, so Elephas cannot see them, and your provider's terms decide what it keeps. There is no middle server holding your requests that someone could break into.

Personal details are hidden from the AI company

This is the extra layer. Whichever AI you choose, such as OpenAI (the company behind ChatGPT), Claude, Gemini, Mistral or DeepSeek, Elephas first finds names, email addresses and phone numbers on your Mac and swaps them out. Then it sends the question and puts the real details back in the answer.

So the AI company gets your question with those details hidden. This works by detection, so it can miss things and works best in English, which is why you can see what was hidden under every answer and add your own protected names.

Elephas AI, with no key needed

You do not need an API key at all. Elephas AI comes with the trial and every plan. It runs open source models in Elephas's own cloud, and your questions and answers are not stored, not used to train AI, and not shared with the model makers. Personal details are hidden on this route too.

A local model that sends nothing

For the most private work, download a local model once and Elephas answers on your own computer. There is no key to leak and nothing is sent anywhere.

Built for teams too

The new Elephas also works for teams. A team shares Team Brains (shared sets of documents), gives each person a role such as manager, contributor or reader, and syncs with end to end encryption. On the Team plan, cloud answers come through Elephas AI, and the owner decides whether members can use the on-computer model.

Conclusion

The OpenCode breach shows that an AI key is only as safe as the least careful place that holds it.

OpenCode still owes its users a full account: how many people were hit, how the attacker got in, and how the keys were kept. Until then, replace any key you saved in OpenCode Console and cap what it can spend.

Ask your own documents, privately

Your documents stay stored on your computer, personal details are hidden before any cloud AI, and every answer cites its source. Free for 7 days, no card needed.

Try Elephas free
Selvam Sivakumar
Written by

Selvam Sivakumar

Founder, Elephas.app

Selvam Sivakumar is the founder of Elephas and an expert in AI, Mac apps, and productivity tools. He writes about practical ways professionals can use AI to work smarter while keeping their data private.

← Back to Resources

Related Resources

Explore all AI Privacy & Security resources
news

Nadella Says Treat AI Models as Insider Risks: What His Essay Asks For

Satya Nadella says to treat AI models as insider risks: assume a model is compromised, keep an emergency brake and logs it can't edit. Here is what he means.

11 min read
article

Perplexity Computer vs Claude Cowork: Which AI Agent Should Run on Your Mac?

Perplexity Computer vs Claude Cowork in 2026: where your files go, what runs on your Mac, dated prices, and which AI agent fits confidential work.

18 min read
article

ChatGPT Business vs Plus: Which Plan Is Right for Your Firm?

ChatGPT Business vs Plus for small firms: compare personal-account risk, workspace controls, data handling, pricing, and the right plan by team size in 2026.

15 min read
article

Perplexity Computer Review (2026): What It Actually Does, What It Costs, and Who It's For

Perplexity Computer review 2026: what it does, what Pro and Max really cost in credits, what runs locally on a Mac, and who should trust it with client files.

11 min read