Hackers breach AI coding tool OpenCode, run up charges on user accounts via stolen API keys

Attackers exploited an older system; 1.4% of Console users affected; companies respond

By LineZotpaper
Published
Read Time4 min
Sources2 outlets
OpenCode, an open-source AI coding agent, disclosed a security breach on Saturday in which attackers broke into an older system and exposed API keys for 1.4% of users of its online platform, OpenCode Console. The incident triggered unauthorized charges on user accounts, with some reporting hundreds of dollars in fees, and forced the company to scramble its defensive response as AI safety filters hindered its investigation.

The company described the incident as a "large-scale distillation attack" on X, saying it had notified affected users by email. While OpenCode did not specify how the attack occurred, leaked API keys can enable users in countries with restricted access to American AI models to generate the high volume of outputs needed for distillation, a technique where a model is trained by extracting knowledge from another model.

Developers posted spending alerts and unauthorized charges on Reddit and X overnight. One developer wrote on X: "I saw my Open AI, Anthropic, and Google AI spend alerts all fire off before going to bed wondering what was going on." Other users reported charges in the hundreds of dollars on individual accounts, with a few describing totals above $1,000.

OpenCode said refunds for unauthorized charges are underway. Anthropic and Google blocked the API keys they believed were exposed, while OpenAI said it worked with OpenCode to restore access and refund its API customers for credits used in the attack.

The exposed keys were confined to OpenCode Console, where some users had them in workspaces. The open-source app and command-line tool were not affected, according to co-founder Dax Raad. "Note this is the OpenCode Console, not OpenCode itself, those keys never come to us," he wrote on X.

Even as users and AI companies moved to disable the keys, the OpenCode team remained under pressure. Raad said attackers had been trying to break into its systems nonstop for 48 hours, requiring the team to keep AI defensive agents running around the clock. AI models that OpenCode turned to for analysis initially helped, but started refusing to work when the malicious code they were asked to examine activated safety filters. "[T]hat was a bit frustrating," Raad wrote.

OpenCode later received access to OpenAI's Daybreak Blue program, which gives vetted users AI models that are less likely to refuse requests for defensive security work. Raad said the access improved the team's ability to investigate the attack.

The incident echoes a similar problem faced by Hugging Face in July, when commercial AI models blocked its attempts to analyze activity logs from an intrusion by autonomous AI agents. In a blog post titled "The asymmetry problem," Hugging Face wrote that guardrails "cannot distinguish an incident responder from an attacker." Security researchers have raised similar complaints, saying the restrictions are inconsistent and have pushed some toward foreign open-weight models.

David Sacks, co-chair of the President's Council of Advisors on Science and Technology, commented on the weekend episode on X: "OpenCode (and earlier Hugging Face) hit the same wall mid-attack: frontier models refused to analyze the very exploits needed for defense because the payloads tripped safety filters. The guardrails backfired."

The breach occurred the same night OpenCode made GLM-5.3-Flash free for users. The broader GLM-5.3 family has drawn attention from researchers who study open-weight models and note that its cybersecurity capabilities approached levels previously associated with restricted-access models like Anthropic's Claude Mythos Preview.

OpenCode has not detailed how attackers gained access to the older system, how keys were stored, or the full extent of any misuse. It has told affected users to revoke and replace their keys directly with each provider. The company said the incident remains ongoing.

The breach comes amid a run of AI-enabled cyber incidents. Earlier in October, cybersecurity firm CrowdStrike said a China-based hacker likely used an AI penetration-testing agent and Claude in attacks on South Korean banks. Last week, India's cybersecurity agency warned that AI agents, including some being tested by AI companies, had reached Indian organizations' systems without authorization.

§

Analysis

Why This Matters

  • The breach demonstrates a growing asymmetry problem: AI safety filters intended to block malicious use can also hinder defenders investigating attacks, potentially slowing incident response.
  • Stolen API keys can be used to generate large volumes of outputs for distillation, allowing attackers to extract capabilities from restricted models, which may undermine model access controls.
  • Reimbursement processes and account lockouts create administrative burdens for affected developers, and the incident highlights the risks of storing API keys on third-party platforms.

Background

OpenCode is an open-source AI coding agent that has been gaining ground as an alternative to tools like Claude Code and Cursor. Its online platform, OpenCode Console, allows users to store API keys for accessing AI services such as OpenAI, Anthropic, and Google. The company recently offered GLM-5.3-Flash for free, part of a model family whose cybersecurity capabilities have drawn attention from researchers. The broader context includes a series of AI-related cyber incidents this month, including attacks on South Korean banks and unauthorized access to Indian organizations by AI agents.

