OpenCode Hacked: API Keys Exposed, What to Do Now
TL;DR · the short version
On 17 October 2026 OpenCode, the open-source terminal AI coding agent, emailed some users that an intruder reached a legacy system and may have exposed provider API keys from user workspaces. Per outlets reporting the email, OpenCode called it a large-scale distillation attack affecting roughly 1.4% of Console users and could not confirm malicious use; its claims are unverified, with no full post-mortem. Developers report fraudulent spend on keys used only in OpenCode. If you use a bring-your-own-key tool, rotate every key and set spend caps.
If an AI coding tool holds your OpenAI, Anthropic or Google API keys, this one is for you. On 17 October 2026, OpenCode — the popular open-source terminal coding agent from Anomaly Innovations (formerly SST) — emailed a subset of users that an intruder reached a legacy system it was decommissioning and may have exposed provider API keys stored in user workspaces. Developers are reporting real money drained. Here is the calm, accurate version — what is confirmed, what is not, and exactly what to do.
Up front, so there is no confusion
PlayCISO is not affiliated with OpenCode or Anomaly Innovations and was not involved in this incident. This is independent, third-party coverage. Every specific figure below — the 1.4%, the email-notification claim, the provider-coordination claim — comes from OpenCode’s notification email as reported by news outlets, or from public user reports on X. We have no inside information, we have independently verified none of OpenCode’s figures, and OpenCode has not published a full technical post-mortem. Where we draw a conclusion, we say so.
What is reported
- Who: OpenCode, maintained by Anomaly Innovations (the team formerly known as SST). It is an open-source terminal AI coding agent used with your own provider API keys across 75+ model providers — no markup, you pay the provider directly.
- What: An intruder reportedly reached a legacy system in the process of being decommissioned. Provider API keys stored in user workspaces may have been exposed.
- Scope (OpenCode’s figure): Reported as a "large-scale distillation attack" affecting ~1.4% of OpenCode Console users. OpenCode reportedly said it emailed every affected user, and that anyone who did not receive an email was not affected — it was a subset who had external providers linked.
- Keys named: OpenAI, Anthropic and Google.
- Real-world impact (user reports): Developers on X report fraudulent inference spend on keys used only in OpenCode — one thread cites $281 (OpenAI) + $168 (Anthropic) starting around 2am Eastern, another $1,700, others $400+. The common thread: other keys the same people hold were untouched, which points squarely at the OpenCode-stored keys.
- What OpenCode could NOT confirm: whether the exposed keys were actually used maliciously. (The user reports strongly suggest some were.)
Update — what later reporting adds (17–18 Oct 2026)
More detail has surfaced from researchers and affected users since the first notices. All of it is attributed reporting, not independently verified by us, and OpenCode still has not published a technical post-mortem:
- Timeline & a named confirmation. The first breach reports appeared around 10:30pm ET on 17 Oct 2026. Security researcher Matt Johansen posted that OpenCode customers were receiving breach notices with keys running up charges, then followed with "Confirmed. OpenCode hacked. Keys stolen," urging customers to revoke — a post that drew roughly 158K views.
- Which keys leaked, more precisely. Per user reports (incl. Reddit), keys kept purely local appear safe, while keys added for outside providers — e.g. via OpenCode "Zen" — are the ones reported leaking. Alongside OpenAI and Anthropic, at least one user reports their Google AI keys were hit too. That matches the earlier "subset who had external providers linked" framing.
- Named losses. Developer Max Weinbach reports his OpenAI and Anthropic balances drained and his Google account limited and partly drained, and says OpenCode emailed him. A user, Martynas, reports ~$50 of Anthropic and ~$70 of OpenAI tokens drained from keys added to OpenCode Zen; others report overnight charges of $65–$281. At least one user is asking for a refund or Zen credit.
- A coincidence, explicitly NOT a cause. One user noted OpenCode 2.0 launched ~14 hours before their charges, and several say spend alerts fired overnight — but no link between the 2.0 launch and the breach has been established, and we are not implying one.
None of this changes the response: revoke and reissue every provider key you ever saved in OpenCode (OpenAI, Anthropic, Google and any others), in each provider's own dashboard, and check your provider bills back to at least 17 Oct.
Why we call it credential compromise, not a "distillation attack"
"Distillation attack" is the phrase reportedly used in OpenCode’s own email, so we attribute it to them rather than put words in their mouth. But look at the observable facts: provider keys that exist only inside OpenCode are being used to run large volumes of paid inference elsewhere. That is the textbook signature of credential / API-key theft and replay — a stored secret was exposed, and attackers are spending it as a bearer token.
Useful next, if this was relevant to you
Model distillation — training a cheaper model on a frontier model’s outputs — may well be the attacker’s end goal for all that stolen inference (it is a fast-growing fraud motive: steal keys, generate training data on someone else’s dime). But the breach itself is a secrets exposure. We lead with the mechanism because the mechanism tells you what to fix. This is our read of public evidence, not an official determination.
If you use OpenCode — or ANY bring-your-own-key AI tool — do this now
- Revoke and reissue every provider key (OpenAI, Anthropic, Google, and any others) in each provider’s own dashboard — not just inside the app.
- Audit usage and billing in each provider console back to at least 17 Oct 2026 for spend spikes or unfamiliar activity.
- Set hard spend caps and rate limits on the new keys so the next leak is bounded, not unbounded.
- Prefer short-lived, narrowly-scoped keys; delete keys you are not actively using.
- Stop centralizing raw long-lived keys — keep them in environment variables or a secrets manager, not pasted into a tool’s workspace.
- Open a provider support ticket for any fraudulent charges. Whether providers refund is still unresolved in the coverage, so ask early.
A fix for the exact surface may already have existed — and a bot closed it
Here is the detail reframing this as a process story, not just a breach story. On 28 August 2026, about eight weeks before the breach, an OpenCode contributor opened pull request #45919, "fix(console): protect legacy auth with turnstile" — adding a Cloudflare Turnstile challenge to the legacy console auth worker, verifying the request (action, hostname, token, source IP) before GitHub or Google OAuth starts, and blocking direct provider routes from bypassing the challenge. About a month later a GitHub Actions bot auto-closed it under an "Automated PR Cleanup" rule, stating the criteria: created more than a month ago, and fewer than two positive reactions. The breach then reportedly came through a legacy system.
What this does and does not establish
Verified: the PR existed, targeted the legacy console auth, and was closed by an automated age/reaction rule — all visible on the public PR thread.
Not established: that this specific PR would have prevented this specific breach. Turnstile blocks automated abuse of the auth path; OpenCode has described the breach as an intruder reaching a legacy system that exposed stored keys, and has not published the exact path. We will not claim the closed PR would have stopped it. The narrower, verifiable claim is damning enough: a hardening fix for the very component involved was written early and discarded by automation — not rejected on the merits by a human.
The systemic lesson is the quotable one: a bot that closes pull requests by age and reaction count has no concept of "security fix." Reactions measure popularity, not risk, and a quiet, unglamorous hardening PR is exactly the kind that collects no thumbs-up and ages out. Automate PR triage if you must — the flood of AI-generated PRs is real — but never let a staleness rule auto-close a PR that touches authentication, secrets, cryptography or access control without a human security review. Label security PRs on creation and exempt those labels from any cleanup bot.
Credit where it is due: by OpenCode's account the fix was authored roughly eight weeks before the incident, and once it hit they caught it quickly, disclosed it themselves, and say they are working it with all three model providers. The failure on display is a pipeline that could not tell a security patch from noise — a trap almost every busy repository has quietly set for itself. (Reports also cite OpenCode's terms capping its liability and disclaiming harm from third-party models; we could not load the terms page to confirm the exact wording, so treat that as unverified.)
The lesson for security leaders
A bring-your-own-key tool is a credential aggregation point. It pools the frontier-model API keys of every developer who uses it into one system — so a single breach of that system exposes hundreds of high-value bearer tokens at once. That is a blast-radius problem, and it is knowable in advance.
- An API key is a bearer token. Possession is authorization; it keeps spending your money until you rotate it. Bound the damage before an incident with per-key scope limits and hard spend caps. Our API Key Lifecycle Lab walks through issuing, scoping, rotating and revoking keys so a leak is survivable.
- Inventory where developer AI credentials actually live — CLI tools, IDE plugins, CI secrets, and "legacy systems being decommissioned" (exactly what was reportedly breached here). You cannot rotate what you have not mapped.
- Treat the AI supply chain as supply chain. Every tool and MCP server you connect can read or exfiltrate what you hand it. Our Malicious MCP Server Scanner and LLM Threat-Model Generator help you reason about which AI integrations touch your secrets and what they could do with them.
- Decommission-in-progress systems are a recurring breach vector. They fall out of patching and monitoring while still holding live data. Put a hard "data purged before shutoff" gate in your decommissioning runbook.
- Exempt security changes from "stale PR" automation. Reaction counts and age are popularity signals, not risk signals. Any PR touching authentication, secrets, cryptography or access control should carry a label that no cleanup bot can auto-close — because the one it eventually closes will be the fix you needed. (See the section above: a Turnstile fix for the legacy console auth was auto-closed eight weeks before the breach.)
None of this depends on knowing who the attacker was, or on OpenCode’s final post-mortem. The fix for a leaked bearer token is the same every time: rotate it, scope it, cap it, and watch it.
Watch this video
A 45-second breakdown of the OpenCode key-theft incident and the six-step response is on our channel — see the PlayCISO blog and our YouTube for the short.
Sources & credit
Credit to the developers who surfaced this publicly and to the outlets covering it. This post relays their reporting; it does not originate any of OpenCode’s figures.
- Notebookcheck — OpenCode hacked, users urged to revoke their API keys
- Startup Fortune — OpenCode breach exposes stored OpenAI and Anthropic keys, prompts urgent key rotation
- Soups Ranjan on X — thread on AI token theft and the OpenCode incident
- Public user reports on X (developers reporting drained OpenCode-linked keys).
Developing incident, last updated 18 Oct 2026. We will update if OpenCode publishes an official technical post-mortem. If you received OpenCode’s email, follow its instructions as the authoritative source for your account.
Frequently asked questions
Was PlayCISO breached? Is this PlayCISO’s incident?
No. PlayCISO is not affiliated with OpenCode or Anomaly Innovations and was not involved in this incident. This is independent, third-party coverage of a developing incident, the same way we cover other security events. Everything attributed to OpenCode here comes from its notification email as reported by news outlets and from public user reports on X; we have no inside information and have independently verified none of OpenCode’s specific figures.
What actually happened?
Per multiple outlets reporting OpenCode’s notification email, an intruder reached a legacy system that OpenCode (Anomaly Innovations) was in the process of decommissioning, and provider API keys stored in user workspaces may have been exposed. OpenCode reportedly called it a "large-scale distillation attack" affecting ~1.4% of OpenCode Console users and said it notified all affected users by email. Independently, developers on X report their OpenAI, Anthropic and Google keys — keys used only inside OpenCode — being drained for fraudulent usage. Whatever the label, the mechanism users describe is credential/API-key compromise: stolen bearer tokens replayed against the model providers. OpenCode said it could not confirm whether exposed keys were used maliciously, and has not published a full technical post-mortem.
Why do you call it "credential compromise" and not a "distillation attack"?
"Distillation attack" is the term reportedly used in OpenCode’s own notification email, so we attribute it to them. But the observable facts — provider keys that live only in OpenCode being used to run large volumes of paid inference elsewhere — describe credential/API-key theft and replay. Model distillation (training a cheaper model on a bigger model’s outputs) might be the attacker’s END GOAL for the stolen inference, but the breach itself is a stored-secret exposure. We lead with the mechanism because it tells you what to fix: rotate the keys. Note this is our read of the public evidence, not an official determination.
I use OpenCode (or another bring-your-own-key AI tool). What should I do right now?
Treat every provider key you ever put into the tool as compromised until proven otherwise. 1) Revoke and reissue your OpenAI, Anthropic, Google and any other provider keys in each provider’s own dashboard — don’t just "rotate in the app". 2) Review usage and billing in each provider console back to at least 17 Oct 2026 for spikes or unfamiliar activity. 3) On the new keys, set hard monthly spend caps and rate limits so a future leak is bounded. 4) Prefer short-lived, narrowly-scoped keys over long-lived ones; delete keys you are not actively using. 5) Open a support ticket with any provider showing fraudulent charges — whether they refund is still unresolved in the coverage, so ask early. 6) Going forward, avoid tools that centralize raw long-lived keys, and keep keys in environment variables or a secrets manager rather than pasted into a workspace.
What is the lesson for CISOs and security leaders?
A bring-your-own-key tool is a credential aggregation point: it concentrates the frontier-model API keys of every developer who uses it into one system, so a single breach of that system exposes hundreds of high-value bearer tokens at once. Three durable takeaways: (1) an API key is a bearer token — possession is authorization, and it keeps spending until rotated, so bound the blast radius with scope limits and hard spend caps before an incident, not after; (2) inventory where developer AI credentials actually live (CLI tools, IDE plugins, CI, "legacy systems being decommissioned" — which is exactly what was breached here); and (3) decommission-in-progress systems are a recurring breach vector because they fall out of patching and monitoring while still holding live data. None of this requires knowing the attacker’s identity.
Is it true a fix for this already existed and a bot closed it?
Partly, and the honest version matters. On 28 August 2026 an OpenCode contributor opened pull request #45919, "fix(console): protect legacy auth with turnstile," adding a Cloudflare Turnstile challenge to the legacy console auth worker; about a month later a GitHub Actions "Automated PR Cleanup" bot closed it for being over a month old with fewer than two positive reactions. All of that is verifiable on the public PR thread. What is NOT established is that this specific PR would have prevented this specific breach — Turnstile blocks automated abuse of the auth path, while OpenCode has described the breach as an intruder reaching a legacy system that exposed stored keys, and has not published the exact path. The defensible lesson is about process, not causation: an automation that closes PRs by age and reaction count cannot tell a security fix from noise, so it will eventually close one. Exempt any PR touching auth, secrets, cryptography or access control from staleness bots and require a human security review. (Credit to OpenCode: the fix was written early, and the team caught, disclosed and is working the incident with all three providers.)
Spotted an error? Report an error. A person reads every message.