Exposed API Keys: What AI Hacking Tools Mean for the Secrets in Your App

Exposed API keys can now be found and used by attackers' AI tools within minutes, so a key that leaks today should be treated as stolen today. An API key is a password your app uses to talk to another service, such as your payment provider or an AI model. On November 5, Microsoft Threat Intelligence reported attackers using an AI agent framework called ARTEX to search public GitHub code for keys. In one case, an agent was pulling data out of a company's Azure Key Vault five minutes after it started scanning GitHub.
If your app was built with Lovable, Bolt, Replit or Cursor, look for exposed API keys in three places this week: your code, your chat history and what your site sends to the browser.
What changed with exposed API keys?
The search is automated now. Hunting through public code for passwords is an old technique, and Microsoft notes it used to be limited by how long people took to find and read repositories. Agent tools scan faster and take the next step themselves.
Microsoft saw this searching start in August 2026, with queries naming target companies alongside cloud and AI services. The agents took a particular interest in keys for AI services, which attackers can use to run their own AI work on your bill. A related Microsoft report on the same tool describes several attacks that reached privileged cloud access less than three hours after first targeting.
For an owner, the change is simple: plan for minutes between "a key leaked" and "someone used it", not days.
Where do exposed API keys come from in an AI-built app?
Mostly from three places, and only one is the code customers see.
- The code repository. Microsoft notes that developers sometimes store secrets in configuration files to get an app working quickly. An AI coding tool asked to "just make it connect" can do the same. If that repository is public, or becomes public later, the key goes with it.
- Chats, tickets and agent logs. On November 13, Cursor reported that coding-agent sessions it had shared with a vendor held credentials nobody had redacted, and that an attacker who reached that storage used them to get into Cursor's own tools. Some credentials users had sent to Cursor's support team were also exposed. Anything pasted into a chat or ticket is stored somewhere.
- The browser. Keys called from the page can be read by any visitor. We covered that check in vibe coding security.
How do you check for exposed API keys?
Start with a list, then search where keys hide.
- List every key. Open your hosting platform's environment variables or secrets screen. For each key, note the service and what it can reach.
- Search the full code history. Deleting a file doesn't remove it from version history, so ask your developer to run a secret scanner over every commit. Microsoft notes that GitHub already scans public repositories for secrets; private code needs your own check.
- Search where people talk. Look through Slack, email, tickets and AI chat history for the first few characters of each live key.
- Check usage. Open each provider's usage dashboard. A spike you can't explain means act now.
What should you do about exposed API keys?
Replace them, worst first, and don't stop at deleting the file. Microsoft is blunt here: exposed API keys stay usable until they're revoked, even after the original post or file is gone, because copies live on in version history and caches.
For each one:
- Create a new key with the provider.
- Put it in the app's secret store and redeploy.
- Revoke the old key.
- Check the provider's logs for use of the old key while it was exposed.
Start with payment keys, database admin keys and cloud accounts, then AI and email services. Cursor did the same after its incident: riskiest credentials first, then every credential in use as a precaution.
How do you stop the next leak?
Make the safe path the default, so exposed API keys become rare and cheap to fix.
- Keep keys in the platform's secret store. Never in code files, chats or tickets. Some builders now check this: Cursor's new app publishing, launched November 5, runs security checks for secrets written into app files before anything goes live. Read those warnings rather than clicking past them.
- Give each key the least access it needs. Use separate keys per app and for test and live, so one leak means one rotation.
- Set limits. Where a provider offers spending caps or expiry dates, use them.
- Revoke on exit. When a contractor or tool leaves, its keys go too.
Frequently asked questions
Is a key safe if the repository is private?
Safer, not safe. Private code gets shared with contractors and copied to laptops, and a repository can be made public by mistake. Treat a key in any code file as exposed.
If I delete the file, are the exposed API keys still a risk?
Yes. The key stays in version history and in any copy someone already made. Rotate it.
Can I paste an API key into ChatGPT or Claude to fix a bug?
Not a live one. Use a placeholder such as YOUR_KEY_HERE, or a test key with a low spending limit that you revoke afterward.
How often should we rotate keys?
Whenever someone with access leaves, and after any suspected leak. A fixed schedule, such as quarterly, works if it is someone's named job.
Make one person own the key list
Exposed API keys are an ownership problem as much as a technical one. Name one person who keeps the list and hears when someone leaves. If your app was built with an AI tool and nobody has done this, our free audit covers it, and Prototype to Production moves keys into proper secret storage while getting an app ready for real customers.
