Skip to content

EnvRune: references in Git, secrets in the vault

How EnvRune separates versioned configuration from secret values, injects environment variables into a process and bounds agent access through MCP.

By 3 min read
  • security
  • go
  • mcp
  • architecture
EnvRune illustration showing an encrypted vault, named environment references and masked terminal output

Configuration does not need to contain the secret

A .env file mixes two kinds of information: which variables an application requires, and which values grant access to a service. The first belongs with the code and needs to circulate within a team. The second requires access control.

Passage link

EnvRune separates those responsibilities. A vault stores encrypted values; envrune.yml maps environment variables to readable references. The versioned file describes bindings without containing the values. See the EnvRune case study for the project context.

Passage link

The boundary is the process that uses the variable

The documented workflow initializes the project, unlocks the vault, binds a variable and starts a program:

Passage link
sh
envrune project init
envrune unlock --ttl 8h
envrune link SERVICE_TOKEN service.development
envrune run -- ./your-application
Passage link

SERVICE_TOKEN is an example name. This article contains no real secret values. When a reference does not exist, the CLI offers to store it. Temporary unlocking is an explicit operator choice.

Passage link

The runner launches the child process directly, without an intermediate shell. This reduces additional command interpretation, but does not make an unknown program trustworthy. That process receives the secret and remains inside the trust boundary.

Passage link

Encryption and output masking address different problems

The published design uses Argon2id for password key derivation and XChaCha20-Poly1305 for authenticated vault encryption. The documentation also describes recovery and data keys. This describes the project, rather than claiming an independent cryptographic audit.

Passage link

Output masking in run and up reduces accidental disclosure in terminals and logs. It cannot stop a program deliberately sending a value over the network or writing it elsewhere. export serves a different purpose: it produces plaintext, so its destination, permissions and Git history need attention.

Passage link

Agents run named commands through MCP

The envrune mcp server exposes environment, reference and command metadata, plus execution of commands named in envrune.yml. By default, it offers neither a tool that reads secret values nor arbitrary command-line execution.

Passage link

--allow-args and --allow-any-command expand that surface and are disabled by default. Output is masked and bounded, and execution has a timeout. These restrictions complement review of the allowed commands: a script that exfiltrates data remains dangerous even when it has an approved name.

Passage link

Optional Cloud has its own trust model

The local vault works without Cloud. In ordinary sharing, the documentation describes encryption and decryption on devices, with ciphertext stored by the server. An important exception is a managed key marked sensitive: a server proxy can use it and must read that value to insert it into a request. These are different trust models.

Passage link

Read the redaction, recovery and server operations limitations before adopting it. This article claims no adoption, savings or incident reduction figures; those outcomes require actual measurement.

Passage link

Sources and next step

This article was checked against repository commit c2aa0d1 on 17 October 2026: README, security, MCP and managed keys. Start with a test project and disposable credentials to evaluate the architecture in your workflow.

Passage link

Reference with source and version

Download BibTeX

Suggest a correction

https://lagrotti.dev/blog/envrune-secrets-out-of-plaintext-dotenv · EN

Your text stays in this form until you prepare and open the draft. You review and publish the issue on GitHub.

Which topic should go deeper?

Results are unavailable right now

Share this article

LinkedInWhatsAppXEmail

Need someone for a challenge like this one?

I work end to end: architecture, development and running in production. I'm open to remote roles and custom projects.