
A security breach at OpenCode has potentially exposed API keys belonging to developers using services from OpenAI, Anthropic, and Google.
The incident affected 1.4% of users of OpenCode Console, the platform’s hosted service, after an unauthorised party gained access to an older system containing credentials saved by users. The exposed credentials could allow unauthorised parties to access users’ AI accounts and generate API requests that may result in unexpected charges.
OpenCode disclosed the incident on October 17, saying it had notified affected users by email and was working with the three AI companies to address the breach.
The company described the incident as part of a large-scale AI model distillation attack, although it has not published technical evidence explaining how the attackers gained access or established the full extent of the activity.
What Happened During the OpenCode Breach?
OpenCode is an open-source AI coding agent that helps developers write, understand, and fix software using natural-language instructions. It is available through a command-line interface, desktop application, and code editor integrations.
The breach specifically involved OpenCode Console, an optional hosted service that allows developers and teams to connect external AI providers to their workspaces. Users can save their API keys for services such as OpenAI, Anthropic, and Google AI so that team members can access different models through the platform.
According to an email sent to affected users, OpenCode discovered unauthorised access to an older system that it was preparing to decommission. The company warned that third-party API keys saved in Console workspaces may have been exposed.
OpenCode co-founder Dax Raad also clarified that the incident affected Console rather than the standalone OpenCode application. But API keys stored locally in the command-line and desktop applications were not part of the reported breach.
Developers Report Unexpected API Charges
Following the incident, several developers reported unauthorised activity on their AI accounts, with some receiving unexpected spending notifications from multiple providers.
According to TechCrunch, some affected developers experienced charges worth hundreds of dollars, while a few reported losses exceeding $1,000. One developer reportedly faced more than $1,700 in unauthorised API charges.
Some users also reported that Google suspended their Cloud projects after detecting suspicious activity associated with the exposed credentials.
API keys function as access credentials that allow applications to communicate with external services. If someone obtains a working key, they may be able to make requests using the account owner’s allocated API access and potentially generate charges without the owner’s knowledge.
Anthropic and Google reportedly blocked keys they believed had been exposed, while OpenAI worked with OpenCode to restore access and address unauthorised usage. OpenCode also said it was working towards reimbursing affected users.
However, OpenCode has not disclosed how many individual API keys were accessed or confirmed the full extent of their misuse.
OpenCode Links the Incident to an AI Distillation Attack
OpenCode described the breach as being connected to a large-scale AI model distillation attack.
Model distillation is a technique used to train smaller AI models using outputs generated by more advanced models. Developers can use the process to create systems that reproduce some of the capabilities of larger models while requiring fewer computing resources.
However, unauthorised access to commercial AI models can allow attackers to generate large volumes of responses for training purposes without the providers’ permission.
OpenCode co-founder Dax Raad said attackers had been targeting the company’s systems for at least 48 hours using AI agents. He also described difficulties investigating the incident because some AI models began refusing requests when their safety protections were triggered during the analysis of malicious code.
The company subsequently received access to OpenAI’s Daybreak Blue programme, which provides approved users with AI models for defensive cybersecurity work.
Although OpenCode attributed the incident to distillation activity, it has not publicly explained how the attackers entered its older system or provided technical evidence establishing the full purpose of the stolen credentials.
What Affected Users Should Do
OpenCode advised affected users to revoke and replace their exposed API keys directly through their respective providers. This is reportedly important because deleting a key from an OpenCode workspace does not necessarily invalidate a copy that an unauthorised person may already have obtained.
Users should also review their API usage and billing records for unfamiliar activity and check whether any connected projects have been suspended.
The incident highlights the security risks associated with storing third-party credentials on hosted platforms, particularly when those credentials provide access to services that charge users based on consumption.
While OpenCode has not disclosed the full technical findings of its investigation, it confirmed that it was working with OpenAI, Anthropic, and Google to address the incident.
