The AI-Augmented Engineer
The AI-Augmented Engineer

The AI-Augmented Engineer

Keeping environment variables safe with Claude Code deny lists

You shouldn't have your LLM reading your app secrets

Jeff Morhous
Mar 18, 2026
∙ Paid

Security is a serious concern when using AI tools in your codebase. If you’ve gone though the (minor) hassle of extracting secret values into file like .env, it’s a bit silly to stream them to some intelligence API.

Claude Code permissions documentation
Claude Code permissions documentation

It’s well-understood that it’s a best practice to add your .env file (or equivalent) to .gitignore so it doesn’t get tracked in version history. It should become a best practice to deny AI tools the ability to read tokens from these files too.

I’ll show you how - the process only takes a minute or two.

How to stop Claude from reading .env

User's avatar

Continue reading this post for free, courtesy of Jeff Morhous.

Or purchase a paid subscription.
© 2026 Jeff Morhous · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture