← Reddit

Replacing .ENV files with a tokenized MCP approach

Reddit · SuccessFearless2102 · July 11, 2026
CertLocker, a DevOps control plane, addresses security risks associated with sharing .env files by allowing agents and contractors to access only specific secrets through scoped tokens and individual identities rather than distributing files with full credential access. Each secret is imported separately and managed with group and function-based scoping, with all requests logged and auditable, eliminating the need to rotate all client credentials when removing a single user's access.

Detailed Analysis

CertLocker's Reddit post highlights a practical security gap emerging from the rapid adoption of Claude and other AI agents in agency and DevOps workflows: the continued reliance on monolithic .env files as a credential-sharing mechanism. The post describes a common scenario where agencies running Claude-powered automation—reports, scripts, SOPs, campaign checks—distribute a single environment file containing AI provider keys, client advertising tokens, OAuth credentials, webhook secrets, and repository access to both human contractors and AI agents alike. The core problem is one of scope creep: anyone or anything holding that file inherits blanket access to every credential inside it, regardless of what task they were actually assigned. A contractor working exclusively on Client A's account may incidentally hold Client B's tokens; an agent tasked only with checking SOPs may be able to read webhook secrets it has no functional need for.

This matters because it exposes a structural mismatch between how AI agents are being deployed in production and the access-control models originally designed for human developers. Traditional .env-based secret management assumes a small, trusted circle of engineers with implicit accountability. As MCP (Model Context Protocol) agents proliferate—executing autonomous or semi-autonomous tasks across client environments, often orchestrated by Claude—the number of entities touching sensitive credentials multiplies, while the audit trail for who accessed what remains fragmented across tools, chat logs, and copy-paste workflows. The post notes the common failure mode: secrets get pasted into logs or chat windows, and when an incident occurs, reconstructing an access history becomes a forensic exercise across disconnected systems rather than a simple lookup.

CertLocker's proposed fix—decomposing the .env file into individually managed secrets, grouped by client or function, with each agent assigned its own identity and scoped token—reflects a broader shift toward applying zero-trust and least-privilege principles specifically to AI agent architectures rather than just human users. By routing secret requests through MCP with per-request authorization checks and logging, the model treats each Claude-driven agent as a distinct security principal rather than an extension of whoever configured it. This allows for granular revocation (removing one compromised or departing identity without rotating every credential shared via the old file) and creates the auditability that regulators and security teams increasingly demand as agentic AI takes on more operationally sensitive work. The open question the author raises—how to calibrate scope granularity so it's tight enough to prevent lateral credential exposure but not so restrictive that teams route around it by reverting to shared files—is a familiar tension in identity and access management, now recast for a world where "users" include autonomous AI processes.

This development sits within a larger industry trend: as Anthropic and others push MCP as a standard for connecting Claude to external tools, data sources, and credentials, a secondary ecosystem of infrastructure tooling is emerging to solve the security and governance problems that come with giving AI agents real-world execution capability. Secrets management, identity brokering, and audit logging for agentic systems are becoming their own subcategory of DevOps tooling, mirroring how cloud IAM and secrets vaults matured alongside earlier waves of automation and microservices. The offer of an on-premises deployment option also reflects enterprise wariness about entrusting third parties with the keys to client systems, particularly as agencies and companies scale AI-driven automation into environments handling multiple clients' sensitive data simultaneously.

Article image Read original article →