OpenCode Console breach: rotate your LLM provider keys

What was reported about the OpenCode Console breach, how to rotate the keys it touched, and how to cap the damage when any tool that stores a key is breached.

Timothy Lindblom

Founder, Newly

Published Last updated

If you stored an OpenAI, Anthropic or Google API key in the OpenCode Console, create a new key, switch to it, revoke the old one at the provider, then read your usage for unexplained spend. BleepingComputer reports that 1.4% of Console users were affected. The same steps apply to any tool that holds a copy of your key, including the ones you built.

What was reported about the OpenCode Console breach?

OpenCode is a coding agent. Its Console is a hosted account area where users can store provider API keys. The facts below come from BleepingComputer's report, checked on 24 October 2026. We did not find an advisory on OpenCode's own website, so every row is press-reported and the project's statements are relayed through that report.

ItemWhat the report says
Earliest exposure17 October 2026, 00:30 UTC
DurationAt least 48 hours
Announced19 October 2026
Who was affected1.4% of Console users, per a project maintainer statement
What was exposedProvider API keys stored in the Console, including Anthropic, OpenAI and Google keys
Reported effectUser-reported charges from several hundred dollars to about $1,700 overnight; Google suspended some affected projects
Vendor responseWorking with the three providers; possible reimbursement mentioned in the notice to affected users
Not statedHow the keys were stored, how the attacker got in, and whether any key was used before 17 October

What this page does not claim

We cannot confirm from a primary source how the keys were stored, the cause, or the scale beyond the percentage above. If your account was affected, OpenCode's notice to you is the authority. The steps below do not depend on those details.

Why does a stored key matter to someone building an app?

An AI provider key is a bearer credential. Whoever holds the string can make requests that are billed to your account. It carries no username and no second factor, so a copy in the wrong place is the whole problem. OWASP's Mobile Top 10 lists hardcoded credentials as an easy access point for attackers and advises rotating API keys regularly.

App builders usually have more copies than they remember. Newly builds a real iPhone and Android app with React Native and Expo, and you can download the code or connect your own repository. Wherever you build, the key can end up in the places on the diagram.

Where a provider key can live: on your server, in a third-party tool, or inside the app, and what each copy exposesApp on thephoneYour server(copy 1)AI provider(the key works here)Third-party tool(copy 2)App bundle(copy 3)asksuses keyholds a copy for youreadable by any userEvery copy is one more place to rotate. Dashed boxes are the copies you do not control.

Copy 3 is the one you can fix at the source. Expo's docs say EXPO_PUBLIC_ variables are visible in plain text in your compiled application. Google's Gemini docs give the same advice for mobile apps: run a backend proxy instead of shipping the key.

The budget angle matters too. OWASP lists unbounded consumption among its LLM risks, with economic loss as one outcome. A leaked key with no cap is that risk in its simplest form.

How do I rotate my provider keys in an hour?

Order matters. Create the replacement first so your app keeps working, then revoke. OWASP's secrets management guidance lists the sequence as revocation, rotation, deletion from systems and logs, then logging for the incident record.

  1. List every key and every place it lives (the first self-test item).
  2. Create a new key at the provider, with the same restrictions.
  3. Put it in your server or secret store, not in the app or the repository.
  4. Redeploy, and confirm the app works with the new key.
  5. Revoke or delete the old key at the provider.
  6. Read usage and billing for the period the old key was live.
ProviderWhat its docs say to useWhat to look for in your account
OpenAIKeys in environment variables or a secret manager; set an expiration date on project keys and keep a regular rotation processThe Usage page, once tracking is enabled, for spend you did not cause
AnthropicKeys can be scoped to one workspace; each workspace can have its own spend and rate limitsThe Usage page by workspace. The Default Workspace cannot carry a spend limit, so use a named workspace
Google CloudApplication and API restrictions on every key; to rotate, create a new key with the same restrictions, update apps, then delete the old oneBilling and API usage logs for the project, and any project suspension notice

Google's Gemini guidance adds one detail: disable the old key only after the new one is verified, so you do not cause downtime. A usage page that looks ordinary proves little, because a stolen key can be used lightly. If you cannot account for a key's history, treat it as exposed.

If a key reached your repository, rotation does not erase it from history. Red's rotate secrets after a breach guide covers the wider list of credentials to replace, and the website incident response playbook covers what to record while you do it.

How do I limit the damage when a tool that stores keys is breached?

You cannot stop a third party from being breached. You can decide what a copy of your key is worth when it leaks. The table compares where the key lives with what a leak gives someone and the control that shrinks it.

