[Bug] macOS XProtect blocks OpenVision build with "Malicious Script Blocked" warning
What happened?
I'm trying to build OpenVision on macOS 26.0 using Xcode 27.0 for a physical iPhone 18 Pro running iOS 27.0.
During the build, macOS repeatedly displays a "Malicious Script Blocked" warning, and the build process terminates unexpectedly.
This happens with both parallel and single-job builds (-jobs 1). In the single-job build, compilation had reached the MLXCXGrammar dependency, including xgrammar/cpp/fsm.cc, when the interruption occurred.
The macOS security logs show that XProtect blocked execution and the Xcode build service was terminated, but they do not identify the exact offending script or file.
I have not bypassed macOS security protections. I would appreciate guidance on identifying the cause and resolving the build failure safely.
Steps to reproduce
- Clone the OpenVision repository and follow the setup instructions.
- Generate the Xcode project using xcodegen generate.
- Connect an iPhone 18 Pro running iOS 27.0.
- Run the following command:
xcodebuild -scheme OpenVision -project OpenVision.xcodeproj -configuration Debug -destination 'id=
- During compilation, macOS displays "Malicious Script Blocked" and the build terminates unexpectedly.
Expected result: The build completes successfully without a macOS security warning.
Actual result: XProtect blocks execution and the build does not complete.
Device & iOS version
iPhone 18 Pro, iOS 27.0
AI backend
Not sure
Local model (if applicable)
No response
Relevant logs
macOS security alert:
"Malicious Script Blocked"
"A script was blocked because it contains malware. This script did not harm your Mac."
XProtect system logs:
"Killing container due to rules engine deny"
"Prompting user about blocked scripted malware execution"
The Xcode SWBBuildService process was terminated.
The issue occurs during both parallel and single-job builds. In the single-job build, the last visible compilation task involved:
MLXCXGrammar/xgrammar/cpp/fsm.cc
The exact blocked executable or script has not been identified.
Environment:
macOS 26.0
Xcode 27.0 (27A266a)
Apple Silicon MacBook Air
Physical iPhone 18 Pro (iOS 27.0)
Thanks for the detailed report. I looked into where a blocked script could come from, and I can't find one on the project's side. What I checked:
- This repository runs exactly one build script: a four-line phase that checks
Config.xcconfigexists (project.yml→preBuildScripts, and the singleshellScriptinproject.pbxproj). No other script phases, no shell scripts in the tree. - The dependencies don't run scripts during the build either.
mlx-swift's only build plugin (CudaBuild) returns immediately on macOS because CUDA is disabled;mlx-swift-lmhas no build plugins, andMLXCXGrammar(where your build stopped) is plain C++ compiled by SwiftPM.fsm.ccwas just the last compile task before the build service was killed. - The same dependency set builds cleanly on GitHub's macOS 26 runners with every PR (see the CI badge in the README), with XProtect active and no block.
XProtect's "contains malware" wording is a signature match on a script's contents, and "rules engine deny" is the macOS 26 behavioural engine killing the process tree. Both point at something present on that Mac rather than in this repo. One known cause that fits the symptoms is the XCSSET malware family, which injects a downloader script into local Xcode projects and git checkouts and is caught by XProtect at build time.
To pin down the exact file, could you run these and paste the results (redact anything personal)?
# 1. The XProtect events from the failed build, with the signature name and the path it blocked
log show --last 2h --predicate 'subsystem CONTAINS "XProtect" OR process CONTAINS "XProtect"' --info | grep -iE "deny|block|malware|signature|path" | head -50
# 2. The macOS 26 XProtect scanner, which lists what it found
xprotect check
xprotect version
# 3. Whether your local checkout differs from the repository (XCSSET edits project files on disk)
cd OpenVision && git status --porcelain && git diff --stat
git diff -- OpenVision.xcodeproj | grep -n shellScript
grep -c shellScript OpenVision.xcodeproj/project.pbxproj # expected: 1
# 4. Any extra script phases inside the resolved packages
grep -rl "shellScript" build/DerivedData/SourcePackages/checkouts --include=project.pbxproj
If step 1 names a signature (for example something starting with MACOS.), please include it: that tells us exactly what was matched. If step 3 shows modified or untracked files you didn't create, don't build again until the machine has been checked; a clean clone into a fresh directory and a run of xprotect check first would be the safe next step.
I'll keep this open until we have the log lines. If it does turn out to be a false positive on something in the dependency tree, I'll report it upstream with the signature name.