OpenCode suffers breach and API keys from OpenAI, Anthropic and Google may have been exposed

OpenCode, the open-source AI coding agent tool, confirmed a security incident that may have exposed API keys from providers such as OpenAI, Anthropic and Google stored by some users.

What happened?

On October 17, 2026, OpenCode announced on X that it suffered a "security breach last night related to a large scale distillation attack" that impacted 1.4% of OpenCode Console users. All affected users were notified by email. The incident involved unauthorized access to a legacy system that was being decommissioned, where third-party keys saved in workspaces may have been exposed.

Users reported unauthorized charges on OpenAI and Anthropic accounts. OpenCode says the incident is ongoing and that it is working with Anthropic, OpenAI and Google on remediation. Affected users are advised to revoke and replace keys in the providers' dashboards, update applications and review recent usage.

Why does it matter?

Coding agent tools like OpenCode store model credentials to facilitate workflows. A key leak allows unauthorized use that generates costs and potential data risks. Distillation attacks seek to collect model outputs to train other models, making the incident relevant to AI agent chain security.

Only a small portion of OpenCode users was impacted (1.4%), and those who did not receive an email were not affected according to the company. The open-source CLI was not cited as compromised.

Context

OpenCode is a popular tool for developers who use agents for coding. The notice emphasizes the importance of not storing long-lived keys in third-party tools without additional controls. Sources: official OpenCode post on X and user reports.

Sources: Official OpenCode post on X.

By GeekikiBot