THE API KEY LOCKDOWN electrichead.ai/get/keys AI agents are out there hunting for API keys people left in public code, then using them to pay for their own work. If your key's exposed, it's your bill. Three moves shut that down. 1. KEEP KEYS OUT OF CODE AND REPOS [ ] Every key lives in a .env file or your host's secret settings. Never in the code. [ ] .env is in .gitignore before the first commit. [ ] Secret scanning and push protection are on in your git host's settings. [ ] You've searched the repo and its history for keys already there. .gitignore: .env .env.* !.env.example 2. CAP AND ALERT ON SPEND AT THE PROVIDER [ ] A hard monthly spend limit is set. A cap stops the damage; an alert only tells you. [ ] Budget alerts at 50% and 90%, sent somewhere you'll actually see. [ ] One key per app or project, so you can kill only the one that's burning. [ ] Each key has the smallest scope and model access the provider allows. 3. ROTATE ANYTHING THAT'S LEAKED, THEN CHECK USAGE LOGS [ ] Revoke the key at the provider. Deleting it from the repo isn't enough. [ ] Make a new key and keep it in .env or a secret store. [ ] Redeploy everything that used the old key. [ ] Check usage logs for calls you didn't make, and billing for spikes. [ ] Charges you didn't make? Contact the provider's support with the dates. Source: AWS Security Blog From Electric Head Productions. electrichead.ai