Replacing Shared .env With Scoped Tokens

SuccessFearless2102 · reddit · 2026-07-11

The author introduces a secret management approach for **MCP agents**: splitting shared `.env` files into individual secrets, grouped by client or function, with each agent receiving its own identity and scoped token. Agents can only request individually authorized keys via MCP; the system approves or denies requests and logs audit trails. If a contractor or agent needs removal, revoking their identity is sufficient, avoiding a full reset of client credentials. The author notes ongoing deliberation over scope granularity: too broad loses isolation, while too narrow might push teams back to sharing `.env` files.

Related event: Scoped Tokens Replace Shared .env for MCP Agents(2 posts)→

Original post →

More from coding & agent

coding & agent channel →