GitDependencies.sh libraries disallowed by system policy on macOS

Hello,

I’m attempting to build the engine (5.5.4) from source on my Mac. When I try to run Setup.command, I get a security popup saying that “Apple could not verify (xyz.dylib) is free of malware that may harm your Mac or compromise your privacy”.

My logs look like:

jeff@computer-name Engine % ./Setup.command
Registering git hooks... (this will override existing ones!)
Failed to load <repo path>/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib, error: dlopen(<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib, 0x0001): tried: '<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib' (code signature in <24FB2364-94A7-3C04-A351-0D2EABC87C1F> '<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/jeff/Documents/Freerun/Engine/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib' (no such file), '<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib' (code signature in <24FB2364-94A7-3C04-A351-0D2EABC87C1F> '<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/libhostpolicy.dylib' not valid for use in process: library load disallowed by system policy)
An error occurred while loading required library libhostpolicy.dylib from [<repo path>/Engine/Binaries/DotNET/GitDependencies/osx-arm64/]

I’m able to bypass this on a file-by-file level through the Privacy & Security tab in System Preferences by clicking “Allow Anyway” next to the “(xyz.dylib) was blocked to protect your Mac” message, but doing this is incredibly obnoxious as there are quite a few libraries, and I’m worried that I’ve screwed something up that will bite me in the butt down the road.

Is there any setup step I might have missed that would cause this, or have I somehow made a mistake either in the download process or in setting up my development environment?

If any of this is relevant: I’m on an M1Max MBP running Sequoia 15.4.1. I’m using the Xcode command line tools rather than a full install, since I use a different IDE. I downloaded the source using the “Download ZIP” option on GitHub. I have git and git-lfs installed through Homebrew. This occurs even if I sudo.

I found the problem, after a suggestion from @speedbacon on the Unreal Source discord. Downloading the source as a zip caused macOS to quarantine all of the files in it. Cloning directly from GitHub sidestepped that problem entirely.

Another suggestion was to use xattr to clear the com.apple.quarantine flag from the unzipped files, but I’d already nuked them and didn’t get a chance to try it out.