Do not make cat a secret manager
cat .env should not be enough to reveal production keys, API tokens, or deploy credentials.
Dotenv protection for agent work
.env files are convenient because every local tool can read them. That is exactly why they are risky for agent runs. Automic Vault keeps the developer workflow, but removes the plaintext target.
Last updated: May 15, 2026
To stop AI agents reading .env files, remove secrets from project files and inject them at runtime into the specific tool that needs them. Automic Vault stores values locally and gives approved commands access without exposing raw credentials to the agent transcript.
The obvious target
Agents inspect files to understand projects. If secrets live beside source code, a normal debugging step can become credential exposure.
cat .env should not be enough to reveal production keys, API tokens, or deploy credentials.
Once a model sees the file, the values can spread into logs, tool calls, summaries, and patches.
A script usually needs one or two values. A dotenv file often exposes the full project environment.
Use approved injection so the tool still runs without leaving secrets in a project-readable file.
Migration path
Take sensitive values out of project dotenv files and shell startup files.
Store each value with av save KEY so it is not part of the repo or the agent context.
Launch scripts with av inject so only the approved process receives the keys it requested.
Related protections