
Today — June 19, 2026 — the Gemini API starts rejecting requests from unrestricted API keys. Not next week. Now. If you have any Google Cloud API key that accesses Gemini without explicit restrictions applied, your integration is broken. Here is what happened, and the three steps to fix it.
How Google Created This Problem
Google spent years telling developers that API keys were safe to embed in client-side code — just billing identifiers, not real credentials. That guidance made sense when those keys only accessed Maps or YouTube. Gemini changed the equation without a warning.
When a Google Cloud project enables the Generative Language API, every existing API key in that project automatically gains access to Gemini endpoints. No opt-in. No notification. Keys sitting harmlessly in public repos, frontend JavaScript, and mobile apps suddenly became credentials for a generative AI service that bills by the token.
Truffle Security scanned public repositories in November 2025 and found 2,863 live, verified Google API keys silently authenticating to Gemini. Exposed organizations included security vendors, major banks, and Google itself. One developer’s bill went from $180 per month to $82,314 in a single day after a key was stolen. Google initially classified Truffle’s report as “intended behaviour” before reclassifying it as a tier 1 vulnerability.
What Changed Today
As of June 19, the Gemini API enforces a three-tier policy:
- Unrestricted standard keys — rejected immediately. Any key without explicit API-level restrictions is now blocked.
- Restricted standard keys — still work, but only until September 2026, when all standard keys are cut off entirely.
- Auth keys — work with no changes required. All new keys created in AI Studio are automatically auth keys.
Auth keys are bound to a Google Cloud service account. They carry an identity — not just a billing reference — and are restricted to the Gemini API by default. That identity binding is precisely why Google trusts them, and why they are the mandatory format going forward.
Migrate in 3 Steps
Step 1: Find Your Affected Keys
Open Google AI Studio’s API Keys page. Check the Key Type column. Any key labeled “Unrestricted” is currently blocked or will be blocked before end of day. Also check Google Cloud Console under APIs & Services > Credentials for Standard-type keys tied to projects with Gemini enabled.
Step 2: Restrict Your Keys Immediately
For each unrestricted key, hover over the “Unrestricted” label and click Add restrictions. Select Restrict to Gemini API only and save. This takes about 30 seconds per key and restores service immediately. Restricted standard keys continue working until September 2026, buying you time to migrate properly.
Step 3: Replace with Auth Keys Before September
On the AI Studio API Keys page, click Create API key. New keys are automatically auth keys. Update your environment variables, CI/CD secrets, and hardcoded references. Test thoroughly, then revoke the old standard key. Auth keys carry identity — treat them like passwords, not config values. Rotation and vault storage are now table stakes, not best practices.
The Real Lesson
This is not an isolated incident. Anthropic launched Workload Identity Federation for the Claude Platform the same week — replacing long-lived API keys with short-lived, identity-scoped tokens. AI billing abuse is categorically different from traditional credential theft: one exposed key can generate thousands of dollars in charges within hours, not the slow data exfiltration that legacy security tooling is designed to catch.
Static API keys for AI services should now be treated as temporary credentials until you have proper vault storage, rotation, and least-privilege scoping in place. Google’s enforcement today is aggressive, but the underlying point is correct: the old model of “just an API key” does not hold when the service charges by the token and the blast radius of a single leaked credential can reach five figures overnight.
Check your keys. The immediate fix takes two minutes. The full Gemini API key migration needs to be done before September. Start now.













