A popular open-source coding assistant just gave small business owners a preview of a cost that rarely makes it into AI adoption spreadsheets: what happens when someone else gets your API key.
OpenCode, an open-source AI coding agent that has gained a following as a free alternative to commercial tools like Cursor and Claude Code, had part of its online platform breached by hackers. The attackers got their hands on API keys belonging to some users — the credentials that connect OpenCode to paid AI services like Anthropic's Claude or OpenAI's models. With those keys, the hackers were able to run up usage charges on accounts that didn't belong to them.
The twist is what happened next. When the attackers tried to use the stolen keys to process certain malicious code through the connected AI models, the models themselves declined to engage. Built-in safety filters on the underlying AI systems reportedly blocked some of the requests, limiting what the hackers could actually accomplish even after they had valid credentials in hand.
OpenCode is built and maintained as an open-source project, meaning its code is publicly visible and shaped by outside contributors — a structure that lowers the barrier to adoption but also widens the number of people who touch sensitive parts of the system, including how credentials are stored and transmitted. The company has not detailed exactly how the breach occurred, but the outcome — stolen keys, billed usage, no immediate fix in sight for affected users — is a familiar shape for anyone who has followed software supply chain incidents over the past few years.
API key theft is not new, but it's becoming a more frequent feature of AI tool breaches specifically because so many of these tools are thin wrappers around expensive, usage-billed AI models. A stolen key for a typical SaaS app might expose data. A stolen key for an AI coding tool can directly generate a bill, sometimes a large one, because the attacker is spending someone else's prepaid or pay-as-you-go AI credits.
This fits a pattern seen elsewhere in the AI tooling boom: fast-growing, developer-favorite tools — many open source, many built by small teams racing to ship features — have repeatedly shipped with looser security practices than the commercial products they're displacing. Past incidents involving leaked tokens in code repositories, misconfigured logging, and third-party plugin breaches have followed a similar arc: quiet compromise, delayed disclosure, then a scramble by users to rotate credentials.
For small businesses, the practical risk isn't abstract. If anyone on your team uses OpenCode, or any AI coding tool that stores API keys to connect to a paid model, those keys are effectively a line of credit tied to your account. A breach means someone else can spend against it, and most AI billing platforms don't flag unusual usage the way a credit card company flags a suspicious purchase.
The fix is not complicated, but it requires action rather than assumption. Rotate any API keys connected to OpenCode or similar tools now, set hard spending caps on your Anthropic or OpenAI accounts if you haven't already, and check usage logs for charges you don't recognize. Where possible, use scoped keys with lower spending limits for experimental or dev tools rather than your primary billing credentials.
Watch for whether OpenCode publishes a detailed post-mortem explaining how the breach happened and what changed in response — that disclosure, or the lack of it, will tell you a lot about whether to keep using the tool. Also worth tracking: whether Anthropic and OpenAI respond by making spending caps and anomaly alerts a default setting rather than something users have to dig for in account settings.
The bottom line: if your business connects any tool to a metered AI API, treat that connection like a credit line, not a password — set limits, check statements, and rotate keys on a schedule, not just after a breach makes headlines.