Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When using Cursor Agent over SSH Remote and the SSH connection becomes degraded (shell commands returning empty output despite exit code 0), spawning a background subagent via the Task tool causes the subagent to execute on the local client machine instead of the remote host.
This happens silently — no error, no warning — and the subagent proceeds to read files, modify code, run git operations, and attempt pushes against the local filesystem.
What happened:
- Parent agent was operating correctly on a remote Linux host via SSH (
/home/user/work/repoonremote) - Shell commands started returning empty output (SSH degradation)
- Parent agent spawned a
generalPurposebackground subagent with explicit remote path in the prompt - The subagent resolved its workspace to the local macOS client:
/Users/user/.cursor/projects/empty-window/agent-transcripts/... - The subagent had full write permissions and was instructed to commit and push — it attempted these on the wrong machine
- The subagent was searching through whole machine for local copy of repository triggering macos access alerts
- The subagent found local copy with different branch and different unstaged changes - proceeded to overwrite it
Security impact: A subagent with full write/execute permissions operated on a completely different machine than intended, without user consent or any error indication. This is a trust boundary violation — the subagent could read sensitive local files, modify wrong repositories, or push to wrong remotes.
Steps to Reproduce
- Connect to a remote Linux host via Cursor SSH Remote extension
- Start an Agent session (e.g. Opus 4.6) with a multi-step task involving shell operations (
ghCLI,git, file edits) - Work through multiple tool calls until the SSH connection becomes unstable — observable as shell commands returning empty stdout despite exit code 0
- Have the agent spawn a background subagent (
Tasktool,generalPurposetype,run_in_background: true) with a prompt that explicitly references the remote workspace path (e.g.,/home/user/work/repository) - Observe the subagent scanning local machine (macOS) paths (
/Users/user/.cursor/projects/empty-window/...) instead of the remote workspace - The subagent proceeds with file read/write/git operations on the local machine
Note: The SSH degradation in step 3 may be timing-dependent. In my case it occurred after ~30+ tool calls in a long session with heavy gh CLI usage.
Expected Behavior
- If the SSH remote context cannot be propagated to the subagent, the Task tool should fail with an explicit error — not silently fall back to local execution
- A subagent should never gain write access to a different machine than the one the parent agent was operating on
- Shell tool should surface SSH connection failures explicitly (returning empty output with exit code 0 masks the real error and makes the parent agent unable to detect the problem)
- The user should be notified immediately if any agent/subagent execution context changes from remote to local
Screenshots / Screen Recordings
Operating System
macOS (local)
Linux (remote)
Version Information
Version: 3.3.30
VSCode Version: 1.105.1
Commit: 3dc559280adc5f931ade8e25c7b85393842acf30
Date: 2026-05-09T18:28:42.332Z
Layout: glass
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.4.0
For AI issues: which model did you use?
Parent agent: Opus 4.6 (claude-opus-4-6)
Subagent: generalPurpose (default model, inherited from parent)
For AI issues: add Request ID with privacy disabled
Conversation ID: 24c44386-fd74-4501-a57b-094601d14121
(Request ID not available — privacy was not disabled at time of incident. The conversation transcript is available locally for Cursor team inspection if needed.)
Additional Information
Preceding symptoms (SSH degradation signals):
- Multiple shell tool calls returned empty stdout with exit code 0
- Affected commands:
gh run view,gh run list,git log,ls,echo - This happened for several consecutive tool calls before the subagent was spawned
Subagent invocation details:
- Tool:
Taskwithsubagent_type: "generalPurpose",run_in_background: true - Prompt explicitly contained info in format of: “Repository: /home/user/work/repo on branch branchname”
- The subagent was looking for similar paths on local machine
Related existing forum reports (similar but less severe):
- Cursor remote ssh insist using tools with host path — tools resolve to local paths
- Cursor tries to use local paths in remote — path crosses local/remote boundary
None of these describe the full scenario: a background subagent silently executing its entire tool chain with write permissions on the local machine.
Suggested mitigations:
- Subagent spawning must verify it inherits the same execution context (local vs SSH remote) as the parent
- If remote context cannot be established, Task tool must return an error
- Shell tool must not mask SSH failures as empty-output success
- Consider a hard workspace boundary check that blocks any agent from operating outside its configured root
Does this stop you from using Cursor
No - Cursor works, but with this issue

