Ask HN: What do you do about API keys?
Having them in plaintext always seemed like a bad idea. Forget agents accidentally reading .env; any random package you get from the AUR can trivially read all your keys.
Ideally you'd have read permissions restricted to users/groups that need it, but since most software that needs it is under the user UID, I don't see how this would work.
8 comments
[ 0.21 ms ] story [ 3.2 ms ] threadAmerican models get nuts when you paste a key in the chat and tell you to rotate it as soon as possible. They'll often update agents.md and describe the key is in ...env file and how to load it for a script. It avoids putting the key in AI's request like the plague.
I often wonder if Chinese models instead just gulp it down and hunt for more. Anyone know?
- One thing that always scares me is that some third party code will just do a getenv AWS_ACCESS_KEY_ID in whatever language and send it out somewhere. So I tend to either invent non trivial environment variables names, and/or do unsetenv when the process starts, after it loads them to some internal config struct.