Google API Keys Weren't Secrets. But then Gemini Changed the Rules.
Summary
Google's Gemini API and Google Maps API share the same API key infrastructure, leading to a critical security vulnerability. Historically, Google Maps API keys were designed for public embedding in web pages and were considered harmless. However, enabling the Gemini API on a project automatically grants these same public keys access to sensitive Gemini endpoints, which can access private files and incur billing charges. This constitutes a privilege escalation, as developers are not warned when their previously public API keys gain secret credential capabilities. Truffle Security identified 2,863 such vulnerable API keys in the November 2025 Common Crawl, including some belonging to Google, with one key active since February 2023, predating Gemini's API.
Key takeaway
For security teams and developers managing Google Cloud projects, you must immediately audit your existing Google API keys. Verify that no publicly exposed keys, especially those used for Google Maps or similar services, have inadvertently gained access to sensitive Gemini API endpoints. This change in key privilege, occurring without explicit warning, necessitates proactive revocation of any affected keys to prevent unauthorized data access and unexpected billing.
Key insights
Shared API key infrastructure between public and private services creates critical privilege escalation risks.
Principles
- API keys should follow least privilege.
- Privilege changes require explicit notification.
In practice
- Audit existing Google API keys.
- Verify Gemini API access for public keys.
Topics
- API Security
- Privilege Escalation
- Google Gemini
- API Keys
- Common Crawl
Best for: CTO, VP of Engineering/Data, Director of AI/ML, AI Security Engineer, Security Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Simon Willison's Weblog.