Cursor AI Agent Cannot Access localhost via curl

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Cursor AI agent is unable to make HTTP requests to localhost using curl or other network tools. All attempts to connect to localhost result in Operation not permitted errors.

Steps to Reproduce

Ask cursor to do this:

$ curl -v http://localhost:9010/path/to/resource
* Trying 127.0.0.1:9010...
* Immediate connect fail for 127.0.0.1: Operation not permitted
* Failed to connect to localhost port 9010 after 0 ms: Couldn't connect to server
curl: (7) Failed to connect to localhost port 9010 after 0 ms: Couldn't connect to server

Even basic network operations fail:

$ ping -c 1 127.0.0.1
ping: sendto: Operation not permitted

Expected Behavior

Previously, the AI agent could successfully make curl requests to localhost services (e.g., local development servers, Docker containers exposing ports on localhost).

Operating System

MacOS

Version Information

Version: 2.4.21 (Universal)
VSCode Version: 1.105.1
Commit: dc8361355d709f306d5159635a677a571b277bc0
Date: 2026-01-22T16:57:59.675Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

Does this stop you from using Cursor

Yes - Cursor is unusable

1 Like

Hey, thanks for the report. This looks like a macOS Local Network permissions issue after updating to v2.4.21. The exact same thing happened in another thread.

Try this order:

  1. System Settings > Privacy & Security > Local Network. Check if Cursor is there and the permission is enabled.

  2. Important: sometimes macOS shows Cursor under a different name in that list. Try toggling apps one by one to find the right entry.

  3. If Cursor doesn’t show up at all, run a ping from Cursor’s regular terminal, not the agent one, for example ping 127.0.0.1. This should trigger the system permission prompt.

  4. If nothing helps, try removing Cursor from the Local Network list and restart the app. macOS should ask for permission again.

Let me know if it worked.

It looks like the update affected something. For me, the solution was this:

In the settings, the Auto run mode had somehow changed to Auto run in sandbox.
I switched it to Ask every time, and it started working.

Optionally, you can choose to always run it not in sandbox.

Thanks, folks!

1 Like