MacOS sandbox blocking Docker socket connection

Hey Colin,

I’ve set the sandbox.json settings on my machine to access my docker daemon through ./Users/brendand/.docker added to additionalReadwritePaths in my machine’s top level sandbox.json

  "additionalReadwritePaths": [

    "/Users/brendand/.docker",

"/Users/brendand/.docker/run"

  ]

but get permission denied while trying to connect to the docker API at unix:////.docker/run/docker.sock

when trying to pull an image from our docker registry domain that we’ve allow listed in our enterprise settings.

This is on MacOS. Any ideas?

Claude is giving me this

”Still failing. The issue may be that on macOS, the sandbox-exec (seatbelt) implementation has specific restrictions on Unix domain sockets that can’t be lifted via file path permissions alone. The sandbox.json file path configuration might work for regular files but not for Unix sockets.

This could be a bug or limitation in Cursor’s sandbox implementation on macOS. The docs example shows “/home/me/.docker” which is a Linux path - it’s possible the Docker socket access via additionalReadwritePaths was only tested/implemented for Linux (which uses Landlock).”

Hey @bdoyle0182

Can you walk me through what actions you’re trying to take in Cursor? Steps to reproduce would be great. :slight_smile:

Yes using the official example in sandbox configuration

I can’t get the sandbox to be able to work with docker api on my mac machine using the official example additionalReadWritePaths configh and get the above permissioning errors from my previous reply.

Thanks @bdoyle0182, and sorry for the late reply!

I can reproduce this issue and have filed a bug with the team.

In the meantime, adding "networkPolicy": { "default": "allow" } would serve as a workaround. It’s broader than ideal, but it should resolve the problem temporarily.

Thanks Colin, unfortunately managing an enterprise org so can’t set up an allow all for people. Hopefully this gets fixed soon.

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Whenever Cursor agent tries to run rails tests, it fails. It will always report back and say “no local MySQL”. This appears to be some limitation of how the agent runs commands.

My local MySQL server is a docker container. If I take the exact same command that Agent tried to run and paste it into my normal Cursor terminal, it works every time.

I’ve tried changing my Agent terminal settings:

  • auto-run in sandbox and whitelist the commands (doesn’t work)
  • run everything unsandboxed, still doesn’t work

Note: This used to work intermittently, but stopped working perhaps 2-3 weeks ago. Before, Cursor would try to run it in the sandbox and it would fail, then it would retry outside the sandbox and that would usually work. Now, nothing does.

Steps to Reproduce

Have a Rails app that uses a Dockerized MySQL server
Tell Agent to run tests
Watch it be unable to connect

Expected Behavior

Agent should be able to run operations that involve connecting to Docker containers on localhost

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 2.6.20
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
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: which model did you use?

Affects all models

Does this stop you from using Cursor

No - Cursor works, but with this issue

@deanrie Saw you posted on other thread and wanted to check in if there’s any update from eng investigation. Has the team looked into it or have any ideas on a potential way for them to fix on MacOS without network allow all? Without docker access the sandbox is pretty limited for our org’s developers right now.

Just curious, did allowing network access work on your machine? I added the config to my sandbox.json and restarted Cursor:

But Cursor agent still can’t connect to the Docker database. I tried both Run everything (unsandboxed) and Auto-run in sandbox settings.

as suggested by @deanrie also made sure that Cursor is allowed on local network:

Hey, @bdoyle0182! The team is aware of this issue. It’s logged and being tracked internally. There’s no ETA yet for a proper fix that works with scoped permissions (without full network access), but your enterprise user report helps us prioritize it. I get that the workaround networkPolicy: allow isn’t acceptable for an enterprise org from a security standpoint.

I’ll post an update here when I have news.

Hey, @troehrkasse! I can see your sandbox.json is in the right place and the config looks correct. From your other screenshot, it also looks like the Local Network permission for Cursor is enabled.

Since neither the workaround nor running without the sandbox helps, this might be related to how your Docker daemon exposes the socket. A few questions:

  1. What exact error message does the agent get when it tries to connect? Full text, not just the short summary.
  2. How is Docker running on your machine? Docker Desktop, Colima, OrbStack, or something else?
  3. Can you check which socket path your Docker environment is using? Run docker context inspect in a regular terminal and share the output.

This will help us figure out if this is a different issue, separate from the sandbox bug that @bdoyle0182 reported.