Where the key livesWhat a leak givesControl that shrinks it
A third-party tool's accountFull use of the key until you revoke itUse a key made for that tool only, with its own spend limit; revoke it when you stop using the tool
The app bundleAnyone who installs the app can read itMove the call to a server; add per-user limits there
The repository or its historyEveryone with read access, now and laterTurn on secret scanning and push protection if you host on GitHub
Your server's environmentWhoever gets into the server or its deploy settingsSeparate keys per app and environment; a spend limit at the provider; an alert on unusual use

Two controls apply to all four rows. First, set a provider spend limit below what you could afford to lose; Anthropic's documentation describes a user-set limit below the tier cap. Second, split keys so one leak does not end every app you run.

If your app has an AI feature, remember who spends. AI inside a Newly app uses credits, and some features have limits. A key you supply for your own server carries its own bill, so limit calls per signed-in user on that server. The chatbot self-test and the 15-minute app check walk through both.

Finally, look at your own domain from outside. Bots probe for files such as /.env; Red's 30-second check for .env and .git requests shows what to look for. Back on the security hub you can find the rest of this series.

Where do you stand?

Every item starts as unknown. Move it to detected when you find the problem, and to confirmed only when you hold the evidence listed under it. A tool's own dashboard saying a key was deleted is not evidence; the provider's key list is.

Your provider-key check

  • Detected: You found the problem.
  • Unknown: Not checked yet, or the check could not tell.
  • Confirmed by owner evidence: You checked and kept the proof.
  1. 1. I have a list of every AI provider key I own and every place a copy of it lives.

    Evidence: the list: provider, key name, and each tool, repository, host and teammate that holds it.

  2. 2. Any key stored in a third-party tool has been replaced, and the old key is revoked at the provider.

    Evidence: the provider's key list showing the old key deleted or disabled, with the date.

  3. 3. I read the usage and billing pages for the period around the incident and found nothing I cannot explain.

    Evidence: screenshots of usage by day and by model, with the date range visible.

  4. 4. Each provider account has a spend limit and a billing alert.

    Evidence: the limit and alert settings pages, or the workspace or project they apply to.

  5. 5. Keys are split by app and environment, and restricted to the API they need.

    Evidence: the key list showing separate keys, with application and API restrictions where the provider offers them.

  6. 6. No provider key is in the app bundle, the repository history or a public .env file.

    Evidence: a search of the repository and the built bundle for the key prefix, and a 404 on /.env for your domain.

0 detected6 unknown0 confirmed by owner evidence

Your answers stay in this browser tab. Nothing is saved or sent.

Frequently asked questions

Do I need to rotate my keys if I never used OpenCode?

Not because of this incident. The reports concern keys stored in the OpenCode Console. The same reasoning applies to any tool that holds a copy of a provider key for you: if you cannot say who can read that copy, rotating is cheap and ends the question.

Is deleting the key from the tool enough?

No. Deleting a copy in one tool does not disable the key at the provider. Create a new key, switch your app or server to it, and revoke the old key in the provider's console. Revoking is the step that makes a leaked copy useless.

How do I know if my key was used by someone else?

Read the provider's usage and billing pages for spend you did not cause: new models, odd hours, a jump in volume. A quiet usage page proves little, because a stolen key can be used lightly. Treat a key you cannot account for as exposed and rotate it.

Can a spend limit replace rotation?

No. A spend limit caps the bill, so it limits the cost of a leak. It does not stop someone using the key until the cap is reached, and it does not remove their access to anything else the key can do. Use both.

Should the AI key be inside my mobile app?

No. Anything compiled into an Expo or React Native app can be read by whoever installs it, and Expo's docs say so for EXPO_PUBLIC_ variables. Keep the provider key on a server you control and let the app call that server after checking who is signed in.

Does the free scan tell me whether my key leaked?

It can report API keys and tokens it finds in the bundles your live site ships, and exposed .env files. It cannot see a key held inside a third-party tool's account. That part is yours to check with the provider.

Sources

All pages checked on 24 October 2026.

  1. OpenCode hack exposes API keys amid AI distillation attacks, BleepingComputer
  2. Production best practices, API key safety, OpenAI developer docs
  3. Rate limits and spend limits, Anthropic Claude docs
  4. Workspaces, Anthropic Claude docs
  5. API keys, Google Cloud docs
  6. Using Gemini API keys, Google AI for Developers
  7. Secrets Management Cheat Sheet, OWASP Cheat Sheet Series
  8. LLM10:2025 Unbounded Consumption, OWASP GenAI Security Project
  9. M1: Improper Credential Usage, OWASP Mobile Top 10
  10. Environment variables in Expo, Expo docs
  11. About secret scanning, GitHub docs
  12. About push protection, GitHub docs

Continue Learning