5 ms·
Considering the amount of repositories on public GitHub with hard-coded Gemini API tokens inside the shared source code (https://github.com/search?q=gemini+%22A
by embedding-shape 7mo ago
Considering the amount of repositories on public GitHub with hard-coded Gemini API tokens inside the shared source code (https://github.com/search?q=gemini+%22AIza%22&type=code https://github.com/search?q=gemini+%22AIza%22&type=code), this hardly comes as a surprise. Google also has historically treated API keys as non-secrets, except with the introduction of the keys for LLM inference, then users are supposed to treat those secretly, but I'm not sure everyone got that memo yet.
Considering that the author didn't share what website this is about, I'd wager they either leaked it accidentally themselves via their frontend, or they've shared their source code with credentials together with it.
- ckbkr10 7mo agotheres not a single real gemini api key in the results
- embedding-shape 7mo agoSetup a watcher and you'll come across live ones eventually :)
- dminik 7mo agoTry this one. Should remove most readme keys: Edit: self censor based on a request
- duskdozer 7mo agoOh, wow.
- ratsimihah 7mo agothis is such a wall of shame haha
- sillysaurusx 7mo agoI know you're well within your rights to post this, but would you consider replacing your comment with something like "It's easy to find working keys on github if you search the appropriate terms"? Think of it this way: although you're not to blame, HN drives a lot of traffic to your preconfigured github search. There are also bad actors who browse HN; I had a Firebase charge of $1k from someone who set up an automated script to hammer my endpoint as hard as possible, just to drive the price up. Point being, HN readers are motivated to exploit things like what you posted. It's true that the github search is a "wall of shame", and perhaps the users deserve to learn the hard way why it's a good idea to secure API keys. But there's also no benefit in doing that. The world before and after your comment will be exactly the same, except some random Gemini users are harmed. (It's very unlikely that Google or Github would see your comment and go "Oh, it's time we do something about this right now".) EDIT: I went through the search results and confirmed that the first several dozen keys don't work. They report as error code 403 "Your API key was reported as leaked. Please use another API key." or "Permission denied: Consumer 'api_key:xxx' has been suspended." So at least HN readers will need to work hard(er) to find a valid key. I wonder how you report a gemini API key as leaked... Searching "report gemini api key leaked" on Google only brings up similar horror stories (a $55k bill, waived https://www.reddit.com/r/googlecloud/comments/1noctxi/student_hit_with_a_5544478_google_cloud_bill/ https://www.reddit.com/r/googlecloud/comments/1noctxi/studen...) and (a $13k bill from 3d ago https://www.reddit.com/r/googlecloud/comments/1sjzat3/api_key_compromised_13428_fraudulent_charges/ https://www.reddit.com/r/googlecloud/comments/1sjzat3/api_ke...)
- dminik 7mo agoI'm not opposed to even removing the comment outright. That being said, GitHub does not even offer a time sorted search. Meaning that most of the results are going to be quite old and useless. Second, API keys being shared on GitHub is quite an old problem. People setup automated scans for this sort of stuff. Me removing my comment isn't going to help anyone who already posted their API key online.
- sillysaurusx 7mo agoI tried several dozen keys and they're all invalid, so I'm inclined to agree with you for this particular case. Thank you anyway for considering.
- weird-eye-issue 7mo agoThey have an automated process when keys get leaked on GH to get revoked automatically.
- imdsm 7mo agohttps://github.com/JustForSO/Sentra-Auto-Browser/blob/c048d333cb99ca735e0028840886dc26a6b5a081/README.md?plain=1#L172 https://github.com/JustForSO/Sentra-Auto-Browser/blob/c048d3...
- singpolyma3 7mo agoUm. What? In what world are API keys not secrets?
- deleted 7mo ago[deleted]
- embedding-shape 7mo agoIn the frontend world where you have client-side API keys talking directly to 3rd party services from the client. Think things like Google Maps and similar.
- londons_explore 7mo agoWhich is a stupid idea for something where there is billing involved... Anyone on the internet can take that key and scrape the Google maps API (faking the referer header) and cost you $$$$$. Google should have simply done with by origin URL if they wanted stuff to be open like that.
- someothherguyy 7mo agoOnce upon a time Google maps loads were nearly free, and there was no way to restrict that key.
- darrenf 7mo agoIn Firebase world API keys are for identification, not authorisation. https://firebase.google.com/docs/projects/api-keys https://firebase.google.com/docs/projects/api-keys Public by design: API keys for Firebase services only identify your Firebase project and app to those services. Authorization is handled through Google Cloud IAM permissions, Firebase Security Rules, and Firebase App Check.
- boredpudding 7mo agoGoogle API keys have been used for ages on the frontend. For example on Google Maps embeds. Those are not possible without exposing a key to the frontend. They weren't secret, until Gemini arrived. https://trufflesecurity.com/blog/google-api-keys-werent-secrets-but-then-gemini-changed-the-rules https://trufflesecurity.com/blog/google-api-keys-werent-secr... https://medium.com/@ahhyesic/your-google-maps-api-key-now-has-access-to-gemini-ai-and-you-were-never-told-c8800129757b https://medium.com/@ahhyesic/your-google-maps-api-key-now-ha... https://www.malwarebytes.com/blog/news/2026/02/public-google-api-keys-can-be-used-to-expose-gemini-ai-data https://www.malwarebytes.com/blog/news/2026/02/public-google...
- zozbot234 7mo ago> Google also has historically treated API keys as non-secrets, except with the introduction of the keys for LLM inference, then users are supposed to treat those secretly This was reported a long time ago, and was supposed to be fixed by Google via making sure that these legacy public keys would not be usable for Gemini or AI. https://news.ycombinator.com/item?id=47156925 https://news.ycombinator.com/item?id=47156925 https://ai.google.dev/gemini-api/docs/troubleshooting#googles_security_measures_for_leaked_keys https://ai.google.dev/gemini-api/docs/troubleshooting#google... "We are defaulting to blocking API keys that are leaked and used with the Gemini API, helping prevent abuse of cost and your application data." Why are we hearing about this again?
- PunchyHamster 7mo agothe topic is cost overruns. they still allow for cost overruns. What's so hard to comprehend ?
- addandsubtract 7mo agoFWIW, I just create a new Gemini API key today, and it had a different format than my old ones (created 10 days ago). So maybe they changed something?
- zozbot234 7mo agoA reply on OP's post states: "... We now generate Auth keys by default for new users (more secure key which didn’t exist when the Gemini API was originally created a few years ago) and will have more to share there soon. ..." So there is something new in that exact area but the details are forthcoming.
- spiznnx 7mo agoI think brand new stuff is probably safe, but old keys that currently being used for AI and non-AI stuff - if Google disables them for AI and it turns out it was actually not being exposed publicly, could disrupt a user's production service relying on AI. They messed up by allowing old keys to be used for both private and public APIs in the first place, but now it's difficult for them to undo that for existing keys.
- mdrzn 7mo ago...JCip3SJw => Your API key was reported as leaked. Please use another API key. ...afnt0t-E => Your API key was reported as leaked. Please use another API key. ...-UYzYTYU => Your API key was reported as leaked. Please use another API key. I think they all get immediately reported as leaked and invalidated.