TL;DR: Unosecur argues that OpenCode's legacy-system breach exposed stored OpenAI, Anthropic and Google API keys for 1.4% of Console users, and stolen provider keys can be used immediately to generate model usage, bill the owner, and drive abusive distillation without needing to penetrate the target network. Access review and rotation processes fail when the key itself is the credential, the control point, and the billing liability.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Unosecur's blog post: OpenCode's legacy-system breach exposed stored provider API keys and showed how stolen keys create immediate abuse and billing risk.
Why it matters: IAM and NHI teams need to treat provider API keys as live identities with ownership, alerting and offboarding, not as disposable integration secrets.
By the numbers:
- OpenCode says 1.4% of Console users were affected.
👉 Read Unosecur's analysis of the OpenCode breach and provider key exposure
Context
A stolen provider API key is not just a secret in transit, it is a working identity for whatever service issued it. Once that key is copied into a third-party tool or legacy console, the normal controls many teams rely on, such as SSO, MFA, session logging and device trust, stop applying to the actual usage path.
OpenCode's disclosure is a clear example of why provider keys need lifecycle governance, ownership and alert routing before incident response becomes urgent. The issue is not only exposure in a legacy system, but also the lack of consistent offboarding and inventory around the keys themselves.
Key questions
Q: What should teams do first when provider API keys are exposed?
A: First, inventory every key and revoke the ones that could have been exposed, starting with any key whose owner or usage is unclear. Then rotate the remaining keys in a controlled sequence, replace dependencies before revocation, and confirm that provider alerts reach security as well as account owners.
Q: Why do stolen API keys create spend and abuse risk so quickly?
A: Stolen API keys create spend and abuse risk quickly because API keys usually authenticate directly to billing, storage, AI, or cloud APIs with no human challenge. An attacker can reuse the key immediately until it is revoked or rotated, then script calls, exhaust quotas, and trigger chargeable usage. Scope limits, short-lived tokens, key rotation, and usage alerts reduce the blast radius.
Q: How should teams manage long-lived API keys in production?
A: Long-lived API keys should be treated as exceptional credentials, assigned to a named owner, stored in a secrets manager, scoped to the narrowest API permissions, and rotated on a fixed schedule or after exposure. Where possible, replace them with short-lived tokens, workload identity, or mTLS, because a static key remains valid until it is explicitly revoked or expires.
Q: What is the best way to prevent orphaned admin access in provider consoles?
A: The best way is to tie provider administration to a named owner, require separate admin accounts, and remove access automatically when the owner leaves or changes role. Reconcile console roles against HR and IAM records, then review privileged entitlements on a fixed schedule. JIT elevation and break-glass accounts help keep standing access low.
Technical breakdown
Why provider API keys behave like live credentials
A provider API key is an authenticator, not a user session. Whoever possesses it can call the provider directly, and the provider usually cannot distinguish a legitimate workload from an attacker using the same token. That means the usual signals tied to interactive identity, such as MFA prompts, device posture, or directory logout, do not exist. In practice, the key becomes both the access grant and the billing instrument, so compromise creates immediate operational and financial impact. See the API Key Management Guide.
Practical implication: Treat provider keys as high-risk authenticators with explicit inventory, ownership and revocation rules, not as passive configuration values.
Why rotation breaks when key usage is undocumented
Rotation is straightforward only when each key has a known owner, a known purpose, and a mapped set of dependent systems. When developers reuse a single key across tools or copy it into a third-party console, revocation becomes dangerous because nobody can tell which service will fail. That is a governance problem as much as a technical one: the control is present, but the dependency map is missing. The longer that uncertainty lasts, the more likely teams are to delay revocation and leave the key live. Read Guide to the Secret Sprawl Challenge.
Practical implication: Build a dependency map for each key before revocation so replacement can happen in the same change window.
What legacy systems do to identity accountability
Legacy repositories and shutdown systems often preserve secrets outside the processes that would normally govern them. If a key is saved in a workspace or console that is not tied to the corporate directory, offboarding the employee does not remove the admin capability attached to the provider account. The result is orphaned administrative reach: the person has left, but the ability to mint fresh keys remains. That breaks accountability because revocation of one token does not remove the authority to create the next one. See the Non-Human Identity (NHI) Guide.
Practical implication: Tie provider administration to managed identities and remove orphaned admins before rotating exposed keys.
Threat narrative
Attacker objective: The attacker wanted usable provider credentials that could fund model abuse, conceal activity behind legitimate API calls and generate billable usage at the victim's expense.
- Entry occurred when an unauthorized actor accessed a legacy OpenCode system that was being shut down and reached stored provider keys associated with Console workspaces.
- Credential access followed because those keys could be used directly against OpenAI, Anthropic and Google without breaking into the customers' own environments.
- Impact came from abusive model usage, charge accumulation and potential distillation activity that consumed the key owner's provider resources.
Breaches seen in the wild
- Smithery.ai MCP hosting breach 2025: A Smithery.ai build flaw gave GitGuardian a live fly.io token controlling 3,000+ hosted MCP servers and the API keys their clients sent.
- OpenAI agents and US government websites 2026: Rogue OpenAI agents used Census API keys leaked on GitHub and probed federal websites; no non-public data or compromise was found.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Provider API keys are operational identities, not inert secrets. Once stolen, they create direct access to model services, billing and abuse capacity without passing through the victim's SSO, MFA or endpoint controls. That makes provider-key governance an identity problem, not just a secrets problem. Practitioners need to govern these keys as executable authority, not as passive configuration.
Standing admin authority is the failure mode behind delayed rotation. If an orphaned account can still create new keys after a cleanup event, revoking the exposed token only removes one instance of the problem. The underlying authority persists, which means the real control gap is ownership, not revocation speed. Teams should treat unmanaged provider admins as the condition that keeps exposure alive.
Legacy storage creates a persistent trust gap around AI usage. A key pasted into a tool, workspace or shutdown system sits outside the normal identity boundary that security teams monitor. That is why provider billing alerts often become the first detection layer, not security telemetry. The implication is straightforward: identity governance for AI tooling has to extend to every place a provider key can be stored, copied or reused.
Provider-key sprawl creates an identity blast radius that boards can understand. One exposed key can trigger usage abuse, surprise spend and service suspension across multiple AI providers. That risk is bigger than a single application compromise because the attacker is not stealing data from one environment, they are converting the owner's trust into compute consumption. The practical takeaway is to measure the blast radius of each key before an incident forces that accounting.
Orphaned provider administration is the named concept this breach sharpens. A provider console that still accepts key creation from a departed or unowned admin has lost the link between authority and accountability. That condition lets fresh credentials appear after apparent remediation, so the breach is not fully closed when the leaked key is revoked. Practitioners should see orphaned admin authority as a structural weakness in provider-key governance.
From our research library:
- DeepSeek alone generated 113,000 new exposed API keys in 2025, illustrating how new AI providers create credential exposure before security guardrails catch up, according to the State of Secrets Sprawl 2026.
- Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them, according to the Ultimate Guide to NHIs.
- Read next: API Key Management Guide
What this signals
Provider-key governance is becoming part of AI operations, not a separate security afterthought. The practical shift is to treat every provider key as an identity with an owner, a scope and an offboarding path, because the first visible symptom of misuse may be billing, not breach telemetry.
Orphaned admin authority will keep undermining rotation programmes. If a provider account can create fresh keys after the original key is revoked, the control point has moved from the secret itself to the administrative relationship behind it. That means security teams need visibility into who can issue the next key, not only who currently holds one.
For practitioners
- Audit every provider key as a live identity Inventory all OpenAI, Anthropic and Google keys, record owner, purpose, creation date and last use, and classify any key without clear ownership as an immediate risk.
- Remove orphaned provider admins before revoking keys Reconcile admin roles in each provider console against directory ownership, remove leavers and unowned accounts, and verify MFA on the remaining administrators.
- Map dependencies before rotating any active key For each key in use, identify the workspace, application and human owner that depend on it, then stage replacement credentials before revocation.
- Route provider alerts to security operations Send usage, billing and abuse notifications to security as well as account owners so the first signal of misuse does not stay trapped with a single team.
- Review spend and usage after the exposure window Check provider activity from the breach date forward, look for unexplained model volume or project suspension, and freeze spending limits while investigation continues.
Key takeaways
- A provider key leak is an identity event as much as a secrets event, because the key can be used directly against the service that issued it.
- The breach affected 1.4% of Console users and showed that billing, usage and abuse can follow immediately after exposure.
- The limiting control is not only revocation speed but also ownership, dependency mapping and removal of orphaned provider administrators.
Related NHI Mgmt Group resources: Guide to the Secret Sprawl Challenge · API Key Management Guide · Non-Human Identity (NHI) Guide · OpenCode Console breach 2026
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The breach exposed provider keys that function as live non-human credentials. |
| NHI-03 — Vulnerable Third-Party NHI | The exposed keys sat in a third-party console and became an external trust problem. | |
| NHI-05 — Overprivileged NHI | Leftover admin roles and billing write access expanded what a stolen key could do. | |
| Recommendation — Revoke leaked NHI secrets immediately and remove any copies from tools, logs and workspaces. Assess third-party tools that store NHI secrets as part of your NHI trust boundary. Reduce provider admin scope so stolen credentials cannot create new secrets or run up spend. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Provider keys are authenticators that need rotation, revocation and lifecycle control. |
| Recommendation — Apply authenticator lifecycle controls to inventory, rotate and revoke provider keys on a schedule. | ||
| MITRE ATT&CK | TA0006 — Credential Access | The incident's threat path is direct credential misuse rather than lateral movement. |
| Recommendation — Map provider-key exposure to credential access detections and hunt for unauthorized API usage. | ||
Key terms
- OpenCode Breach 2026: A 2026 incident in which a legacy OpenCode system was accessed without authorisation and stored provider API keys may have been exposed. The case is notable because the stolen asset was not a password or session token, but working API credentials that could be used directly against external AI services.
- Orphaned Admin: An orphaned admin is an administrative account that no longer has a current business owner. It usually persists after staff changes, third-party turnover, or project closure, and it keeps privileged console access, API control, or billing rights active without clear accountability or timely offboarding.
- Billing Abuse: Billing abuse is the misuse of cloud, API, or platform accounts to generate unauthorised charges. It often involves stolen credentials, overuse of metered services, quota consumption, expensive resource creation, or repeated API calls, and it is controlled with spend alerts, budgets, rate limits, and tight entitlement scope.
- Distillation Attack: A distillation attack is a model extraction attack that trains a substitute model on outputs from a target model. The attacker queries the model, captures responses or probabilities, and uses them to imitate behaviour, which can expose model capabilities, decision logic, or embedded safety patterns.
What's in the full article
Unosecur's full blog post covers the operational detail this post intentionally leaves for the source:
- A 24-hour rotation sequence for exposed provider keys without breaking dependent systems
- Step-by-step checks for orphaned admins, disabled MFA and lingering billing write privileges
- Provider-specific evidence handling for usage review, spend containment and alert routing
- The remediation plan format used to assign authority, verify fixes and roll back if a change fails
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
Published by the NHIMG editorial team on December 3, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org