Numpy segfaults when imported in an agent sandbox - requires hw.physicalcpu?

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

An (apparent) issue with agent sandboxing causes a segfault when importing certain versions of the Python library numpy.

OpenAI Codex had the same problem, and someone there narrowed it down to just needing the hw.physicalcpu Seatbelt permission: fix(seatbelt): Allow reading hw.physicalcpu by tekumara · Pull Request #6421 · openai/codex · GitHub

Steps to Reproduce

For setup, run this manually:

$ python --version
Python 3.12.8

$ python -m venv venv      
$ source venv/bin/activate
$ pip install numpy==1.26.4            
Collecting numpy==1.26.4
  Downloading numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (61 kB)
Downloading numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl (13.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.7/13.7 MB 27.5 MB/s eta 0:00:00
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 2.4.3
    Uninstalling numpy-2.4.3:
      Successfully uninstalled numpy-2.4.3
Successfully installed numpy-1.26.4

Then verify that this works when you run it manually:

python -c 'import numpy; print("ok")'

But that same command segfaults when you instruct an agent to run it:

Activate this project’s virtual environment. Then, run: python -c 'import numpy; print("ok")'

[…] it crashed:

  • Command: python -c 'import numpy; print("ok")'
  • Exit code: 139 (segmentation fault)
  • No stdout output

Expected Behavior

Cursor agents should be able to run code that imports numpy.

Operating System

MacOS

Version Information

Version: 2.6.21 (Universal)
VSCode Version: 1.105.1
Commit: fea2f546c979a0a4ad1deab23552a43568807590
Date: 2026-03-21T22:09:10.098Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

For AI issues: add Request ID with privacy disabled

6226bbc6-6f69-4f64-932b-9f91a9a11cc9

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @max_at_opentrons,

Good find, and thanks for the Codex PR link. You’re right about the root cause. We’ve filed this with our engineering team.

To unblock yourself now: upgrade to numpy 2.x if your project allows it. The numpy 2.x wheels on macOS arm64 use Apple Accelerate instead of OpenBLAS, which avoids this issue entirely:

pip install "numpy>=2.0"

If you need to stay on 1.26.x, building from source should also work (it links against Accelerate rather than the bundled OpenBLAS):

pip install numpy==1.26.4 --no-binary numpy

This requires Xcode command line tools (xcode-select --install if not already installed).

1 Like