Cursor’s built-in cursor-agent-worker extension (v0.0.1, bundled with Cursor on macOS) creates its own Cursor API keys named cursor-agent-worker-ext-<host>-<pid>-<time>. It stores the key in Keychain-backed secret storage, which is good, but then it strips CURSOR_API_KEY from the child environment and launches the worker process with the key as a plain command-line argument: --api-key crsr_....
Command-line arguments on macOS are visible to any process running as the same user (ps, Activity Monitor, crash reporters, monitoring tools, other agents). So the key is effectively exposed to everything local.
The worker process also keeps running after Cursor is quit, so the exposed key stays live in the process list.
Steps to Reproduce
Open Cursor on macOS with the agent worker enabled.
In Terminal, run: ps -axo pid,command | grep cursor-agent
The full --api-key crsr_... value is shown in the worker’s command line.
Quit Cursor and run the same command again: the worker is still running with the key visible.
Expected Behavior
The key should never be passed on argv. Pass it through the environment, stdin, or an inherited file descriptor, or have the worker read it from secret storage itself. The worker should also exit when Cursor quits.
Operating System
MacOS
Version Information
macOS (Apple Silicon)
Latest stable as of Nov 1, 2026
Quitting Cursor won’t stop the worker, since it stays up for Remote Control. To stop it, open the Agents Window, go to Settings > Agents, and turn off Enable local self-hosted workers (labeled Remote Control on some versions). If it’s still running after that, let me know here.
@mohitjain Where is the config file that holds the value for the value for this setting? The toggle in the UI does not move. Other toggles work fine; it’s specifically the “Enable local self-hosted workers.” switch. I have process running to monitor tcp/udp and Cursor is noisy. Assume this is why.
@DerrckShieldsX there’s no local config file for that switch. It’s saved on your Cursor account, and on current versions the app can hold it on no matter what you choose. That’s a known issue the team is tracking, and it’s why the switch won’t move.
In the meantime, the most reliable way to stop the worker is to revoke its key:
Open your Cursor dashboard and go to the API Keys page.
Find the key whose name starts with cursor-agent-worker-ext- followed by your computer name.
Revoke it.
Cursor will still try to start the worker on launch, but it exits right away without a valid key, so nothing stays connected. Signing out of Cursor and back in creates a new key, so you’d need to revoke that one again.
@handst97 the same applies if turning the switch off didn’t stop the worker for you. Revoking that key also means the value visible in the process list no longer works. Keeping the key off the command line is tracked with the team.