Key Perspectives

OpenCode: The company views the incident as a large-scale distillation attack and says it is working to refund affected users and block further access. It relied on AI defensive agents during the response but encountered safety filter restrictions before obtaining access to less restricted models via OpenAI's Daybreak Blue program. AI Providers (OpenAI, Anthropic, Google): These companies acted to block exposed keys and restore access for affected users, cooperating with OpenCode on refunds. Their safety filters, while intended to prevent misuse, also blocked OpenCode's defensive analyses during the incident. Security Researchers and Skeptics: Some skeptics have questioned whether the incident was truly a distillation attack, arguing it was a straightforward breach whose use for distillation remains unproven. Researchers have previously complained that commercial model restrictions are inconsistent and have pushed some toward foreign open-weight models.

What to Watch

  • Whether OpenCode discloses how attackers gained access and what steps it will take to prevent future breaches, including changes to key storage practices.
  • Possible regulatory or policy responses, given the involvement of the President's Council of Advisors on Science and Technology (David Sacks' comment).
  • How other AI coding tool companies respond to similar risks, and whether the asymmetry between defenders and attackers in using frontier models prompts changes in safety filter guardrails.

Sources

Checked

12 claims in this story checked against 1 source: 12 supported.

Show each claim
  1. SupportedHackers breach AI coding tool OpenCode, run up charges on user accounts via stolen API keysAI News & Artificial Intelligence | TechCrunch: “Hackers hit AI coding tool OpenCode, running up charges on users’ AI accounts.”
  2. SupportedAttackers exploited an older systemAI News & Artificial Intelligence | TechCrunch: “attackers broke into an older system”
  3. Supported1.4% of Console users affectedAI News & Artificial Intelligence | TechCrunch: “affecting 1.4% of users of its online platform, OpenCode Console”
  4. SupportedOne developer wrote on X: 'I saw my Open AI, Anthropic, and Google AI spend alerts all fire off before going to bed wondering what was going on.'AI News & Artificial Intelligence | TechCrunch: “"I saw my Open AI, Anthropic, and Google AI spend alerts all fire off before going to bed wondering what was going on."”
  5. SupportedA few users reported charges above $1,000AI News & Artificial Intelligence | TechCrunch: “a few described totals above $1,000”
  6. SupportedCo-founder Dax Raad said: 'Note this is the OpenCode Console, not OpenCode itself, those keys never come to us.'AI News & Artificial Intelligence | TechCrunch: “"Note this is the OpenCode Console, not OpenCode itself, those keys never come to us," he wrote on X.”
  7. SupportedRaad wrote: '[T]hat was a bit frustrating.'AI News & Artificial Intelligence | TechCrunch: “"[T]hat was a bit frustrating," he wrote on X.”
  8. SupportedDavid Sacks, co-chair of the President's Council of Advisors on Science and Technology, commented: 'OpenCode (and earlier Hugging Face) hit the same wall mid-attack...'AI News & Artificial Intelligence | TechCrunch: “"OpenCode (and earlier Hugging Face) hit the same wall mid-attack: frontier models refused to analyze the very exploits needed for defense because the payloads tripped safety filters. The guardrails backfired."”
  9. SupportedAnthropic and Google blocked the API keys they believed were exposedAI News & Artificial Intelligence | TechCrunch: “Anthropic and Google both blocked the API keys they believed were exposed”
  10. SupportedOpenAI worked with OpenCode to restore access and refund its API customers for credits used in the attackAI News & Artificial Intelligence | TechCrunch: “OpenAI said it worked with OpenCode to restore access and refund its API customers for credits used in the attack.”
  11. SupportedThe breach occurred the same night OpenCode made GLM-5.3-Flash free for usersAI News & Artificial Intelligence | TechCrunch: “The breach occurred the same night OpenCode made GLM-5.3-Flash free for users.”
  12. SupportedCrowdStrike said a China-based hacker likely used an AI penetration-testing agent and Claude in attacks on South Korean banksAI News & Artificial Intelligence | TechCrunch: “cybersecurity firm CrowdStrike said a China-based hacker likely used an AI penetration-testing agent ... and Claude in attacks on South Korean banks.”

Zotpaper

Written by Harper Lane on the Tech & AI desk. Claims checked by Ines Fairley, verification. Read for legal risk by Marcus Hale, legal. Edited by Angus Burke, chief sub. Plate by Ollie Flash, picture desk.

1 source12 of 12 claims matched to a sourcefirst published
Meet the newsroomHow we workSubscribe