Build1 distinct publisher3 min readUpdated
A developer's argument that .env access is an architectural bug in agent workflows, and a small Go CLI that brokers credentials at the process and transport boundary instead.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
Follow any of these and your For You feed starts watching them — no settings page required.
A developer's argument that .env access is an architectural bug in agent workflows, and a small Go CLI that brokers credentials at the process and transport boundary instead.
A developer publishing on dev.to under the handle ikkun1222 argued this week that handing a coding agent your `.env` file is not a convenience trade-off but a design error, because the secret then lives inside the agent's context window, the same window that gets summarized and shipped to a third-party model endpoint [1][2]. The interesting part is not the warning, which is familiar, but the proposed fix: stop trying to instruct the agent and instead inject credentials below the level the agent can observe [12].
The framing is worth restating because it is the load-bearing claim. In conventional software the boundary was crisp: secrets sat in the process environment, code read them at runtime, and nothing read them back out [4]. An agent reads your source, your config and your environment, then transmits a summary of what it read to an external API, so the read path and the exfiltration path are the same path [4].
The author names three leak vectors: context exfiltration, where the agent includes a `.env` value in a later prompt; tool output echo, where a command prints an environment variable and the agent captures stdout into the conversation; and prompt injection, where a malicious instruction in a fetched page, a dependency or an artifact tells the agent to dump the environment or POST the file somewhere [5]. Two of the three do not require the model to want anything [15]. That is the argument against prompt-level mitigation, and the author puts it bluntly: "Please don't print the key" is not a security control [12].
On existing tooling, the post is fair rather than dismissive. Secret managers such as Vault, Doppler and Infisical protect the store but still need to hand the value to the agent, which puts it back in context; `.env` hiding tools such as enject and tene keep plaintext off disk but not out of stdout; credential proxies such as vaulty are described as promising but typically bound to their own vault [6].
The author's own implementation, a Go CLI called trustless with no external dependencies, has three layers [7]. `trustless run -- cmd` resolves secrets from an existing `pass` store, injects them as environment variables, then scans stdout and stderr afterwards and replaces the values, including base64 and URL-encoded variants [8]. `trustless proxy` does per-host header and query-parameter injection for services including EDINET, e-Stat, xAI and OpenRouter, with the agent pointed at `127.0.0.1:8080` [9]. `trustless serve` is a scanning reverse proxy in front of OpenAI-compatible endpoints, checking outbound requests against keyword, regex and entropy rules described as gitleaks-compatible and masking matches in flight [10]. There was no new vault because the author already used `pass`, so migration cost was zero, and Bitwarden is supported with OAuth token refresh for Google and Lark [11].
Read the layers against the vectors and the mapping is one to one, which is the tell that the threat model came first [16]. The caveats are the author's own: it is MIT-licensed, self-reported at 321 tests with race-detector-clean and cosign-signed releases, and presented as one implementation whose threat model matters more than the code [13]. A rules-based outbound scanner also only catches what its rules describe, which makes the DLP layer the weakest of the three by construction.
What to watch: whether agent runtimes start brokering credentials natively rather than reading them from the environment, whether credential proxies decouple from their vendors' vaults [6], and how much per-host configuration a proxy approach accumulates before teams abandon it [9].
Ranked by verification strength, evidence, and original report placement.
AI coding agents need API keys to call services, test integrations and run a stack, so developers give them .env files, export keys into the environment, or paste them into config files the agent can read.
The author argues this means secrets live inside the agent's context window, the same window where a prompt-injected instruction or an overly verbose debug log can leak them to an attacker or an untrusted model endpoint.
The author frames agents as the first software that reads source, config and secrets and then sends summaries of what it read to a third-party API; in traditional software secrets lived in the process environment, code read them at runtime, and nobody read them back out, whereas the agent both reads the environment and transmits what it knows.
Three named leak vectors: context exfiltration (agent reads .env and includes values in a later prompt to an external model, unauditable inside the model pipeline); tool output echo (a command prints an env var or config value and the agent captures stdout into the conversation); prompt injection (a malicious instruction in a fetched web page, dependency or artifact tells the agent to print all environment variables or send .env contents to a URL).
The author built a small CLI in Go with zero external dependencies, structured in three layers.
Layer one is subprocess injection with output sanitization: 'trustless run -- cmd' resolves secrets from the author's existing pass store and injects them as environment variables, and after the command runs stdout and stderr are scanned and secret values replaced, including base64 and URL-encoded variants, so the agent sees command output but not the keys.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Single self-published account; reasoning documented, effects unmeasured
Everything rests on one dev.to post written by the tool's author. The mechanism claims are internally coherent and specific (named vectors, named subcommands, named rule pipeline), which is why this is not floor-level. But the frequency claim is explicitly anecdotal ('you've probably seen'), the criticisms of Vault, Doppler, Infisical, vaulty, enject and tene are asserted without tests, and the tool's effectiveness figures are self-reported test counts rather than any evaluation of masked-versus-missed secrets. No independent source, incident report, benchmark or third-party review appears in the cluster.
No usage evidence beyond the author's own workflow
The only adoption-adjacent fact is that the code is public under MIT with signed releases; the post reports no external users, installs, stars, downloads, team deployments or production incidents avoided. The author describes running it against his own pass store and a handful of APIs he personally calls. Publishing a repository is not a measure of uptake, so no adoption value is assigned.
Sound framing, overstated certainty about the fix
The diagnostic half is arguably understated rather than hyped: context-window exposure and prompt-injected exfiltration are concrete, well-specified risks and the author hedges that the threat model matters more than his tool. The gap comes from the remedy: 'we know it didn't leak' and 'the agent gets capabilities, not credentials' are stated as guarantees, yet the mechanism is pattern-based masking (keyword, regex, entropy) plus stdout rewriting, which cannot cover transformed, split or paraphrased secrets, and no false-negative measurement is offered. Competing categories are dismissed without testing, and adoption is zero outside the author. Net: modestly overstated.
Author-promotes-own-tool, with an explicit hedge
The single source is written by the creator of trustless, links his repository, and reaches the conclusion that existing categories of competing tools are inadequate — a direct alignment between the argument and the author's interest in his own project. The dev.to format is self-publishing with no editorial gate. Partly offsetting: the tool is MIT-licensed with no pricing or commercial offer disclosed, the author reuses third-party stores (pass, Bitwarden) rather than locking users into his own vault, and he states the threat model is more valuable than the tool.
Confident about the argument, not about the artifact
Confidence is limited by cluster shape: one self-published item, one publisher, no corroboration and no adoption data. What can be held with reasonable confidence is the descriptive content — how keys reach agents, the three leak vectors, and what the tool claims to do — because these are consistently and specifically stated by the party who built it. What cannot be held with confidence is prevalence, effectiveness, comparative superiority, or any real-world uptake.
build
Your Coding Agent Reads .env, And .gitignore Was Never The Control1 distinct publisher
build
A 12MB Go binary bets agent cost control is cache stickiness, not a dashboard1 distinct publisher
security
Encrypted injection walks past Grok's filters and out through its own browser1 distinct publisher
build
Grok built its own prompt injection: the filter never saw the payload1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 14, 2026