← All news
AI SecurityAI GovernanceIncident Response

OpenCode Breach Exposed Stored OpenAI, Anthropic and Google API Keys in What the Vendor Calls a 'Large Scale Distillation Attack'

Obiguard Research Team·October 18, 2026·6 min read

OpenCode, the open-source AI coding agent, has told a subset of its users that third-party provider API keys saved in their workspaces may have been exposed after unauthorised access to a legacy system. The vendor, Anomaly Innovations, said on 17 October that the incident was "related to a large scale distillation attack that impacted 1.4% of OpenCode Console users", according to Startup Fortune. It is working with Anthropic, OpenAI and Google on remediation.

The number of affected accounts, how the attacker got in, and whether every stored key was actually extracted have not been disclosed. OpenCode says it cannot share more while the investigation is ongoing.

What is known

  • What was exposed: provider API keys that users had saved in OpenCode Console, the hosted layer where teams share models from a workspace, set budgets and connect their own model-provider keys. Notices named OpenAI and Anthropic as examples; Cyera's write-up adds Google, and OpenRouter or custom providers routed through the same workspace could be in scope.
  • Where it happened: a legacy console system that OpenCode says it was in the process of decommissioning.
  • Who is affected: only Console users who had linked external provider keys. OpenCode emailed each affected account and says anyone who did not receive an email was not impacted. Developers who run OpenCode purely from the CLI, with keys in a local config file, are not reported as affected.
  • Signs of misuse: some users reported OpenAI and Anthropic spend alerts and drained balances before the first notice arrived, with Crypto Briefing reporting bills climbing into the hundreds of dollars from queries the users did not make. OpenCode has not confirmed those reports, and it says its investigation has found no evidence to date that other data was taken.

OpenCode has had three unrelated security advisories this year, including CVE-2026-22812 and CVE-2026-22813 in January. The CyberSec Guru notes none of them explains this credential exposure, so do not assume updating the client fixes it. Rotating the keys is the fix.

Why "distillation" changes the threat model

Most stolen-API-key stories are about free compute: someone resells access or runs a spam campaign on your bill. Distillation is different. The attacker sends a very large number of carefully chosen prompts to a frontier model and keeps the answers to train a cheaper model to imitate it. The output is the point, not the service.

That makes stolen keys from real organisations more valuable, not less. Anthropic has already alleged that three China-based labs generated more than 16 million exchanges with Claude through about 24,000 fraudulent accounts, as reported by Infosecurity Magazine, using proxy networks to evade detection. Providers have responded by tightening account vetting. A key belonging to an established paying customer gets around that vetting entirely, and the traffic looks like a legitimate team doing a lot of coding.

The OpenCode label is the vendor's description of the motive, not an attribution. Nobody has publicly said who ran the queries.

The structural problem: raw keys handed to tools

OpenCode did nothing unusual by storing provider keys. Every AI coding tool, agent framework and chat front-end that lets you "bring your own key" does the same, and each one becomes a place where that key can be lost. A single OpenAI or Anthropic key typically carries the full spend limit of the account, works from any IP, and can call any model the account can reach. Lose it from one tool and you have lost it everywhere.

We saw the same shape in the GitLab AI Gateway flaw earlier this month, where the vulnerable component held provider credentials for an entire platform. The difference here is that the keys belonged to individual developers and teams who pasted them into a vendor's hosted console, which is exactly how most organisations' AI spend is wired up today.

What to do this weekend

  1. Find out whether anyone in your organisation used OpenCode Console. Ask developers directly. Check corporate card statements and expense reports for OpenCode charges, and search provider dashboards for keys with names like "opencode" or "console".
  2. Revoke and reissue in the provider dashboard, not in OpenCode. Go to platform.openai.com, console.anthropic.com or the Google AI Studio console directly. Do not follow links in a breach email, since incidents like this attract phishing within hours.
  3. Review usage from 16 October onward for spikes, unfamiliar models, or activity at odd hours. Preserve the usage export before you rotate, so you have a record of what was run.
  4. Update everything that used the old key. CI jobs, internal tools, other agents and scripts will fail silently or loudly once the key is dead. Finding them is the real cost of rotation.
  5. Set hard spend caps and alerts at the provider. OpenCode's own budgets only cover traffic routed through OpenCode. A stolen key used directly ignores them.
  6. Stop reusing one key across tools. Issue a separate key per tool and per project so the next exposure is contained to one place.

Where Obiguard fits: agents get a scoped key, not your provider key

The sixth step above is the one teams skip, because every new tool asks for a provider key and there is no central place to issue something narrower. That is what Obiguard Governance AI is for. The provider key stays in the gateway. Each coding agent, workspace or tool gets its own access key scoped to a specific agent, bound to an approved provider and an approved list of models, so a key issued for one agent cannot be used to reach another or to call a model it was never meant to use.

If a key like that leaks from a third-party console, you revoke one key in one place and the provider credential behind it is untouched. Usage is attributable per agent on the project dashboard, so a traffic spike shows up against the tool that caused it rather than as an unexplained jump on three separate provider bills, and the audit ledger records what was sent and what came back. For a distillation attempt, that is also where the pattern is visible: thousands of structured prompts from one key, at a volume no developer produces by hand.

The question to take away

How many separate tools and consoles currently hold a copy of your organisation's OpenAI or Anthropic key, and could you name them all before you had to rotate it?

See how Governance AI works or talk to us about moving from shared provider keys to per-agent access.

How Obiguard helps

Turn this into enforced policy, not just awareness.

Obiguard sits in front of every AI request your organization makes — screening prompts and outputs against the guardrails, compliance frameworks, and audit trails that stories like this one make necessary.

See how it works →