Hackers hit AI coding tool OpenCode, running up charges on users’ AI accounts
OpenCode is an open-source AI coding agent that's become a popular alternative to Claude Code and Cursor. But hackers got into part of its online platform and stole some users’ API keys, and the AI tools it turned to for help kept refusing to look at the malicious code.

TL;DR
- Hackers breached OpenCode's online platform, affecting 1.4% of users by stealing API keys.
- The stolen API keys were used to rack up unauthorized charges on users' AI accounts with providers like OpenAI, Anthropic, and Google.
- OpenCode's attempts to use AI defensive agents were hindered when the models refused to analyze the malicious code due to safety filters.
- Anthropic and Google blocked exposed API keys, while OpenAI worked with OpenCode to restore access and refund customers.
- The exposed keys were limited to the OpenCode Console; the open-source app and command-line tool were unaffected.
- Similar issues have been reported by other AI platforms like Hugging Face, where AI models blocked analysis of intrusion attempts.
- This incident is part of a recent trend of AI-enabled cyberattacks, including attacks on South Korean banks and unauthorized access to Indian organizations' systems.