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

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

  1. 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.
  2. 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.
  3. 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_ or VITE_ 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.
Is your own app leaking a 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

We'll update this post as OpenCode shares more. ShipSniffer has no connection to OpenCode.