Join our Newsletter — 33% off our NHI Course
Home› Guides› Storing Your AI Provider Keys in Third-Party AI…
Guide LLM & GenAI Security

Storing Your AI Provider Keys in Third-Party AI Platforms: Risk, Scoping, Spend Caps and Rotation

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 18 November 2026 13 min read
On this page

When you paste an OpenAI, Anthropic or Google key into a coding console, hosting platform or inference service, that platform becomes a second key vault you do not control, and October 2026 showed what happens when it is breached. This guide explains the risk of storing AI provider keys with third parties, how to decide whether to store a key at all, how to scope and cap the keys you do store, and how to rotate them fast when a platform reports trouble.

It is written for platform engineers, security engineers and the people who own AI spend. It builds on the patterns in our Model Aggregator and LLM Router Key Security guide, which covers routers and gateways specifically. Here the focus is the wider set of developer platforms, consoles and job runners that ask you to "bring your own key".

Key takeaways

  • A platform that stores customer AI keys holds keys for many providers and many customers at once. That makes it a far more valuable target than any single customer.
  • In October 2026 attackers went looking for exactly these secrets. Wiz describes them as "explicitly hunting stored environment variables, with a focus on those granting AI access" across more than a dozen AI developer platforms.
  • Deleting a key from the platform does not kill it. As Fireworks told its customers, "Removing a stored secret alone does not invalidate the underlying credential." Only the issuing provider can revoke it.
  • Every stored key should be dedicated to one platform, scoped to the least access it needs, held in its own project or workspace, and capped on spend.
  • Keep a written record of which key lives where, so that when a platform posts a breach notice you can revoke and replace within the hour rather than over days.

Why stored provider keys are a concentrated risk

A provider API key is a bearer credential. Whoever holds it can call the model, run up charges and, depending on scope, read files, assistants, batches or fine-tuned models attached to the account. When you store that key with a third party, the key now exists in at least two places: your own systems and the platform's storage. The platform, in turn, holds the same kind of key for thousands of other customers.

That concentration changes the attacker's arithmetic. Breaking into one customer yields one key. Breaking into the platform's secret store, its job runners or a legacy system that still holds old records yields every key at once, across every provider the platform supports. Because AI usage is billed on demand, stolen keys are immediately monetisable through resale, proxying or plain consumption, which is the pattern our LLMjacking Guide describes. MITRE ATT&CK tracks this outcome as T1496.004 Cloud Service Hijacking.

There is also a visibility gap. You can see usage on the provider side, but you usually cannot see how the platform stores the key, who inside the platform can read it, or which internal credentials unlock that store. Your exposure depends on controls you cannot audit.

What the 2026 platform breaches showed

Three incidents from October 2026 illustrate different routes to the same outcome. Each one is analysed on its own breach page; the summaries here are only what matters for key storage decisions.

OpenCode Console

OpenCode said an intruder reached a legacy system and exposed stored provider keys for a small share of Console users with linked OpenAI, Anthropic or Google keys. Users reported unauthorised charges, and providers blocked keys they believed were exposed. The lesson is that old systems still holding customer secrets are part of the attack surface long after a product moves on. See the OpenCode Console breach analysis.

Northflank

Northflank told customers to assume all environment variables had been decrypted and to rotate every secret, and several users confirmed their AI keys had been used without authorisation. The entry point had not been disclosed at the time of writing. The lesson is that "encrypted at rest" on a platform does not protect you if the attacker reaches the layer that decrypts. See the Northflank breach analysis.

Fireworks AI

Fireworks reported that an unauthorised party used internal Fireworks credentials to access environment variables used in evaluation jobs for a limited number of customer accounts, and believes API keys and tokens stored as secrets were captured. Fireworks revoked internal credentials, affected keys and keys it believed the actor created, and asked customers to rotate third-party credentials with the issuing providers and check for unrecognised keys, users, evaluators, jobs or datasets (Fireworks security bulletin). The lesson is that a platform's own staff and service credentials are a path to every customer secret it holds. See the Fireworks AI breach analysis.

