- How you use it
- Installs a bundle into your client
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | APlugin · v0.2.01Password Environments plugin (MCP server + skill) |
|---|---|
| How you use it | Installs a bundle into your client |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
As of November 2026, vault-backed environments, encrypted .env values and secrets hooks reduce accidental credential exposure, with the shell-access limits below. Do first: keep production keys off your laptop and keep the decryption key outside the agent’s reach.
The problem
An agent that can read your project can read .env, and an agent with a shell can print environment variables. Arvid Kahl's advice: keep dev credentials in a vault that asks every time, never in files an agent can look up, and keep production keys off your laptop entirely.
A first step costs nothing: in Claude Code, permissions.deny rules such as Read(./.env) and Read(./.env.*) stop the Read tool, but shell commands like cat .env are only blocked if you also run commands in a sandbox.
The options
| 1Password Developer Environments | dotenvx | Sonar secrets detection | |
|---|---|---|---|
| How | Secrets stay in 1Password; a local MCP server manages them and a mounted .env streams values on demand | Values in .env are encrypted; dotenvx run -- <cmd> decrypts into that process | A hook scans prompts and files for secrets before they go to the model |
| Agent sees | Variable names via MCP, never values | Ciphertext in .env | Blocked, redacted or flagged secrets |
| Weak spot | After you approve a read, any process can read the .env until 1Password locks | The private key (.env.keys or DOTENV_PRIVATE_KEY) must stay out of the agent's reach; an agent that can run dotenvx with the key can print values | Detection, not isolation: it catches known secret formats |
| Cost | 1Password subscription; on business accounts an admin must enable the feature | Free, BSD-3-Clause | Secrets detection works locally and free; other Sonar analysis needs a paid plan |
| Platforms | Desktop app on macOS, Windows, Linux; .env mounts on macOS and Linux only | Any | macOS, Linux, Windows |
1Password Developer Environments
The 1Password desktop app ships a local MCP server (1password-mcp). Its tools list environments and variable names, add variables and create a local .env mount, and by design never return secret values. The .env mount is a UNIX named pipe, so nothing is written to disk; the app shows an approval prompt the first time something reads it. The Codex plugin (MIT) packages the MCP config and a skill; the same server works in Claude Code and Cursor.
dotenvx
dotenvx encrypts each value with a public key so the .env file can even be committed. Install it with npm install @dotenvx/dotenvx or brew install dotenvx; its README also offers a download-and-pipe-to-shell installer, which we do not recommend. Keep .env.keys outside the repo or deny the agent access to it.
Sonar secrets detection
The SonarQube CLI's sonar integrate claude installs secrets detection (and the SonarQube MCP server) for Claude Code, so secrets in prompts or files are caught before they are sent to the model. It also integrates with Codex, Copilot CLI and Cursor. Install it with brew install sonarqube-cli. Its GitHub repo is released under the GNU Lesser General Public License, Version 3.0.
Which to pick
- You already pay for 1Password and want the agent to set up environments without seeing values: 1Password.
- You want free, file-based protection that also works in CI: dotenvx, plus a deny rule for the key file.
- You want a safety net for pasted keys and hardcoded secrets: Sonar's hook, alongside either of the above.
Whatever you choose, use short-lived, dev-only credentials so a leak costs little.
Found via @arvidkahl (12 Oct 2026).
The 1Password plugin changelog, 23 October 2026, renames its directory listing to 1Password Developer Tools. Enable Settings > Developer > Integrate with MCP clients; administrators control it under Policies > Sharing and permissions > Agentic permissions > Local MCP server.
Sonar CLI v1.11.0, released 27 October 2026 scopes stored tokens to the full server URL, blocks Git secret-scanning hooks when file enumeration fails, and stops standalone binaries automatically loading project .env or bunfig.toml files. These are upstream security fixes, not a claim of secret isolation.
Not for: backdoored models exfiltrating keys or screenshot leaks in PRs
checked 2026-11-03
Started from a post by @arvidkahl, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.