## [mirendev/runtime#1458](https://github.com/mirendev/runtime/pull/1458) 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 `/tasks//`. `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: - 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 - change the task branch of the advice to say only "move the shared secret". **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. **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. ## Inline comments - **components/coordinate/secret_sealer.go:75** — 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". - **servers/build/build.go:378** — 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 to existing threads _Posted to the PR's comment threads when you submit._ - _(reply)_ Nothing has changed here since I resolved this: `resolveSensitiveBuildEnv` still drops any value whose owner isn't exactly the app. - _(reply)_ 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. --- **Verdict:** ready