The wider campaign

Wiz lists incidents at platforms including Fireworks AI, Zeabur, Lightning AI, OpenCode, Railway, Warp and Northflank in a single month, and notes that "Fireworks, Zeabur, and Lightning all attribute their incident root causes to credential access" (Wiz). Wiz also says it has seen downstream abuse of enterprise credentials traced to one of these vendor breaches. Whether or not one actor is behind them all, the target is the same: secrets that customers placed in a platform's keeping. Our AI API key abuse guide groups the recurring patterns.

Deciding whether to store a key at all

The safest stored key is the one you never stored. Before you paste a key into any platform, work through these questions.

  1. Does the platform need a long-lived key? Some platforms can call your own gateway instead of the provider directly. If you run an internal AI gateway, give the platform a gateway credential that you can revoke and cap centrally, rather than a raw provider key.
  2. Can the platform use its own provider account? Many platforms resell model access. Paying through the platform shifts the key risk to the platform's own account and limits your exposure to your platform bill, which you can usually cap.
  3. Is this a trial or a production dependency? Trials are where keys are most often pasted in and forgotten. Use a throwaway project with a very small cap, and delete it when the trial ends.
  4. What else will the platform hold? Hosting and job platforms often hold cloud, database and source control secrets next to the AI key. If the AI key is exposed, assume the neighbours are too, and plan scope accordingly.
  5. What does the platform say about secret storage? Ask how secrets are encrypted, who can decrypt them, whether they are exposed to job runtimes as plain environment variables, and how quickly the platform will notify you of an incident. Put the answers in your supplier record. Our guide to Contractual vs Technical Controls for Third-Party AI explains which of these can be enforced in contract and which need technical controls.

Scoping the keys you do store

If the answer is that you must store a provider key, make it as useless as possible to anyone except the intended platform doing the intended task.

One key per platform, per purpose

Never reuse a key you also use elsewhere. A dedicated key means you can revoke it without breaking other systems, and usage on that key tells you exactly what the platform did with it. Name the key after the platform and the use, for example a name that identifies the platform, the team and the environment, so the next responder knows what it is without asking.

Separate projects or workspaces

Providers let you group keys into projects or workspaces with their own limits and access. Put each third-party key in its own project or workspace. That isolates files, fine-tuned models, assistants and data from the rest of your account, and gives you a natural blast-radius boundary.

Restrict permissions where the provider allows it

OpenAI, for example, supports three permission levels on secret keys: "All", "Restricted" and "Read Only". With Restricted, you can set None, Read or Write for each endpoint (OpenAI Help Center). A coding assistant that only needs model responses does not need access to files, fine-tuning or assistants, so remove them. Check the equivalent controls with each provider; our OpenAI API Keys Security Guide, Anthropic API Keys Security Guide and Google API Keys Security Guide cover each one.

Limit models and features

Where you can restrict which models a project may call, allow only the models the platform genuinely uses. Expensive frontier models are the first thing an attacker will call with a stolen key.

Mapping to control frameworks

These steps are a direct application of least privilege (NIST SP 800-53 AC-6) and authenticator management (IA-5). If your assessors ask how third-party AI keys are governed, point to the per-platform key record and the scope applied to each key.

Spend caps, rate limits and usage alerts

Scope limits what a key can reach; caps limit how much damage it can do once stolen. In the OpenCode incident, users reported charges in the hundreds of dollars and more before keys were blocked. A tight cap turns that into a nuisance.

  • Set a monthly budget per project or workspace sized to expected use plus a modest margin, not the account default.
  • Set alerts well below the cap, at around 50 and 80 per cent of budget, routed to a channel someone watches. This is an NHI Mgmt Group recommendation, not a provider default.
  • Watch for usage outside normal hours or regions, sudden model changes and spikes in token volume. These are the earliest signals of abuse.
  • Use rate limits where the provider offers per-project limits, so that even a valid key cannot be used for bulk extraction or resale.

