# Where .env Went Wrong: Why a Shortcut Became a Broken Architecture

> Hacker News story 49124291 · language: en · submitted 2026-07-31
> Web version: https://zeli.app/story/49124291
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 38 · by [domenkozar](<https://news.ycombinator.com/user?id=domenkozar>) · 💬 20
[original](<https://secretspec.dev/blog/where-env-went-wrong/>) · [HN discussion](<https://news.ycombinator.com/item?id=49124291>)

## Summary

The .env file started as a simple shortcut but evolved into a fragile architecture for managing secrets and configuration. It fails to define requirements, lacks a formal specification, and creates security risks by mixing sensitive data with ordinary settings. I argue for separating durable declarations from protected storage and explicit delivery to fix these fundamental flaws.

## Key quote

> Environment variables do one job well: deliver strings to a process. .env turned that delivery mechanism into a source of truth. A convenience became architecture. That is where .env went wrong.

## HN discussion (20 comments)

### [eigencoder](<https://news.ycombinator.com/item?id=49126813>)

> Hm, I haven't seen these issues personally. We only have one `.env` file and it's just for local secrets. Configuration emphatically does not go in `.env` and ideally is in docker compose and defined in code (we use Pydantic Settings).

### [c-hendricks](<https://news.ycombinator.com/item?id=49125460>)

> Also mise: https://mise.jdx.dev/environments/

### [qntty](<https://news.ycombinator.com/item?id=49125248>)

> I use Pydantic Settings for this, would be nice to see a comparison to that. I do like the idea of keeping this in a configuration file.

---

## Cite

- Page: https://zeli.app/story/49124291
- Date: 2026-07-31
- Source: secretspec.dev (https://secretspec.dev/blog/where-env-went-wrong/)
- Hacker News: https://news.ycombinator.com/item?id=49124291

## Other languages

- zh: https://zeli.app/zh/story/49124291 · markdown: https://zeli.app/zh/story/49124291.md
- ja: https://zeli.app/ja/story/49124291 · markdown: https://zeli.app/ja/story/49124291.md
- ko: https://zeli.app/ko/story/49124291 · markdown: https://zeli.app/ko/story/49124291.md
- de: https://zeli.app/de/story/49124291 · markdown: https://zeli.app/de/story/49124291.md
- es: https://zeli.app/es/story/49124291 · markdown: https://zeli.app/es/story/49124291.md
