Copilot app blocked by macOS Gatekeeper under corporate security policy
Describe the bug
Everytime after upgrading copilot cli through HomeBrew the following message appears: Apple could not verify “copilot” is free of malware that may harm your Mac or compromise your privacy.
Afterwards, to get it working correctly, I need to go to Privacy & Security to explicitly allow "copilot"
We have the Security option set: Allow applications from: App Store & Known Developers
Affected version
0.0.381
Steps to reproduce the behavior
- On a corporate‑managed Mac with Gatekeeper enforced to App Store & Known Developers by profile.
- brew install copilot-cli
- Attempt to trigger copilot from the terminal
- A pop-up appears with the message ‘Copilot’ was blocked to protect your Mac…
Expected behavior
Copilot should launch normally on managed Macs when signed with a valid Apple Developer ID and notarized, satisfying the “App Store & Known Developers” requirement.
Additional context
Mac OS: Sequoia 15.7.3 Shell: Zsh Terminal: Ghostty
This is a huge pain, so after every version update, I created a function that clears it each time the CLI is updated.
function removeCopilotQuarantine(){
for f in /opt/homebrew/Caskroom/copilot-cli/*/copilot; do
[[ -e $f ]] || continue
# Check if attribute present
if xattr -p com.apple.quarantine "$f" >/dev/null 2>&1; then
# Try removing without sudo first, fall back to sudo
if xattr -d com.apple.quarantine "$f" 2>/dev/null; then
echo "Removed quarantine from: $f (no sudo)"
else
echo "Permission denied; retrying with sudo for: $f"
sudo xattr -d com.apple.quarantine -- "$f" && echo "Removed quarantine from: $f (with sudo)"
fi
else
echo "No com.apple.quarantine on: $f"
fi
done
}
copilot does not open anymore since v1 on Mac OS :/
What is the method to cause it to provide the button "open anyway"?
I am getting stung by this and I didn't install it via homebrew but just gh copilot install and so I'm not sure where the copilot binary is 🤔
@justinmchase you need to go to Settings > Privacy and Security, scroll down where you should find the option to Allow Anyway. On the next run, you'll see the Open Anyway option.
| Before | After |
|---|---|
I figured out that gh copilot just wraps the copilot command so simply doing which copilot works for locating the binary and the above xattr script works to unblock it.
Bumping this issue. It's still a problem under v1+ and MacOS Tahoe. Also, overriding via "allow anyway" is not a solution: lots of companies do not allow this. The only real solution is for Github to get the app signed properly.
It's also a pain when installed through homebrew as the formula started including shell completion setup which invokes the copilot cli but fails due to gatekeeper. And homebrew 6 removed all gatekeeper workarounds.
We found that we need to add an SSL Bypass rule to our corporate proxy for api.apple-cloudkit.com. It was presenting a different certificate, which blocked the connectivity check when it tried to validate the app. Once we added the rule, it went away and installed normally. Details on apple URLs: https://support.apple.com/en-us/101555#appscontent