Blog / Automation

The OpenCode breach: treat AI keys like a card on file

Hackers used stolen AI keys to run up overnight bills. What the OpenCode breach means for a small team, and four checks to make this week.

The OpenCode breach: treat AI keys like a card on file (cover)

Two weeks ago, some users of an AI tool woke up to bills for work they never ordered. If your team has connected an AI account to any outside tool, the same weakness may apply to you, and the checks that reduce the risk are simple.

What happened

OpenCode is an AI coding tool. Its online platform, OpenCode Console, lets users save the keys that connect it to AI providers such as OpenAI, Anthropic and Google. On 17 October, the company said attackers had got into an older system it was retiring. It said 1.4% of Console users were affected, and that those users had been emailed.

According to TechCrunch and BleepingComputer, some users then reported charges of several hundred dollars, and a few reported more than $1,000. BleepingComputer's highest reported figure was $1,700 overnight. These are user reports, not confirmed totals. OpenCode said refunds were underway. Anthropic and Google blocked keys they believed were exposed, and OpenAI said it was refunding API customers for credits used in the attack.

OpenCode has not said how the attackers got in or how the keys were stored. So we can't tell you exactly what went wrong inside the company.

You probably don't use OpenCode. That is not the point. The useful part of this story is how the bill happened.

An API key is a card on file

An API key is a long password that lets software use your AI account. Every request made with that key is charged to you. A stolen key can be used just as your own automation would use it.

So think of it as a company card saved in someone else's system. When that system is breached, the thief doesn't need to get into your email or your accounts. They spend, and the bill comes to you.

Small teams hand these keys over more often than they realise. Example: an owner signs up for a tool that drafts customer replies. It asks for an OpenAI key. A freelancer adds the same key to a spreadsheet script. Six months later, an agency uses it for a one-off chatbot. Now one key sits in three places, and nobody has a list.

One key per tool, so you can cut one off

If one key is used everywhere, a breach at one supplier means replacing it everywhere, usually in a hurry. You also can't see which tool caused the spending.

Give each tool its own key, with a name that says what it's for, such as "reply-drafts" or "invoice-script". If that supplier is breached, you cancel one key and everything else keeps running. Your usage records become easier to read too.

Set a limit and an alert

Developers in this story reported getting spending alerts overnight. An alert is useful, but it doesn't stop anything while you're asleep.

Look in your provider's billing settings for two separate things: a notification at a set amount, and a limit that actually stops the spending. Check which one you have, because they aren't the same, and the options differ between providers. Set the figure just above your normal month. Example: if you usually spend $40, an alert at $50 and a stop at $80 would catch a problem without getting in the way of a busy week.

A stop has a cost. If you hit it, your automation stops working until someone raises it. For a task that customers rely on, make sure the alert goes to someone who will act on it, and decide in advance what happens when the task can't run.

Know who holds what

Keep a plain list: which tool, which key name, who set it up, who can cancel it. A shared spreadsheet is fine, as long as the keys themselves are not in it. The list records where the keys are, never what they are.

When someone leaves, or a supplier sends a breach notice, this list tells you exactly what to change and who can change it. OpenCode told affected users to revoke and replace their keys directly with each provider. That is simple if you know where each one is used.

Ask the same of anyone who builds for you, including us. Whose account does the key belong to? Where is it stored? Who can cancel it? A good supplier will answer in one message.

What to do Monday

  • Log in to each AI provider you pay for and read the list of active keys. Cancel any that nobody can explain.
  • Create a separate named key for each tool, then remove the shared one.
  • Set a spending alert and, where the provider offers one, a hard limit.
  • Start the list: tool, key name, owner, who can cancel it. No keys in the list.

If you'd like a second opinion on how your tools are connected, book a 30-minute call.

  • news, translated