OpenCode, an open-source AI coding agent, disclosed a security breach that exposed API keys for 1.4% of users on its online platform, OpenCode Console. The incident, which occurred overnight, resulted in unauthorized charges on users' AI accounts as attackers leveraged the exposed credentials.
What Happened
The OpenCode team identified the breach on Saturday, noting that attackers infiltrated an older system to access digital passwords used to connect with AI services. The company described the event as a "large-scale distillation attack," a term often associated with generating high volumes of outputs to train or refine models, though the specific mechanics of the attack were not detailed. Affected users reported seeing spending alerts from major providers like OpenAI, Anthropic, and Google, with some accounts incurring charges in the hundreds of dollars and a few exceeding $1,000.
Co-founder Dax Raad clarified that the breach was confined to the OpenCode Console, where some users stored keys in workspaces, and that the open-source app and command-line tool were not affected. Raad stated on X that the keys for the local tool never come to the company. In response, Anthropic and Google blocked the exposed API keys, while OpenAI worked with OpenCode to restore access and refund customers for credits used during the attack. OpenCode has notified affected users via email and is processing refunds for unauthorized charges.
Why It Matters
The incident highlights a growing friction in AI security: the difficulty of using commercial AI models for defensive cybersecurity tasks. Raad reported that attackers attempted to break into systems continuously for 48 hours, forcing the OpenCode team to rely on AI defensive agents. However, these agents struggled to analyze malicious code because safety filters in commercial models refused to process the inputs, interpreting them as potential threats rather than data for analysis. Raad described this situation as a bit frustrating. The team eventually gained access to OpenAI’s Daybreak Blue program, which provides vetted users with models less likely to refuse defensive security requests, improving their investigation capabilities.
This is not the first time such restrictions have hindered incident response. In July, Hugging Face reported that commercial AI models blocked its attempts to analyze logs from an intrusion by autonomous AI agents. David Sacks, co-chair of the President’s Council of Advisors on Science and Technology, commented on the pattern, stating that frontier models refused to analyze the very exploits needed for defense because the payloads tripped safety filters. Security researchers have increasingly turned to foreign open-weight models to bypass these inconsistencies, a trend that may accelerate as AI-driven cyberattacks become more common.
The Bottom Line
OpenCode’s breach underscores the dual nature of AI in cybersecurity: while models can be exploited to run up costs and perform distillation attacks, their built-in safety guardrails can simultaneously impede the rapid response needed to mitigate such breaches. With the incident still ongoing, users are advised to revoke and replace their keys directly with AI providers. The event adds to a recent string of AI-enabled cyber incidents, including reports from CrowdStrike and India’s cybersecurity agency regarding unauthorized AI agent access.