Security
5 min read

OpenCode Breach Exposes Third-Party API Keys in Targeted Distillation Attack

OpenCode Console security breach exposes third-party API credentials for 1.4% of users. Attackers used leaked keys for automated model distillation, causing significant unauthorized billing on OpenAI, Anthropic, and Google accounts. Immediate key revocation is required.

Illustration representing the OpenCode security breach exposing third-party API keys and model distillation attack vectors
Illustration representing the OpenCode security breach exposing third-party API keys and model distillation attack vectors

Anomaly Innovations, the developer behind the open-source AI coding tool OpenCode, confirmed that a security breach exposed third-party API credentials stored by approximately 1.4% of its Console users during the decommissioning of an internal legacy system. The unauthorized access was leveraged to execute automated model distillation attacks against frontier AI providers such as OpenAI, Anthropic, and Google, resulting in significant unauthorized usage costs for affected developers.

Anomaly Innovations, the developer behind the open-source AI coding tool OpenCode, confirmed that a security breach exposed third-party API credentials stored by approximately 1.4% of its Console users. The unauthorized access targeted an internal legacy system during decommissioning and was leveraged to execute automated model distillation attacks against frontier AI providers.

Update, Oct 19

The exposed keys are the ones users saved in OpenCode Console, the company's optional hosted service. The OpenCode command-line and desktop apps keep provider keys added on the machine in a SQLite database there, The Hacker News reports. Co-founder Dax Raad wrote on X that the breach involves "the OpenCode Console, not OpenCode itself," and that those keys "never come to us."

Users say they have paid for usage they did not run. Dealroom reported that Colin Parsons wrote on X that his OpenAI key was "pounded" for $281 and his Anthropic key for $168, and that Preston Zeller put his losses at $1,700. Notebookcheck reported that one Reddit user saw $400 in unauthorized charges on an Anthropic account, and another said Google usage charges had reached around €200 and their project had been suspended for excessive abuse. These are the users' own accounts. The Hacker News notes that OpenCode's wording is that the keys "may have been exposed," and that it has not said any key was copied or used.

The attacks did not stop at the breach. On October 18, Raad wrote on X that attackers had been "non stop trying to attack our systems for the past 48 hours," and that "a side effect is everything is getting hardened," according to The Hacker News.

A provider key is a bearer credential. Deleting the key from Console does not revoke it, and a Console budget cannot cap that use either, because Console only sees requests that pass through its own gateway. For a key that was saved in a Console workspace, The Hacker News lists these steps from OpenCode's email and the providers' own guidance:

  1. Revoke the key in the provider's own dashboard and create a new one, following the instructions from OpenAI, Anthropic, or Google.
  2. Update every application and script that used the old key.
  3. Review usage and billing at the provider for requests you did not make, going back at least to October 16. OpenCode has not said when the unauthorized access began.
  4. Set a spend limit or alert at the provider and give each tool its own key, so a copied key does less damage and its use is easier to trace.

Legacy Infrastructure Exposure

OpenCode allows developers to connect external AI services by providing their own API keys for model providers such as Anthropic, OpenAI, and Google. According to disclosures sent to affected users, threat actors gained access to an older server environment slated for retirement where workspace configurations and linked credentials remained accessible.

The company stated that the breach was restricted to a subset of users with external provider integrations active on OpenCode Console. Accounts without linked third-party keys were unaffected.

Model Distillation Attack Flow

Automated Distillation and API Depletion

Exposed API keys were quickly repurposed to run high-throughput queries against upstream model endpoints. Model distillation involves systematically querying frontier models to generate synthetic dataset outputs for training downstream or localized models.

Multiple developers reported sudden surges in unauthorized consumption before notifications were delivered. Documented unauthorized usage included:

  • A Reddit user reported about $400 in unauthorized charges on an Anthropic account, according to Notebookcheck.
  • Preston Zeller put his total losses at $1,700, according to Dealroom.
  • Another user reported about €200 in Google usage charges and said their project was suspended for excessive abuse, according to Notebookcheck.

In addition to billing spikes, secondary disruption occurred across OpenCode authentication systems. Several users experienced expired session tokens and failures with social login providers during key revocation efforts.

Remediation and Risk Mitigation

OpenCode advised all impacted Console users to immediately revoke and rotate their API keys across Anthropic, OpenAI, and Google developer dashboards. The company confirmed it is coordinating directly with the affected AI providers to trace unauthorized traffic patterns and mitigate further impact.

The incident underscores the operational risk of storing unsegmented third-party API keys within hosted developer platforms. As distillation defenses increase across direct API endpoints, third-party tooling platforms holding persistent user credentials present high-value vectors for automated extraction.

OpenCode is not the only developer platform to report this kind of exposure. Fireworks AI says API keys and tokens stored as secrets were captured in some customer accounts during its October incident; see our report on the Fireworks AI breach update.

Update, November 11, 2026: Railway's November 10 incident report names OpenCode among the platforms that "disclosed similar thefts" between October 6 and October 23. Railway says AI keys stolen in its own October incident ran up an estimated $740,000 in unauthorized spend.

Sources

Frequently asked questions

Which OpenCode services were affected by the breach?

The breach affected only the optional hosted 'OpenCode Console' service, which stores saved workspace configurations and linked credentials. The core open-source command-line and desktop apps were unaffected because they keep provider keys locally in a SQLite database rather than transmitting them to the company.

What type of attack was executed using the stolen API keys?

Attackers repurposed the exposed keys to run high-throughput queries against upstream model endpoints to execute automated model distillation attacks. This process systematically queries frontier models to generate synthetic dataset outputs for training downstream or localized models, leading to rapid API depletion and unexpected billing charges.

How should users remediate their compromised API keys?

Users must immediately revoke the old keys and create new ones via the dashboard of each affected provider (OpenAI, Anthropic, or Google). They must also update all applications and scripts that used the old key, review usage and billing for unauthorized requests dating back to October 16, and set spend limits or alerts at the provider level.

Who has reported similar security incidents involving AI API keys?

OpenCode is not the only platform facing this issue; Fireworks AI reported capturing API keys and tokens as secrets in some customer accounts in October, and Railway disclosed that AI keys stolen in its October incident resulted in an estimated $740,000 in unauthorized spend.

SecurityToolingOpenCode