AI-generated brand cover: a dark navy key cracked in the middle on a light gray background, symbolizing the API key breach

OpenCode Discloses Breach: API Keys of 1.4% of Console Users Exposed

OpenCode says attackers reached a legacy system and stole saved OpenAI, Anthropic and Google API keys; the company calls it a 'large-scale distillation attack'.

Security and governanceOpenCodeAI Agents

OpenCode, the open-source AI coding agent, disclosed a security breach on October 17 that exposed third-party API keys saved by a slice of its users. The company called it “a large-scale distillation attack” and said it affected 1.4% of OpenCode Console users.

The disclosure landed in two waves. First, an email with the subject line “Action Required: Potential provider key breach” reached affected users on the morning of October 17, U.S. time. By 14:14 UTC the notice was circulating on r/opencode, and developers on X were reporting provider spend alerts going off overnight. Then, at 18:08 UTC, OpenCode posted its public statement on X: attackers had reached a legacy system the company was in the process of decommissioning, and took the third-party provider keys some Console users had saved there.

What was taken

OpenCode’s notice named OpenAI and Anthropic keys. Users also reported Google spend alerts, and OpenCode said it is “working with Anthropic, OpenAI, and Google to remediate,” which suggests Google keys were caught up in the incident too.

The keys were not just copied. Stolen keys were then used to run up charges on the victims’ own provider bills. OpenCode emailed every affected user that morning and said anyone who did not receive an email was not impacted — but the company has not said how many users that 1.4% represents in absolute terms, or who pays for the unauthorized spend. OpenCode has also not confirmed whether the keys were stored in plaintext; one security researcher on X claimed they were, but that has not been officially verified.

What “distillation attack” probably means here

OpenCode’s choice of words is unusual. In AI research, distillation means training a smaller model to imitate a larger one by learning from its outputs. Applied as an attack label, it suggests the intruders were not just stealing keys for resale — they were using the victims’ paid API access to generate large volumes of model output, most likely to train or refine their own models on someone else’s dime.

That reading is consistent with what users saw: bills jumping overnight. It is also consistent with a pattern that has been building all week. On October 15, Bitsight disclosed MONST3R-AI in a threat-intelligence blog post: a penetration-testing tool marketed on a restricted criminal forum, where buyers paste in stolen OpenAI, Anthropic and Google API keys and the API bill lands on the victim. Two disclosures in the same week point to the same trend: API keys are becoming one of the most valuable things an attacker can steal in the AI stack, because a key is not just data — it is a direct line to someone else’s compute budget.

A growing attack surface

The economics are straightforward. A stolen password might get an attacker into one account. A stolen provider API key gets them metered access to frontier models, billed to someone else, with no login ceremony to trip an alarm. For an attacker training a model, that is free GPU time laundered through a victim’s invoice. For a pentesting tool like MONST3R-AI, it is free scanning infrastructure.

Agent coding tools make the problem worse by design, not by malice. The whole pitch of a tool like OpenCode is that it spends on your behalf: you paste in a key, the agent plans, writes code, and iterates, each step drawing from your balance. Users now paste keys into IDEs, terminal CLIs, web consoles, and CI pipelines as a matter of routine. Every copy is a new target, and OpenCode’s incident shows that even a system already marked for decommissioning counts. The keys sat in a legacy store that the company was in the middle of retiring, and the attackers got there before the shutdown did.

The industry’s long-term fix is known: scoped, short-lived credentials issued per session instead of long-lived master keys pasted into dashboards. Until agent tooling makes that the default, the advice stays manual and tedious — rotate keys, set spend caps, treat every console as a place your keys could leave from.

What to do if you used OpenCode Console

If you received the email, revoke every provider key you had saved in Console from the provider’s own dashboard — OpenAI, Anthropic, Google — and issue new ones. Read your recent usage on each provider for charges you did not make, and set spend limits on the replacements so a future compromise fails loudly instead of expensively. If you did not get an email, OpenCode says you were not in the affected set, but rotating keys you parked in any third-party console is cheap insurance.

Why this one matters

This is not a breach of a database full of names and passwords. It is a breach of the trust model that AI agent tools run on: users hand their keys to a console so the agent can spend on their behalf, and every link in that chain — the console, its legacy systems, the decommissioning process — has to hold. OpenCode’s legacy system was already on its way out. The attackers got there first.

The deeper problem is structural. Agent coding tools encourage users to paste provider keys into more places: IDEs, CLIs, consoles, CI pipelines. Each copy is a new target, and each one draws directly from a billing account. Until agent tooling moves toward scoped, short-lived credentials by default, expect this category of incident to keep recurring. The question is not whether more consoles will be hit, but which one is next.

What we are still watching: whether OpenCode discloses the absolute number of affected users, whether the three providers issue refunds or credits for the unauthorized charges, and whether the “distillation” framing gets a fuller technical explanation from the company’s postmortem.