If your team prototyped on Gemini with a key from Google AI Studio, that key is probably still live, probably copied to more places than anyone remembers, and probably has no spending limit. A leaked key can turn an account that normally costs about $180 a month into a bill in the tens of thousands, and the customer pays. Google Cloud now publishes a step-by-step plan for removing raw keys. Its first two steps take about five minutes, and the guide frames the full checklist as 20 minutes.

What happened

Google Cloud published a practitioner guide on its blog on 20 November 2026 on moving teams off AI Studio API keys. It describes the key as a bearer token: whoever holds it can use it, it does not expire on its own and it is not tied to a person, machine or workload. Google’s worked example is a key landing in a public repo, a Slack channel or a mobile app bundle, where automated scrapers find it within minutes.

The fix has five steps. Developers sign in once with Application Default Credentials, which stores a short-lived credential locally. The app runs under its own service account. Calling models needs only the roles/aiplatform.user role, which the guide says to grant to a Google group for people and directly to the service account for the app. Remaining third-party keys, such as Stripe or Slack, move into Secret Manager. Finally, teams delete every AI Studio key.

The guide also covers a spend cap budget, currently in Preview, that pauses new requests to a service once estimated spend in a project passes a set amount. Google says the same login works for Claude and open models such as gpt-oss through Model Garden, with every call on one Google Cloud bill.

Why it matters

The pattern reaches beyond Google. AI prototypes start with the fastest credential available, and that credential tends to survive into production. Identity-based access limits the damage of a leak. The guide says an escaped token is short-lived, usually about an hour, and carries only the permissions of one service account. That token is narrow only if the account holds a narrow role, such as roles/aiplatform.user alone, rather than Editor or Owner. Even so, it is a different risk class from a permanent key.

The single bill also makes it easier to compare models on cost and quality, according to Google. This suggests the platform may become the center of a team’s AI spending, so teams with multicloud plans should weigh that convenience against their own strategy.

The spend cap is the most notable control, because standard budget alerts only send email while costs keep rising. Google states the limits plainly: caps cover one project and one service, rely on estimated cost, are not instant and still bill any overage. Treat it as a brake, not a guarantee.

What it means for you

Start with discovery. Google’s companion repo includes a scanner that flags key-shaped strings and literal api_key values without printing them, and it can fail a CI job. Run it across every repo, then check chat history and mobile builds by hand.

  • Separate environments. Keep developers in a dev project and the app in a prod project, so a mistake in one cannot spend the other’s budget.
  • Grant to groups. Offboarding becomes a membership change instead of a hunt for keys.
  • Audit broad roles. List service accounts holding Owner or Editor before each launch and replace them with narrow roles.
  • Block new keys. If you have an organization, enforce the Org Policies that deny creation of API keys and service account keys.
  • Set caps below your pain point. Choose a number under what you can afford to lose, and lower Agent Platform quotas so a runaway agent hits a ceiling.

Do not skip the last step: a key you no longer use stays live until deleted. If you buy or compare AI services on price, our AI Tool Radar tracks current pricing, and more infrastructure coverage sits on our cloud topic page.

What to watch

  • Whether spend cap budgets leave Preview and extend beyond the four eligible services: Agent Platform, the Gemini API, Cloud Run and Cloud Run functions.
  • Whether OpenAI’s GPT-6 models, in private preview for select enterprise customers in Model Garden since 21 October, open up more widely with the same login.
  • How quickly teams can enforce the Org Policies that block new keys without breaking existing prototypes.

Sources