Our How to set spend limits on LLM API keys guide walks through the settings provider by provider.

Keeping a stored-key register

When a platform posts a breach notice, the first question is "which of our keys did we give them?" If you cannot answer it in minutes, response will be slow and incomplete. Keep a simple register with one row per stored key.

FieldWhat to record
PlatformThe third-party service holding the key, and the account or organisation on it
Provider and projectThe issuing provider, project or workspace, and key name or identifier
ScopePermissions, allowed models and any restrictions applied
CapBudget, alert thresholds and rate limits
OwnerThe named person or team who can revoke and replace the key
Created and last rotatedDates, so stale keys stand out
Neighbouring secretsOther credentials held on the same platform, which would need rotation in the same incident

Store the register with your secrets inventory, not in a spreadsheet nobody reviews. Our Secrets Management Guide covers inventory practice more broadly.

Rotation and response when a platform reports trouble

Treat any credible platform incident notice, including one that says you "may" be affected, as a reason to rotate. The cost of rotating a scoped, documented key is small; the cost of waiting is open-ended.

  1. Revoke at the provider first. Delete or disable the key in the provider's console. Deleting it on the platform is not enough, as Fireworks' own guidance to customers makes clear.
  2. Issue a new, scoped key in the same dedicated project, and only re-add it to the platform once the platform confirms containment. Until then, pause the integration.
  3. Rotate the neighbours. Use the register to rotate every other secret you stored on the same platform. Northflank's advice to rotate every secret reflects how these incidents usually unfold.
  4. Review usage on the old key. Pull usage for the exposure window from the provider, looking for unfamiliar models, regions, volumes or times. Record charges for any refund claim.
  5. Check what the key could reach. If the key had file, assistant or fine-tuning access, review those objects for unexpected reads or changes.
  6. Check the platform account itself. Look for unrecognised users, keys, jobs or datasets on the platform, as Fireworks asked its customers to do.

For the full response sequence, use our AI model provider API keys leak response guide and the general API Key Leak Response Playbook.

Routine rotation

Outside incidents, rotate stored third-party keys on a fixed schedule and whenever the platform account owner changes. A 90-day cycle is a reasonable default for stored AI keys; shorten it for keys with broad scope. Remove keys from platforms you no longer use. A forgotten key on an abandoned trial account is exactly what a breach of a legacy system exposes.

Common failure patterns

  • Reusing a production key on a third-party platform, so revoking it in an incident breaks your own applications and teams hesitate to act.
  • Deleting the key on the platform and assuming the job is done. The key remains valid at the provider until it is revoked there.
  • Full-permission keys by default, giving a coding tool access to files, fine-tuned models and assistants it never needed.
  • No spend cap on the project, so abuse runs until the monthly invoice arrives.
  • No register, so the response team spends the first day working out which platforms hold which keys.
  • Personal keys on team platforms, created by an individual on their own account, invisible to the security team and orphaned when that person leaves.
  • Trusting "encrypted at rest" without asking who and what can decrypt, and whether secrets are exposed in plain text to job runtimes.

Practitioner checklist

  • Inventory every third-party AI platform that holds a provider key, including trials and personal accounts.
  • Replace any reused key with a dedicated key per platform and purpose.
  • Move each third-party key into its own provider project or workspace.
  • Restrict permissions and models to the minimum the platform needs.
  • Set a budget, alert thresholds and rate limits on each project.
  • Record each key in a stored-key register with an owner and neighbouring secrets.
  • Prefer a gateway credential or the platform's own provider account over a raw provider key where possible.
  • Write a short runbook: revoke at provider, replace, rotate neighbours, review usage, check the platform account.
  • Rotate stored keys every 90 days and remove keys from platforms you no longer use.
  • Subscribe to each platform's status page and security bulletins so notices reach the key owners.

Standards and references

Related NHI Mgmt Group resources: Model Aggregator and LLM Router Key Security · LLMjacking Guide · AI model provider API keys · Secrets Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.