The OpenCode breach: what happened, and how to protect your AI API keys
Incident note · October 18, 2026 · 4 min read
On October 17, 2026, OpenCode, the open-source AI coding agent, said it had a security breach that exposed AI provider API keys some users had saved in OpenCode Console. Some people say strangers ran up charges on their OpenAI, Anthropic and Google accounts within hours. Here is what is confirmed, what isn't, and what to do even if you never used OpenCode.
What OpenCode has confirmed
- The breach. In a post on X on Oct 17 at 2:08 PM ET, OpenCode said: "We had a security breach last night related to a large scale distillation attack that impacted 1.4% of OpenCode Console users."
- Who was affected. In the same post, OpenCode said it had emailed every affected user that morning. "If you did not get an email you were not impacted." The affected users were "a subset of users who had external providers" linked.
- Status. In an earlier version of the post, OpenCode said the incident was ongoing, that it couldn't share more details yet, and that it was working with the AI providers. News reports name those providers as Anthropic, OpenAI and Google.
What the email to users said
Several outlets quoted the email affected users received, titled "Action Required: Potential provider key breach." According to Notebookcheck and Safeguard, it said OpenCode had "identified unauthorized access to a legacy system that we were in the process of decommissioning" and that "third party provider keys (eg OpenAI, Anthropic) saved in your workspace may have been exposed." It asked users to revoke and replace those keys through each provider's dashboard, update any apps that use them, and review recent usage for anything unexpected. We have only seen the email through these reports, not the original.
Reports also say OpenCode co-founder Dax Raad explained that keys used in the regular local OpenCode app never reach the company, so only keys saved in Console were at risk. They also say Anthropic revoked Claude API keys it believed were affected (TechCity Authority). We have not checked either claim against the original posts.
What is still unverified
OpenCode hasn't said how the attacker got in, how long they had access, or how many people 1.4% of users is. The reports of drained accounts come from users posting on Reddit and X, including claims of about $158 overnight, $400 on Anthropic and around €200 on Google (some of these were collected by Notebookcheck). None of these amounts have been independently confirmed.
Why your OpenCode dashboard won't show the damage
A stolen key gets used directly against OpenAI or Anthropic, not through OpenCode. Those requests never show up in your OpenCode usage reports and never count against your workspace budget. The bill goes straight to the provider, so check the provider's own dashboards.
What to do now
- Rotate your keys. If you got the email, or you're not sure, revoke every provider key you ever pasted into a third-party tool and create new ones in the OpenAI, Anthropic and Google Cloud consoles. Then update your apps and CI secrets.
- Set spending limits with each provider. Turn on monthly budgets and usage alerts in every provider console. A limit turns a stolen key from an unlimited bill into a capped one. Then check recent usage for spikes you don't recognize.
- Keep keys out of client bundles. This breach happened on a server, but most leaked AI keys we see come from something simpler: a key shipped in a site's own JavaScript, often through a
NEXT_PUBLIC_orVITE_variable. Anyone can open devtools and copy it. Call AI providers from your server or an edge function, and give each app its own key.
ShipSniffer's free scan checks your live site's JavaScript for exposed OpenAI, Anthropic, Stripe and Supabase keys in about 30 seconds.
Scan my app free →
Sources
- OpenCode on X, Oct 17, 2026 (earlier version)
- Notebookcheck, "OpenCode hacked, users urged to revoke their API keys"
- TechCity Authority, "OpenCode confirms Console breach…"
- Safeguard, "OpenCode Console Breach: Rotate Your OpenAI, Anthropic and Google Keys"
We'll update this post as OpenCode shares more. ShipSniffer has no connection to OpenCode.