The latest push replaces the seal-time capability gate with a compatibility allowance in Resolve. I think that's the right fix for the scheduling-time gap evanphx raised. I found one bug elsewhere in the PR, though, and it should be fixed before merge: the conflict advice for task env tells users to do something the build silently throws away.
Task-env conflict advice leads to an empty variable. This happens when a shared secret already sits at <app>/tasks/<task>/<KEY>. refAdvice (components/coordinate/secret_sealer.go:75) then tells the user to reference it from the task's env in app.toml with backend and ref. But buildTasksConfig (servers/build/build.go:376-383) copies only Key, Value, Required, Sensitive and Description. It drops ev.Backend and ev.Ref, unlike the global path (line 729) and the service path (line 953), which both turn Ref into the value and keep Backend. appconfig.validateTasks also never calls validateReference.
So a user who follows the advice gets a task variable with an empty literal value and no backend. Sealing skips it because the value is empty, so the error goes away. Unless the variable is required, the deploy goes green and the task runs with no credential. TestRefAdviceMatchesTheVariableKind checks the advice text, but nothing checks that the advice works. To fix it, either:
Backend and Ref through buildTasksConfig the way services do, add validateReference to validateTasks, and add a test for a task env reference from app.toml; orThe Resolve allowance (servers/secret/server.go:427). An owned secret now goes to a caller only when all three hold: the caller sends no app_id, isn't bound to an app, and isn't under Cloud authorization. A bound caller or a Cloud-authorized caller with no app_id is still refused, and so is a caller that names the wrong app. ownership_test.go covers each case plus the allowance. Your reasoning matches the code: an unbound caller could already name any app, so this doesn't loosen anything that was actually protecting secrets, and secret.Pin is still what keeps one app off another's secret. I found nothing left of nodecaps, PinReport or the deferral warnings, and PinSecrets has its original signature back.
For the human reviewer: two decisions are yours. The product question from my earlier reviews still stands: if an operator's unowned secret already sits at a seal path, writes to that app fail instead of the value being left inline. Also decide whether you accept the one-release window in which an unbound caller, such as an mTLS admin CLI, can resolve an owned secret without naming its app. I'm not recommending approval without a person's read, given the bug above and how security-sensitive the change is across the coordinator, the secrets server and the build server.
buildTasksConfig (servers/build/build.go:376-383) drops ev.Backend and ev.Ref for task env, so a task [[env]] with backend/ref becomes Key=K, Value="" with no backend. sealSensitive skips an empty value, so the conflict error goes away and the task runs with an empty variable. Either make task references work end to end, or change this branch to say only "move the shared secret to another path".Backend and Ref here, while the global path (line 729) and the service path (line 953) both turn Ref into the value and keep Backend. This PR gives task env a backend attr and advises task-env references in refAdvice, so this path needs the same treatment: value, sensitive = ev.Ref, true when ev.Backend != "", plus Backend: ev.Backend. appconfig.validateTasks should also call ev.validateReference, like services and global env do. A test with a task env reference from app.toml would pin it down.Posted to the PR's comment threads when you submit.
resolveSensitiveBuildEnv still drops any value whose owner isn't exactly the app.secret_sealer.go, and sealSensitive seals on every write. In Resolve (server.go:427), an owned secret now goes to a caller only if it sends no app_id, isn't bound to an app, and isn't under Cloud authorization. A bound caller or a Cloud-authorized caller is still refused, and so is a caller that names the wrong app. ownership_test.go covers each of those cases. This also closes the timing gap I'd confirmed earlier, for a runner that rejoins after sealing. I'm leaving this thread for you to resolve.Verdict: ready
{
"owner": "mirendev",
"repo": "runtime",
"number": 1458,
"verdict": "ready",
"event": "comment",
"summary": "The latest push replaces the seal-time capability gate with a compatibility allowance in `Resolve`. I think that's the right fix for the scheduling-time gap evanphx raised. I found one bug elsewhere in the PR, though, and it should be fixed before merge: the conflict advice for task env tells users to do something the build silently throws away.\n\n**Task-env conflict advice leads to an empty variable.** This happens when a shared secret already sits at `\u003capp\u003e/tasks/\u003ctask\u003e/\u003cKEY\u003e`. `refAdvice` (`components/coordinate/secret_sealer.go:75`) then tells the user to reference it from the task's env in app.toml with `backend` and `ref`. But `buildTasksConfig` (`servers/build/build.go:376-383`) copies only `Key`, `Value`, `Required`, `Sensitive` and `Description`. It drops `ev.Backend` and `ev.Ref`, unlike the global path (line 729) and the service path (line 953), which both turn `Ref` into the value and keep `Backend`. `appconfig.validateTasks` also never calls `validateReference`.\n\nSo a user who follows the advice gets a task variable with an empty literal value and no backend. Sealing skips it because the value is empty, so the error goes away. Unless the variable is `required`, the deploy goes green and the task runs with no credential. `TestRefAdviceMatchesTheVariableKind` checks the advice text, but nothing checks that the advice works. To fix it, either:\n- carry `Backend` and `Ref` through `buildTasksConfig` the way services do, add `validateReference` to `validateTasks`, and add a test for a task env reference from app.toml; or\n- change the task branch of the advice to say only \"move the shared secret\".\n\n**The `Resolve` allowance (`servers/secret/server.go:427`).** An owned secret now goes to a caller only when all three hold: the caller sends no `app_id`, isn't bound to an app, and isn't under Cloud authorization. A bound caller or a Cloud-authorized caller with no `app_id` is still refused, and so is a caller that names the wrong app. `ownership_test.go` covers each case plus the allowance. Your reasoning matches the code: an unbound caller could already name any app, so this doesn't loosen anything that was actually protecting secrets, and `secret.Pin` is still what keeps one app off another's secret. I found nothing left of `nodecaps`, `PinReport` or the deferral warnings, and `PinSecrets` has its original signature back.\n\n**For the human reviewer:** two decisions are yours. The product question from my earlier reviews still stands: if an operator's unowned secret already sits at a seal path, writes to that app fail instead of the value being left inline. Also decide whether you accept the one-release window in which an unbound caller, such as an mTLS admin CLI, can resolve an owned secret without naming its app. I'm not recommending approval without a person's read, given the bug above and how security-sensitive the change is across the coordinator, the secrets server and the build server.",
"comments": [
{
"path": "components/coordinate/secret_sealer.go",
"line": 75,
"side": "RIGHT",
"body": "This advice doesn't work today. `buildTasksConfig` (`servers/build/build.go:376-383`) drops `ev.Backend` and `ev.Ref` for task env, so a task `[[env]]` with `backend`/`ref` becomes `Key=K, Value=\"\"` with no backend. `sealSensitive` skips an empty value, so the conflict error goes away and the task runs with an empty variable. Either make task references work end to end, or change this branch to say only \"move the shared secret to another path\"."
},
{
"path": "servers/build/build.go",
"line": 378,
"side": "RIGHT",
"body": "Task env loses `Backend` and `Ref` here, while the global path (line 729) and the service path (line 953) both turn `Ref` into the value and keep `Backend`. This PR gives task env a backend attr and advises task-env references in `refAdvice`, so this path needs the same treatment: `value, sensitive = ev.Ref, true` when `ev.Backend != \"\"`, plus `Backend: ev.Backend`. `appconfig.validateTasks` should also call `ev.validateReference`, like services and global env do. A test with a task env reference from app.toml would pin it down."
}
],
"replies": [
{
"thread_id": "PRRT_kwDONZ__ss69345u",
"body": "Nothing has changed here since I resolved this: `resolveSensitiveBuildEnv` still drops any value whose owner isn't exactly the app."
},
{
"thread_id": "PRRT_kwDONZ__ss6-YsVg",
"body": "I checked the new head. The gate is gone from `secret_sealer.go`, and `sealSensitive` seals on every write. In `Resolve` (server.go:427), an owned secret now goes to a caller only if it sends no `app_id`, isn't bound to an app, and isn't under Cloud authorization. A bound caller or a Cloud-authorized caller is still refused, and so is a caller that names the wrong app. `ownership_test.go` covers each of those cases. This also closes the timing gap I'd confirmed earlier, for a runner that rejoins after sealing. I'm leaving this thread for you to resolve."
}
],
"posted_to_pr": true,
"head_sha": "85ff1f08d3b3606fca561b3ea74f4ad1045ec03a"
}The blocker from my last review is fixed, and I found nothing new anywhere in the PR. It's ready for a human to review.
Variable names that aren't valid path segments. Every service, task and key name now goes through secret.PathSegment (pkg/secret/seal.go) before it becomes part of a seal path. A name that is already a valid segment and doesn't start with x- is used unchanged. Any other name gets an x- prefix, and inside it letters, digits and - are kept, _ is doubled, and every other byte becomes _HH.
Each _ escape is followed by either _ or an uppercase hex digit, so the result always passes cluster.ValidatePath and can only be decoded one way. Unencoded segments never start with x- and encoded ones always do, so two different names can't land on the same path. A valid name that happens to start with x- is encoded too, as x-x-plain.
Everything that builds or reads these paths goes through the same functions:
sealSensitiveisSealedFor in servers/build/build.go:1408, so a sealed dotted key is still recognised as the app's own during a buildrefAdvice, which decodes the segments back to names, so the advice reads -e spring.datasource.password --ref shop/x-spring_2Edatasource_2Epassword, which is the right commandEncoding also fixes a collision I hadn't spotted: an app-wide key web/KEY used to land on service web's path. TestPathSegmentIsValidAndInjective covers underscore-leading, dotted, slashed and empty names, names that start with x-, and names built to look like encodings of the others. For each one it checks the segment is valid, distinct and decodes back to the name. TestSealPathKeepsASlashedKeyOffAServicePath pins the collision.
For the human reviewer: the product question from my earlier reviews is still open. If an operator's unowned secret already sits at a seal path, the write fails with a clear way out instead of leaving the value inline. I'm not recommending approval without a person looking at it. The change is security-sensitive and spans the coordinator, the build server and runner capabilities, so it deserves a human read even though I have no defects left to report.
Posted to the PR's comment threads when you submit.
secret.SealPath or secret.TaskSealPath, and both pass each name through PathSegment. A name that isn't a valid segment, or that already starts with x-, gets the x- prefix and a reversible escape. So _API_TOKEN and spring.datasource.password now seal to valid paths and no longer block every write. isSealedFor in the build server and refAdvice use the same function, so they agree with these paths. TestPathSegmentIsValidAndInjective checks each result with cluster.ValidatePath, checks that no two names share a segment, and checks that each one decodes back to its name. Thanks.Verdict: ready
I found one new problem in the sealing path, and I think it needs fixing before merge: a sensitive variable whose name isn't a valid cluster secret path segment makes every config write for its app fail.
sealSensitive (api/core/secretpin.go:268, :285, :304) builds the seal path by joining the variable name onto the app (and service or task) name. PutOwned checks that path with cluster.ValidatePath (pkg/secret/cluster/cluster.go:179). The pattern there is ^[a-zA-Z0-9][a-zA-Z0-9_-]*(/…)*$, which rules out dots and a leading underscore. Variable names are never checked against that pattern. rejectKeysWithEquals only rejects =, and the only env-name regex in appconfig is for build secrets. So -s _API_TOKEN=… and -s spring.datasource.password=… are both accepted, and each becomes a seal path that fails validation. Both are names a process can receive, and _API_TOKEN is valid POSIX.
sealSensitive walks the whole config and returns the first error. Once every runner supports owned secrets, an existing app with one such variable can't deploy or run any env set at all, including unrelated ones. The error doesn't say that renaming the variable is the way out. Today that same app deploys fine with the value inline.
Any of these would fix it:
Please add a test with a dotted or underscore-leading sensitive key, whichever way you go.
What's fixed since my last review: the advice in the conflict error now matches the kind of variable. App-wide variables get env set -e KEY --ref, service variables get -S <service>, and task variables get pointed at app.toml with the backend and ref filled in. A service named tasks is handled correctly. I checked that envSetReference passes Service through, so the -S form replaces the conflicting variable. TestRefAdviceMatchesTheVariableKind covers each case. I'm closing my three remaining threads.
For the human reviewer, the question from before still stands: when an operator's unowned secret already sits at a seal path, the write fails hard instead of leaving the value inline. With the clearer error that's easier to defend, but it's a product decision.
v.Key goes straight into the seal path. PutOwned then runs cluster.ValidatePath on it, which allows only [a-zA-Z0-9][a-zA-Z0-9_-]* per segment. A sensitive key like _API_TOKEN or spring.datasource.password passes rejectKeysWithEquals but fails here. Because this loop covers the whole config, every later write for the app fails, not just the one that set it. The same applies to the service branch (L285) and the task branch (L304).Three ways to fix it: encode the key into a valid segment; skip these keys and report them the way SealDeferredError reports old runners; or reject them at set time and decide what happens to apps that already have one. A test with a dotted or underscore-leading key would pin this down.
Posted to the PR's comment threads when you submit.
refAdvice now gives -S <service> for 3-segment paths, points task env at app.toml with the backend and ref filled in, and handles a service named tasks correctly. I checked that envSetReference passes Service through, so the suggested -S command really does replace the conflicting variable. TestRefAdviceMatchesTheVariableKind covers each case. Thanks.Sealer.Seal doc now says it returns "a reference pinned to the version it wrote", which matches what secretSealer.Seal does. Closing.secret_sealer.go now names the conflicting path and gives both ways out: reference the shared secret or move it. It's wrapped with %w, so errors.Is(err, secret.ErrNotOwned) still matches, and TestSealerRefusesAnOperatorsUnownedSecretAtThePath checks the message. Closing.Verdict: not_ready
Both points from my last review are fixed, and I found nothing new that blocks this. It's ready for a human. I'm still not recommending approval without one: the change is broad, and it changes how secrets are stored and handed to builds.
What changed:
secret_sealer.go:66-72 catches ErrNotOwned and names the conflicting path. It offers two fixes: reference the shared secret with --ref, or move it. The error is wrapped with %w, so errors.Is still matches it, and sealSensitive's prefix keeps the variable name in the message. One gap is left: the suggested command assumes an app-wide variable (inline note).Sealer.Seal doc in pkg/secret/seal.go now says it returns a reference pinned to the version it wrote, which matches what the code does.For the human reviewer: I'd still look at the decision of when values get stored as secrets and when they stay inline (secret_sealer.go, pkg/nodecaps). The open question is whether failing hard on the unowned-path conflict is the upgrade behavior you want, or whether it should wait like the old-runner case does. Now that the error explains the way out, failing hard is defensible, but that's a product decision for a person.
--ref advice only unblocks an app-wide variable. For a service variable the conflicting path is <app>/<service>/<KEY>, and miren env set -e KEY --ref <app>/web/KEY without -S web adds a new app-wide KEY. The service's inline sensitive KEY stays where it was, so the next write hits this same error. Task env (<app>/tasks/<task>/<KEY>) has no env set option at all, so the only fix there is changing app.toml or moving the shared secret.Seal only gets the path, so the simplest fix is in sealSensitive, which already knows the service or task. It could add the matching -S <service> to the message, or for a task say to change app.toml. Otherwise, a shorter message that names the path and says "reference it instead of setting a value, or move the shared secret" would avoid suggesting a command that doesn't work.
Verdict: ready
Both issues from my last review are fixed, and nothing I found blocks this. It's ready for a human. I'm still not recommending approval without one: the change is broad, and it changes how secrets are stored and handed to builds.
Owner gate on build secrets. resolveSensitiveBuildEnv (build.go:1433-1436) runs CheckOwner and then drops any value whose owner isn't exactly the app. That removes the unowned case: an operator's shared secret at shop/STRIPE_KEY stays out of the build even when isSealedFor matches its path. TestResolveSensitiveBuildEnvLeavesUnownedSecretsOut covers it.
Seal returns a pinned ref. secret_sealer.go now returns secret.FormatRef(path, version) with the version PutOwned minted. Pin leaves an already-pinned ref unchanged, so a concurrent env set can no longer change what a deploy records. The coordinator test asserts the sealed ref carries a version. One small leftover: the Sealer.Seal doc comment in pkg/secret/seal.go still says "floating reference" (inline).
New: an unowned secret at a seal path blocks every write to the app (api/core/secretpin.go:258). Refusing to write an app's value into an operator's unowned secret is right. But sealSensitive walks the whole config, so this fails every later deploy and env change for that app once runners are upgraded, unrelated ones included. The trigger is an app with an inline sensitive key that matches an operator's unowned secret at <app>/<KEY>, and secrets.md presents shop/... paths as the convention. The error only says "secret belongs to no app", so the user isn't told which path conflicts or how to fix it. This doesn't block merging, but the error should name the path and the fix (inline).
Where a human should focus: two places.
secret_sealer.go and pkg/nodecaps. In particular, decide whether failing hard on the unowned-path conflict above is the upgrade behavior you want, or whether it should defer like the old-runner case.secretSealer.Seal now returns path@version, so "floating reference" here is out of date. It should say the pinned reference, i.e. the version this write produced. Otherwise a future implementer may go back to returning the bare path.sealSensitive walks the entire config, so once an operator's unowned secret sits at a seal path (e.g. shop/DATABASE_PASSWORD, which is the naming convention secrets.md shows) while the app still has that key as an inline sensitive value, every later write of the app's config fails, including an unrelated env set LOG_LEVEL=debug. The user sees storing sensitive variable DATABASE_PASSWORD as a secret: secret belongs to no app, which names neither the conflicting path nor a fix.Refusing the write is the right call. It would help to have the error include the path and the two ways out: delete or rename the operator's secret, or replace the variable with --ref to it. The same line in the "Sensitive env vars are stored as secrets" section of secrets.md would cover it.
Posted to the PR's comment threads when you submit.
isSealedFor still matches on the path alone, but resolveSensitiveBuildEnv now drops anything whose owner isn't exactly the app (line 1436, after CheckOwner). That means an operator's unowned secret at a seal path stays out of the build. TestResolveSensitiveBuildEnvLeavesUnownedSecretsOut pins that down. Thanks.Seal now returns secret.FormatRef(path, version) with the version PutOwned minted, and the new comment explains why. TestSealerStoresSensitiveValuesAsOwnedSecrets checks that the sealed ref carries a version. The only leftover is the interface doc in pkg/secret/seal.go, which still says "floating". I've left a separate note on that line.Verdict: ready
This is ready for a human. The build-path question and the doc contradictions from my last review are fixed. Two smaller issues are left, both inline and neither blocking. I'm still not recommending approval without human review: the change is broad, and it changes how secrets are stored and handed out.
What changed. Builds no longer decrypt every var that has a backend. In servers/build/build.go, a backend var reaches the build only when isSealedFor matches it against the app's own sealed path. Hand-authored references otherwise stay out, as they did before this PR. Two cases still behave correctly:
resolveSensitiveBuildEnv still runs CheckOwner on each value.TestComputeBuildEnvVars covers sealed refs, shared refs, another app's path, and a non-cluster backend. The secrets.md intro, the "two points" passage and the build section now match the code. The stale test comment is gone, and the saga follow-up is tracked in Linear.
isSealedFor matches on path only (build.go:1403). Say an operator ran miren secret set shop/STRIPE_KEY and the app references it as STRIPE_KEY. That reference matches the sealed path exactly, so the shared secret gets decrypted into every build. CheckOwner doesn't stop it, because an unowned secret passes. That contradicts the new docs line saying references you write yourself stay out of the build. Sealed values are always written with Require: true, so they always have an owner. Requiring the resolved owner to equal the app would close this cleanly.
Seal drops the version it wrote (components/coordinate/secret_sealer.go:62-65). PutOwned returns the version it minted, but Seal returns the bare path, and PinSecrets then resolves "current" a moment later. Concurrent config writers are an expected case (envvar.go retries on CAS conflicts by design). Two writers sealing the same key can therefore each pin the other's value. For example, a deploy -s KEY=x racing an env set -s KEY=y can produce a version recording y for the deploy that asked for x. Returning path@version from Seal removes the window. The pin step is idempotent on an already-pinned ref.
Where a human should focus: same as before. Look at secret_sealer.go and pkg/nodecaps, where the code decides whether a value gets sealed or stays inline. Then decide how strict isSealedFor should be.
shop/STRIPE_KEY and the app references it as STRIPE_KEY (env set --ref or [[env]] backend/ref, which buildVariablesFromAppConfig marks Sensitive). That reference matches here and gets decrypted into the build. CheckOwner in resolveSensitiveBuildEnv doesn't stop it, because an unowned secret passes. secrets.md now says references you write yourself stay out of the build, so this is the one case where that's not true.Seal always writes with Require: true, so a genuinely sealed value always has an owner. Requiring the resolved owner to equal the app would make the check exact. You could do that by having resolveSensitiveBuildEnv drop a path-matched value whose owner is empty, or by checking it here once resolved. Otherwise the docs should name the exception.
PutOwned on line 62 returns the version it just minted, but this returns the floating path, so PinSecrets resolves "current" afterwards. Concurrent config writers are an expected case: SetEnvVars retries on CAS conflict by design, and a deploy can race an env set. If two writers seal the same key between one's PutOwned and its pin, that writer's version records the other's value. Example: deploy -s KEY=x concurrent with env set -s KEY=y can produce a deploy version pinned to y.Returning path + "@" + version closes the window. secret.Pin is idempotent on an already-pinned reference, so nothing downstream changes. The doc comment on Sealer.Seal would need to say "pinned" instead of "floating".
Verdict: ready
This is ready for a human. Task env is now sealed, so the blocker from my last review is resolved. I'm not recommending approval without human review: the change is broad, it changes how secrets are stored and handed out, and one build-time behavior change below needs someone to decide it's intended.
Task env sealing. I checked each step:
ConfigSpecTasksEnv gains a backend attr.sealSensitive writes task values to secret.TaskSealPath (<app>/tasks/<task>/<KEY>). The extra path segment means it can't collide with a service's var, even for a service named tasks.SecretReferences and the pin write-back both cover tasks, and controllers/version/secret_gc.go uses SecretReferences, so task secrets are also protected from GC.appspec.Build now sends task env through secret.EnvValue, so the container gets a reference instead of a raw path.TestPinSecretsSealsSensitiveLiterals uses a task and a service with the same name and key, and checks that each gets its own secret. That's the case most likely to break.
Saga history. You documented that saga records hold the sensitive values a deploy was given, and the changelog says that's "being fixed separately". I'm treating that as your call. I couldn't find a ticket for the fix, though, so it may be worth filing one so the changelog's promise has an owner.
Needs a human decision: explicit secret references now reach builds. computeBuildEnvVars (servers/build/build.go:1378) sends every var with Sensitive || Backend != "" to resolveSensitiveBuildEnv, which decrypts it. That set includes references people wrote themselves ([[env]] backend/ref, env set --ref), not just values this PR sealed. buildVariablesFromAppConfig marks every reference as sensitive. As a result, every deploy now decrypts every top-level secret reference into the builder. Auto-stack builds then set it as env on steps like asset precompile and onbuild. Before this PR, the build got at most the reference string. Sealed values do need this path, since they used to reach builds as build args. Whether hand-authored references should come along is a decision for the reviewer. It also makes two passages in secrets.md untrue, as described in the next section.
Docs that now contradict the code (inline notes on both):
secrets.md (lines 11–20) still says -s stores the value in plaintext and is only for "merely noisy" values. That contradicts the new section on the same page.secrets.md:116 still says an [[env]] reference reaches the app at runtime and not during the build. Line 22 says secrets are decrypted at two points by default. Neither is true anymore, because of the build path above.A small leftover: the comment on TestPinSecretsRejectsALiteralPosingAsAReferenceInATask (api/core/secretpin_test.go:232) still says task env has no backend field.
Where to focus. Besides the build question, I'd spend time on components/coordinate/secret_sealer.go and pkg/nodecaps. That's where the code decides whether a value gets sealed or stays inline, and those decisions carry the most security weight. The version-mismatch check in nodecaps.Has and Require: true on PutOwned look right to me.
-s leaves the value in your config. This row says -s values are stored as "plaintext in the cluster store", and the next rows say rotation means editing each app and there's no history. Line 20 says to use -s only for values that are "merely noisy". After this PR, a -s value is an app-owned secret, encrypted at rest and versioned. Please rewrite the opener so the -s column describes the new behavior. Alternatively, reframe the table as "shared secret you manage" vs. "app-owned sensitive var". As written, the top of the page argues against the feature this PR adds.computeBuildEnvVars (servers/build/build.go:1378) now sends every top-level var with a backend through resolveSensitiveBuildEnv. That includes hand-authored [[env]] backend/ref entries, which buildVariablesFromAppConfig marks as sensitive. So an [[env]] reference is now decrypted for every build, and an auto-stack build sets it as env on its steps. Line 22's "two points by default" is wrong for the same reason. Whether that's the behavior you want or not, this page should say what actually happens.v.Backend != "" catches the vars this PR seals, and it has to: those used to reach builds as build args. It also catches every secret reference a user wrote by hand. buildVariablesFromAppConfig marks all [[env]] references as Sensitive, and --ref sets Backend. Those used to reach the build as at most the reference string. Now resolveSensitiveBuildEnv decrypts each one on every deploy and puts the plaintext on build steps. If only sealed values are meant to reach builds, they could be told apart by path or owner. If all references are meant to, then it's a deliberate widening and the docs need to say so (see my note on secrets.md:116).Verdict: ready
I'm marking this not ready for one gap. A sensitive env var declared on a task is never stored as a secret, but the new docs and the changelog say it is. There's also one scope question that a human should decide.
Task env isn't sealed (blocker). sealSensitive (api/core/secretpin.go) only walks spec.Variables and spec.Services[].Env. Task env can't be sealed as things stand: ConfigSpecTasksEnv has no Backend field, as rejectLiteralsPosingAsReferences notes just above. Meanwhile buildTasksConfig (servers/build/build.go:375-383) still copies Sensitive: ev.Sensitive and the inline value from [tasks.<name>] env in app.toml. So a task's sensitive = true value stays plaintext in every config version, and no warning says so.
Meanwhile docs/docs/secrets.md:91 and the changelog's "Safer sensitive env vars" entry both say sensitive = true in app.toml now becomes a secret. That's a security claim, and the PR closes the ticket, so the docs shouldn't promise more than the code delivers. There are two ways to fix it:
backend attr on task env, plus pinning and resolution for it.Either way, a test with a sensitive task var would lock it in. TestPinSecretsSealsSensitiveLiterals only covers top-level and service env.
The deploy saga still writes plaintext to the cluster store (needs a human decision). Sealing happens in createConfigVersion, after prepareConfig has already returned config_spec_json (servers/build/build_saga.go:328-332). That's the whole spec, with every inline sensitive = true value from app.toml and every deploy -s value, and it's stored in the saga execution entity. The cli_env_vars saga input holds the -s values too. So every deploy still puts these values into the cluster store in plaintext, until saga retention prunes the execution.
This isn't new, and the PR doesn't make it worse. But the problem this work exists to fix is plaintext sensitive values in the cluster store, and this path keeps doing that on every deploy, not just in old versions. I couldn't find it tracked anywhere. Someone should decide whether it's in scope here or becomes a follow-up. If it's a follow-up, the changelog's rotation advice should mention saga history alongside old versions.
What holds up well:
capabilities_version matches its current version (pkg/nodecaps/nodecaps.go Has). That handles a downgraded or re-joined old binary leaving a stale list behind, and TestAllNodesSupportDistrustsCapabilitiesLeftByANewerBuild covers that exact merge case.PutOwned(..., Require: true) in components/coordinate/secret_sealer.go makes an operator's unowned secret at <app>/<KEY> fail the write rather than quietly take an app's value.spec.Tasks[].Env can carry Sensitive: true with an inline value (buildTasksConfig copies it straight from app.toml), but this function only walks Variables and Services[].Env, and ConfigSpecTasksEnv has no Backend field to hold a reference anyway. Those values stay plaintext in every config version, with no warning. Please either add a backend field to task env and seal/pin/resolve it like service env, or explicitly exclude tasks: document it and warn when a task declares a sensitive inline value. Then add a test for whichever behavior you choose.sensitive = true in app.toml becomes an app-owned secret, but [tasks.<name>] env isn't sealed (see my comment in secretpin.go). Either make it true for tasks or narrow the wording, and do the same for the changelog's "Safer sensitive env vars" entry, so nobody relies on a guarantee that isn't there.createConfigVersion. So every deploy stores inline sensitive = true values and deploy -s values (also present in the cli_env_vars input) in the cluster store in plaintext until saga retention prunes the execution. That predates this PR, but it's the problem the PR sets out to fix. One option is to seal before this point. Another is to keep sensitive values out of saga inputs and outputs, or at least to call out saga history in the rotation advice.Verdict: not_ready