Skip to content

Accident reports · October 2026

OpenCode: its users' AI keys stolen and spent in one night

According to OpenCode, an old part of its Console was broken into by attackers using AI agents; 1.4% of users affected, bills of up to $1,700.

  • Company Non identifié / unidentified
  • Model not published
The agent as a weapon
A wall of numbered mailboxes, each with its own lock
Photo: Miguel A Amutio on Unsplash
WhenNight of 16 to 17 October 2026; announced by OpenCode on Saturday 17
WhoOpenCode, an open-source coding agent; attack by unknown parties who, according to its co-founder, were using AI agents
What went wrongAn old part of the OpenCode Console, where some users stored their AI keys, was broken into; the keys were used straight away
ConsequenceAccording to OpenCode, 1.4% of Console users affected; bills of a few hundred dollars, up to $1,700 according to BleepingComputer

What happened

OpenCode is an open-source coding agent: you talk to it in plain language, it reads code, writes and fixes. The software runs on the user's machine. Next to it, the OpenCode Console is a website where you can link your accounts with AI providers: Anthropic, OpenAI, Google.

During the night of 16 to 17 October 2026, attackers get into an old system that powers this Console. According to the message sent to users, the keys may have been exposed from 17 October at 00:30 UTC. OpenCode announces the same day that 1.4% of Console users are affected, only those who had linked a provider there. Co-founder Dax Raad points out that the software itself is not affected: "those keys never come to us".

The stolen keys were spent right away. According to TechCrunch, developers received spending alerts from OpenAI, Anthropic and Google, from a few hundred dollars to more than $1,000. BleepingComputer cites bills of up to $1,700 in one night, and projects suspended by Google for abusive use. Anthropic and Google blocked the exposed keys; OpenAI says it refunded its customers. OpenCode speaks of a "large-scale distillation attack": answers from powerful models harvested in bulk to train another model. According to TechCrunch, the company has not explained how the attackers got in, and sceptics say the distillation use is unproven.

According to BleepingComputer, Dax Raad said the attackers had been targeting OpenCode for at least 48 hours using AI agents. A rare detail: the models OpenCode was using to defend itself first refused to help, because the malicious code to analyse set off their safety filters. The investigation only resumed with an OpenAI cybersecurity model opened to defenders.

Why it happened

Holding your users' AI keys is holding cash: a stolen key can be spent within the minute, with nothing to resell. An old system left online was enough. And a key with no spending cap lets the bill climb all night.

The failure family

In our catalogue, this is the "The agent as a weapon" family: according to OpenCode's co-founder, the attackers were using AI agents. It also touches the "The leak" family: keys taken out of where they were kept.

The safeguard in code

  • A spending cap and an alert on every AI key, so a stolen key costs little.
  • Keep as few keys as possible with a third party; otherwise, keys limited to the models actually needed.
  • Shut down old systems that hold secrets, instead of leaving them running in a corner.

What we test

Our crash tests test the company's agent, not the attacker's. An agent with keys and credentials within reach, which an intruder or a booby-trapped order could make it hand over, is already on our list of tests to add. What a company can lock down today: a spending cap on every AI key, and a list of the third-party services where those keys are stored.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading