When an API Key Becomes a Corporate Credit Card: Who Controls Enterprise AI Access and Spending?
On October 17, 2026, OpenCode disclosed a security breach related to what it described as a large-scale model distillation attack, affecting approximately 1.4% of OpenCode Console users. The company said the affected users had external model providers linked to their accounts. Publicly shared notifications suggest that model API credentials may have been exposed, potentially through a legacy system being retired. Some developers also reported unusual usage and charges. The full attack path, scope of credential exposure, and whether the credentials were actually used for model distillation remain unclear.
What interests me is not simply another credential exposure. OpenCode is not itself a foundation model provider, yet its Console allowed customers to connect external providers, including OpenAI, Anthropic, and Google. As developers increasingly rely on coding agents, IDEs, CLIs, and other AI tools, enterprise model access is spreading across more third-party systems.
An AI API key is more than a technical credential. It can also represent spending authority. In that sense, it resembles a corporate credit card: whoever holds it may be able to consume services and generate charges against the company’s account.
Why Aren’t Existing Security Tools Enough?
Enterprises already have extensive security tooling. IAM manages identities and permissions. Secrets managers protect credentials and support rotation. DLP, CASB, and endpoint security help identify sensitive data movement. AI gateways can centralize model access, while third-party risk management programs assess vendor security.
The challenge is that these controls often operate within different boundaries.
Consider a developer who enters a corporate API key into a third-party coding agent. IAM may identify the account that owns the credential, but not every external service where it has been copied. A secrets manager protects keys under enterprise management without controlling copies stored by vendors. DLP may detect some credential transfers, but not necessarily those involving personal devices, local development tools, or backend services. An AI gateway governs requests routed through it, but not traffic that bypasses it.
An annual vendor assessment may provide assurance about how a service protects credentials without revealing whether valid keys remain in an old system scheduled for retirement.
When an incident occurs, these gaps become operational. The model provider may detect unusual consumption, the tool vendor may discover compromised credential storage, and the enterprise must determine which keys were affected, what depends on them, and whether revocation will disrupt production.
The goal is to connect credential custody, model usage, spending, and revocation across organizations that do not share the same security perimeter.
Three Lessons From the Payments Industry
The payments industry has spent decades addressing a similar challenge: allowing customers to transact across many merchants without exposing their entire account whenever one merchant suffers a security incident.
Three lessons are particularly relevant to AI.
First, minimize the distribution of broadly reusable credentials. Payment tokenization, including mechanisms used by Apple Pay, reduces reliance on exposing original card numbers and can restrict tokens to particular devices or transaction contexts. AI gateways already offer a comparable architectural benefit by letting applications use gateway credentials while model-provider keys remain managed upstream. Broader support for credentials bound to specific tools, workloads, or contexts could further limit how stolen credentials are reused.
Second, detect and respond to suspicious consumption quickly. Card issuers monitor transaction patterns and can challenge or restrict unusual activity. Model providers can observe abnormal API usage, while a third-party tool may be the first to discover a breach. The challenge is getting those signals to the right parties quickly enough to investigate and restrict misuse without unnecessarily interrupting legitimate services.
Third, establish clear responsibility for unauthorized charges. The payments industry has developed dispute processes, fraud investigations, and contractual liability arrangements. AI services also operate under customer agreements, but incidents involving third-party custody of model credentials raise practical questions. Who provides the evidence? How are unauthorized calls identified? How are disputed charges handled? And which party bears the loss?
The useful lesson is not that AI needs to recreate a payment network. It is that technical restrictions, incident response, and commercial accountability must work together.
The harder problem is not managing an API key inside the enterprise. It is managing what happens after that key crosses an organizational boundary. A company can enforce its own identity policies, but it cannot fully control how a third-party tool stores its credentials, how a model provider attributes usage, or how quickly the parties coordinate when something goes wrong. This is why adding more security tools does not necessarily close the gap. What enterprises need is a way to connect access, consumption, and accountability across organizations, using existing controls where possible and establishing clearer responsibilities where those controls end.
An AI Access-to-Spend Control Loop
I think of this as an AI Access-to-Spend Control Loop: connecting where model access is granted, how that access is limited, what it consumes, and how it is revoked and reconciled when something goes wrong.
This is a reference architecture built around existing security capabilities, not a proposal for another standalone security product. I would organize it into five connected functions.
1. Discover: Identify where AI access enters the enterprise.
Enterprise browsers, SSE/CASB platforms, endpoint DLP, and developer-focused secret scanning can identify portions of AI application usage and credential movement. The difficulty is coverage. Employees may use personal accounts, local development tools, or unmanaged devices outside those monitoring paths.
Netskope’s 2026 AI report found that 44% of observed enterprise AI users accessed personal AI applications: 30% used only personal applications, while another 14% used both personal and organization-managed applications. This does not mean they all exposed corporate API keys, but it illustrates why an inventory of approved enterprise applications is not a complete picture of AI usage.
2. Map and Authorize: Connect tools to their credentials and permissions.
Every approved third-party AI integration should have an identifiable owner, purpose, credential, permission scope, and known application dependencies. Where supported, enterprises can use separate, restricted, revocable credentials instead of distributing general-purpose provider keys.
IAM, secrets managers, and AI gateways already support much of this. But not every coding agent or external tool supports a custom gateway endpoint or delegated authorization. Some still require provider API keys, while developers may bypass approved routing for convenience.
Gateways also introduce custody and availability risks. A hosted gateway may keep upstream credentials away from downstream tools while becoming another third party that holds them. Deploying a gateway is therefore not enough; the enterprise must know which integrations actually use it and which credentials remain outside its control.
3. Meter: Connect model consumption to the responsible application.
Model providers and gateways expose usage and cost information, but that information becomes more useful when it can be associated with an application, project, workload, or owner.
If several applications share an API key, or a vendor makes calls on behalf of multiple customers, a billing record may not identify the original business activity. Dedicated credentials, project separation, consistent metadata, and gateway logging can reduce this ambiguity.
Cost controls also differ. Some provider budgets only trigger notifications, while gateways such as Cloudflare AI Gateway already offer enforced spending limits for supported requests. Visibility into consumption does not necessarily mean an enterprise can stop it, particularly when some traffic bypasses the control point.
4. Respond: Revoke compromised access without unnecessarily disrupting business.
When a vendor reports an incident, the enterprise needs to identify affected credentials, restrict or revoke access, issue replacements, and verify recovery.
This becomes difficult when the same credential is used by multiple applications, scripts, or CI/CD pipelines. Immediate revocation may stop an attacker while also interrupting legitimate workloads. Application ownership and dependency mapping are therefore essential to a workable response.
GitGuardian’s 2026 State of Secrets Sprawl report found that 64% of the valid secrets it tracked from public exposures in 2022 remained active in early 2026. The finding illustrates the gap between detecting an exposed credential and completing remediation.
Revocation must also be connected to application retirement, employee departures, and the end of vendor relationships. A retired system should not leave usable credentials behind.
5. Reconcile: Resolve costs, evidence, and accountability.
Security, procurement, legal, and finance teams need to work with model providers and third-party tools to examine abnormal usage, preserve evidence, evaluate disputed charges, and determine contractual responsibilities.
Vendor assessments should therefore consider more than access to sensitive information. A tool with little customer data access may still hold a production model credential capable of generating substantial costs.
Existing credential-exposure notification programs demonstrate that cooperation between different parties is possible. What is less established is a broadly adopted process connecting third-party AI incidents, provider usage evidence, timely restrictions, and commercial dispute resolution.
An enterprise can build much of its internal control loop today. It cannot independently create the external cooperation mechanisms that its providers do not support.
The Security Metric Finance Should Understand
If an API key can function like a corporate credit card, counting keys is not enough. Enterprises should also understand how much unauthorized consumption those credentials could generate.
I would call this Unauthorized AI Spend Exposure: an estimate of potential unauthorized model consumption based on credential privileges, achievable request throughput, enforceable spending limits, and the expected time needed to detect and revoke compromised access.
It is not the sum of every key’s budget. Multiple keys may share quotas, some budgets do not block usage, and the true maximum may depend on assumptions about attacker behavior and response time.
In its 2024 research on LLMjacking, Sysdig documented attackers abusing stolen cloud credentials to access AI model services. Under a specific worst-case scenario involving model pricing and regional quota limits, researchers estimated potential consumption exceeding $46,000 per day. That was a modeled exposure, not a confirmed daily loss or a universal estimate for compromised API keys.
For management reporting, I would focus on three measures: the coverage of third-party model credential inventories, the time from confirmed risk to verified revocation, and estimated unauthorized AI spending exposure. They show whether an enterprise understands where its access resides, can contain an incident, and has a reasonable estimate of the potential financial impact.
The Bigger Question: Who Validates the Entire Chain?
The OpenCode incident raises a question that goes beyond credential security. As AI tools increasingly operate across organizational boundaries, access, spending authority, and incident response are becoming shared responsibilities.
Enterprise assurance already offers a useful precedent. In SOC reporting, Complementary User Entity Controls (CUECs) and Complementary Subservice Organization Controls (CSOCs) recognize that effective control outcomes may depend on responsibilities carried out by customers and subservice organizations. But documenting those responsibilities does not necessarily demonstrate that the entire chain works during an incident.
Two important questions remain open. First, how effectively can enterprises connect existing controls into an end-to-end process that measurably reduces unauthorized AI consumption and recovery time? Second, how reliably can a model provider, third-party tool, and enterprise customer coordinate when evidence, access restrictions, billing, and liability cross organizational boundaries?
Perhaps AI security does not need an entirely new responsibility model. Perhaps it needs to make the existing one work across a new set of dependencies. If every organization can demonstrate that it has fulfilled its own security responsibilities, who is responsible for verifying that the entire chain of AI access, spending, and incident response actually works?
Based on publicly available information as of October 18, 2026. The OpenCode investigation remains ongoing. AI Access-to-Spend Control Loop is a proposed descriptive reference architecture, not an established industry standard. The views expressed are my own.

