This month brought poisoned releases (LiteLLM, the OVHcloud CLI) and a hosting platform notice that environment variables may have been accessed. If you run coding agents on your laptop or servers, the keys sitting next to them (GitHub tokens, cloud credentials, server and SSH keys, AI provider keys) are what an attacker wants.
None of this needs new tools. It's a checklist you can work through tonight.
The checklist
-
Keep keys out of files your agent doesn't need. Dotfiles and
.envfiles in your project folders can be read by agents and end up in logs. If a key isn't needed for the task, it shouldn't be in reach. - Rotate keys stored in hosting platform env vars. Keep AI provider keys out of them where you can.
- Use short-lived or scoped keys where your provider offers them. One per agent or project, so one leak doesn't open everything.
- Put a spend limit on every AI key. A live key is spendable compute.
- Pin package versions and update on purpose. Docker images by digest, not by tag.
- After any dependency scare, clean or rebuild that machine first, then rotate every key it could reach, from a different device. Not just the one you think was exposed.
- Check your provider usage pages weekly. Look for usage you don't recognize.
One thing to do right now
Look in your dotfiles, .env files and shell history for keys you forgot were there. Do it yourself rather than asking your agent to, so the keys don't end up in its context or logs.
We keep a short set of rules for how secrets should live next to AI agents: https://clavitor.ai/en/rules
Top comments (0)