Submit an issue View all issues Source
MIR-2144

Store sensitive env vars as secrets automatically

In Progress public
phinze phinze Opened Oct 21, 2026 Updated Nov 12, 2026

Sensitive env vars are plaintext in etcd. sensitive only masks the value in the CLI, and builds receive every var as a BuildKit build-arg, so a Dockerfile ARG with a matching name bakes the value into image layers and cache. Meanwhile cluster secrets already do this properly: envelope encryption, version pinning, and resolution only at container start. We should stop keeping two kinds of sensitive value.

miren env set -s and sensitive = true in app.toml should create a secret on the spot (something like <app>/<KEY>) and store a reference, and existing sensitive vars should be migrated the same way, with old config versions rewritten to references and etcd compacted so the plaintext doesn't linger in rollback history. Secret-backed vars already stay out of build-args, so the build leak goes away with the plaintext.

Two things come before this or with it. First, Secrets.Resolve serves any reference to any authenticated caller (RFD-90 leaves per-secret scoping open), so once App-level authorization limits users to apps, an app-scoped user could resolve another app's secrets. It needs at least gating by app prefix. Second, apps that read a sensitive value through a Dockerfile ARG will lose it. The build should warn when a declared ARG matches a sensitive var and point at [[build.secrets]], before that turns into an error.