Skip to main content
Back to Blog
AI Security

The Key Was Never Seen. It Was Still Spent.

The OpenCode Console breach disclosed October 17, 2026 cost some users $1,700 overnight without a model being touched. In 2027, model API keys become the most-targeted non-human identity, and every model call has to be treated as a transaction with a limit, a rate and a purpose.

Mark Rogge6 min read
The Key Was Spent Overnight — EnforceAuth 2027 series, no. 03 of 18

ENFORCEAUTH 2027 — NO. 03 OF 18 — AI SPEND

By Mark Rogge, CEO of EnforceAuth | 6 min read | for platform and FinOps engineers who own the model bill

Some OpenCode Console users went to bed on October 16, 2026 and woke up to roughly $1,700 in provider charges. They had not run a job. Their key had.

OpenCode disclosed on October 17 that an intruder had been inside a legacy system the night before, and that stored OpenAI, Anthropic and Google provider API keys for about 1.4% of Console users "may have been exposed," per The Hacker News, with follow-up reporting from BleepingComputer on October 19 and TechCrunch the same day. Anthropic and Google blocked the affected keys. OpenAI refunded charges. The company described the activity as a distillation attack: stolen keys used to extract model output at volume, presumably to train something else.

No model was exploited. No prompt was injected. A credential that was authorized to call a model called a model. The only thing wrong was who held it and why.

A model key is a payment instrument

I want to make a plain argument that most security programs have not internalized. A model provider API key is closer to a corporate card than to a database password.

  • It converts directly to money, on a per-call basis, with no purchase order.
  • It converts to intellectual property: the output of a frontier model, at scale, is itself a product.
  • It is routinely stored in plaintext in developer tools, CI variables, and third-party consoles, which is where OpenCode kept it.
  • It is almost never scoped. One key, every model, every purpose, every hour of the day.

The LiteLLM compromise on October 21 reinforced the point. The "privcollect" payload went after system, browser, developer, cloud and AI secrets in the same sweep, per The Hacker News. AI keys were on the shopping list next to AWS credentials. Bitsight reported on October 16 that the MONST3R-AI underground pentest agent runs on its buyers' stolen AI API keys. The market for these keys already exists and the price is set by what they can spend.

Nobody would hand an intern an unlimited corporate card with no merchant category and no daily cap. Most engineering orgs hand that to every service account with a model key.

The 2027 forecast

By the end of 2027, I expect model provider API keys to be the most-targeted class of non-human credential in enterprise incident reports, ahead of cloud IAM keys. Two reasons. First, monetization is immediate and does not require a second pivot; the key is the payout. Second, the ratio: our design-partner environments run 82 non-human identities per human, and in AI-forward teams a growing share of those identities hold a model key. Okta expects the NHI ratio to flip in many enterprises before the end of 2027. More keys, more exposure, direct cash value.

I will also predict that at least one public company reports a material unplanned model-spend event in a 2027 filing. The OpenCode numbers were small per user. Multiply by an enterprise's monthly token budget and an attacker with a 24-hour window.

Treat the call as a transaction

The counter-argument is that providers already offer spend caps and key rotation. They do, and you should use them. But a provider-side cap is a single number per key, set at the provider, blind to which of your internal identities made the call and for what. It does not know that the summarization service is allowed $40 a day and the recruiting agent is not allowed to call the model at all after a hiring freeze. That context lives with you.

Here is the policy shape we use with design partners, in OPA and Rego, evaluated in path before the request reaches the provider:

  • Identity binding. Which workload identity is calling, authenticated through your IdP, not a shared key. The provider key becomes a downstream secret the identity never holds directly.
  • Purpose binding. The call declares a purpose (a workflow, a ticket, a job ID) and policy checks the identity is authorized for that purpose. A distillation run does not look like a support-ticket summarizer.
  • Transaction limits. Per-identity, per-purpose spend ceilings by hour and day, enforced as DENY, not as an alert sent to a channel nobody reads at 2am.
  • Rate and shape. Requests per minute and tokens per request per identity. The OpenCode distillation pattern, high volume and uniform shape, is a policy violation before it is a billing surprise.

What EnforceAuth ships for this today. Verdict, our authorization MCP server, and the Writ control plane let you put an OPA-based policy decision point in front of a provider endpoint and express the rules above as code. EvidenceIQ, part of the EnforceAuth platform, records every decision tied to the policy version, keeps the relationships between identity, purpose and resource, and lets you replay the night of October 16 as a sequence of authorized and denied calls, with retention from one to four years and export to Splunk, Datadog or S3. Our PDP latency goals (p50 under 2ms, p99 under 5ms) are design targets; the authorization check should not be the slow part of a model call, and we will publish measurements when we have them.

What we do not ship: a billing system, or a replacement for provider-side caps. Keep those. Add the layer that knows who is spending and why.

The key in the OpenCode incident was never seen by its owner during the attack. It was still spent. In 2027, make the spending itself require authorization.

EnforceAuth is the runtime authorization layer for AI agents, built on OPA and Rego. See enforceauth.com and read the EvidenceIQ announcement.

About EnforceAuth

EnforceAuth is the OPA/Rego authorization control plane. The customer's OPA decides what people, services, and AI agents may do at action time. Verdict covers high-impact agent actions. EvidenceIQ keeps the record behind every decision.

Follow us on LinkedIn