cask/upgrade: claim macOS may prompt rather than will - #23545
Merged
Conversation
Whether a Gatekeeper prompt appears is decided by identity-level approval state Homebrew cannot read, and both outcomes have been observed after these messages.
carlocab
approved these changes
Aug 17, 2026
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the context of increased concern about security, I've been monitoring the output of my daily
brew upgraderuns for a couple of months, and that record establishes a minor inaccuracy in one of the claims the output makes.This PR changes "will" to "may" in the four messages and updates the two spec expectations to match. Wording only; no behaviour change.
The four quarantine messages in cask upgrades state that "macOS will prompt at next launch". However, macOS often doesn't. I, for one, was consternated by this, thinking an application that needed my approval had managed to run without it when I was not prompted. In fact, after studying the situation, I have established that nothing bad is happening. The issue is just that Homebrew cannot know. Whether a prompt appears is decided by macOS's identity-level approval state (the ExecPolicy database, keyed to signer and bundle identity), which Homebrew has no way to read. The quarantine xattr Homebrew manages is only part of the story.
Both outcomes occur in practice after the identical message. In one
brew upgraderun on my machine,betterdisplayandwhatsappeach got the:unapprovedmessage minutes apart;betterdisplaylaunched moments later (via upgrade's reopen) with no prompt and remains unapproved days later, whilewhatsappprompted at its first launch five hours after. Again: when the claim is wrong, a user who was told to expect a prompt sees none and may reasonably conclude something else went wrong — or reads the warning as noise, which costs the messages their credibility for the times they are right.To see the message:
brew reinstall --caskanything whose installed app is not quarantine-approved (for example because its own updater replaced the bundle) prints the:unapprovedvariant. Whether macOS then prompts at the next launch is the part Homebrew cannot predict, as above — which is why there is no deterministic repro for the claim being wrong, only for the claim being made.Details
What Homebrew can and cannot know about the prompt
Gatekeeper's first-launch prompt is triggered by the quarantine attribute's presence, so an untagged app is the one state Homebrew could truthfully promise about: no tag, no evaluation, no prompt (which is what
--no-quarantinebuys, and why bundles replaced by an app's own updater never prompt). For any tagged state the outcome is decided by approval records Homebrew cannot read. The four messages changed here all describe tagged-but-unapproved outcomes — squarely in the unknowable zone — while the one state that permits a confident claim is one where Homebrew prints nothing at all.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Used Claude Code (Fable 5) to investigate and draft; I directed the investigation, and reviewed the diff and every line of this PR text.