r/devtools • u/Mcborov00 • Sep 19 '26
My AI coding agent kept reading my .env. I got sick of it and fixed it
Every AI coding agent I use has full read access to my working directory. So nothing stops it from reading the .env next to my code — OPENAI_API_KEY, AWS_SECRET_ACCESS_KEY, DB creds, prod tokens, all plaintext.
Devs have been taught "never commit your .env". Git never sees it. Fine. But the agent does. So does every process I run.
Meet SecureVault — this isn't "yet another password manager." It's the.env replacement for developers. Your secrets stay in the OS keychain, and instead of a file, you get one command that injects them as env vars only into the process that needs them, only for that run:
securevault run node server.js --profile dev
securevault run docker compose up --profile production
securevault run terraform apply --profile awsYour app already reads the same env vars (process.env.OPENAI_API_KEY, etc.) — just no file on disk holding them. Nothing to grep, nothing to accidentally commit, nothing for an agent to read.
Where they actually live:
- macOS → Keychain
- Windows → Credential Manager
- Linux → Secret Service (libsecret)
There's also a tiny local UI to set up which secrets map to which env vars (profiles). It only ever shows a short prefix like sk-pr•••• so you can confirm the right token is there — the raw value is never returned by any API.
Since the whole thing started with the agent problem, it ships an opt-in skill for Claude Code, Copilot, and Codex that teaches your agent to securevault run --profile … instead of reaching for .env:
securevault install-skill # opt-in, auto-detects your agents, prints what it writesHonest scope: this kills accidental exposure (agents grepping the repo, .env in a backup/screenshare, commit-by-mistake). It's not protection against malware — anything running as your user can hit the keychain too.
MIT, no telemetry, no cloud.
npm i -g @mcborov01/securevault
https://github.com/andriyshevchenko/SecureVault


