Cursor 为操控其桌面 AI 代理构建了一个隐藏的终端命令

RuntimeWire 在 Cursor 3.16.17 中发现,Cursor 已经构建了一个可用的命令行桥接,允许外部脚本查找并控制已在其桌面应用中运行的 AI 代理对话。

By · Published · Updated

RUNTIMEWIRE INVESTIGATION — Scoop

Original reporting by RuntimeWire, based on reverse engineering, testing.

Why it matters

Desktop Bridge turns visible Cursor conversations into scriptable workers, giving developers a local supervision layer while expanding what same-user processes can tell desktop agents to do.

Reporting record

Finding

Cursor 3.16.17 contains a working, gated Desktop Bridge that lets the bundled cursor CLI enumerate agent threads open in Cursor Desktop and submit follow-up instructions to them.

How we verified

Methods: reverse engineering, testing.

Cursor’s packaged application contains the cursor desktop CLI parser and help text, an authenticated local Desktop Bridge service, a gated Beta settings card, and desktop handlers for listing and messaging agent threads. In a reporter-owned test, cursor desktop ls --json returned the prepared thread’s ID, title, completed status, local source and window ID. cursor desktop send reported that the follow-up was submitted. Cursor Desktop displayed the terminal-sent instruction and returned the exact requested response: DESKTOP-BRIDGE-LIVE-OK. Cursor’s CLI guide and CLI changelog contained no reference to cursor desktop or Desktop Bridge when reviewed on August 18, 2026.

RuntimeWire extracted and examined the packaged JavaScript from Cursor’s stable Windows x64 build, version 3.16.17. We confirmed the build version, commit and date from package.json and product.json, then traced the desktop_bridge feature gate, disabled-by-default user setting, local bridge startup, discovery mechanism, bearer authentication, CLI commands and desktop message handlers. We activated the feature through Cursor’s built-in test-feature mechanism, enabled “Allow CLI to access desktop agents” in the exposed Beta card and restarted Cursor with real agent HTTP enabled. We created a disposable thread on a reporter-controlled account, enumerated it through cursor desktop ls --json and sent a deterministic no-operation instruction through cursor desktop send. The agent returned the exact requested token inside the original desktop conversation. We preserved screenshots and calculated SHA-256 hashes for the source archive, relevant application files and successful test image. No third-party account, conversation or data was accessed.

Tested versions: Cursor 3.16.17, Windows x64 stable, commit 6b2afae0257df2bb5e1835f15165dc2f0de056b0, built 2026-08-14T01:41:12.803Z.

Reproduction

RuntimeWire independently reproduced the core finding.

Requirements: Cursor 3.16.17 for Windows x64 and a reporter-controlled Cursor account. Quit every running Cursor process. Launch Cursor with its built-in smoke-test driver, real agent HTTP and the desktop_bridge feature override: $CursorExe = "$env\Programs\cursor\Cursor.exe" $DesktopBridgeFlag = "eyJkZXNrdG9wX2JyaWRnZSI6dHJ1ZX0=" Start-Process -FilePath $CursorExe -ArgumentList @( "--glass" "--enable-smoke-test-driver" "--smoke-test-use-real-agent-http" "--test-feature-flags=$DesktopBridgeFlag" ) Open Cursor Settings → Beta. Enable “Allow CLI to access desktop agents.” Quit Cursor completely and relaunch it with the same arguments. Create a disposable agent thread titled “Bridge thread readiness.” Ask it to reply with BRIDGE-THREAD-READY without editing files or running commands. In PowerShell, locate the thread: $CursorCmd = "$env\Programs\cursor\resources\app\bin\cursor.cmd" $Threads = (& $CursorCmd desktop ls --json) | ConvertFrom-Json $Target = $Threads | Where-Object { $_.title -eq "Bridge thread readiness" } | Select-Object -First 1 Confirm that $Target contains an ID, title, status, source and window ID. Submit the follow-up: & $CursorCmd desktop send $Target.id "Reply with exactly DESKTOP-BRIDGE-LIVE-OK. Do not edit files or run commands." Confirm that PowerShell reports the message as submitted and that DESKTOP-BRIDGE-LIVE-OK appears inside the original Cursor Desktop conversation.

File hashes

  • sha256 resources/app/out/cli.js
  • sha256:4ca5f52518ec5fea1a0c4732c6216dc45182b59a1fe2146d3f9ad6062a3490cd resources/app/out/main.js
  • sha256:50ec9d3e80b9f797378eb1a6896ecdadc3a0e3daabe9fec440a1f4e2d6c1878d resources/app/out/vs/workbench/workbench.glass.main.js
  • sha256:2100a37e6ddd23fd3f0adf982dcd6779a525c25f0d6acb9fa0683a44cb947592 resources/app/out/vs/workbench/workbench.desktop.main.js
  • sha256:9dabecdb4d25cdf8a7b29800fa186bd227b25483789cd7536bbe68b2c5cd92f2 successful-desktop-bridge-test.png

Company response

RuntimeWire requested comment; the company had not responded by publication time.

A tiny computer monitor on a vast desk shows a command-line window sending instructions to an AI agent conversation in a desktop application.

该功能名为 Desktop Bridge。它增加了一个隐藏的 cursor desktop 命令,包含两个操作:

cursor desktop ls cursor desktop send <thread> [text...]

RuntimeWire 在一台由记者控制的 Windows 安装上激活了受门控的功能,并针对一个一次性代理线程进行了测试。ls 命令返回了会话的 ID、标题、来源、状态和窗口编号。然后 RuntimeWire 使用 PowerShell 将一条新指令发送到已完成的线程:

Reply with exactly DESKTOP-BRIDGE-LIVE-OK. Do not edit files or run commands.

命令行报告消息已提交到所选线程。Cursor Desktop 在现有对话中显示了该指令,启动了新的代理轮次并返回了 DESKTOP-BRIDGE-LIVE-OK。

该结果证实了 Desktop Bridge 在从 shell 到 Cursor 的图形应用内代理的完整路径上可用。它也为开发者提供了一种方法,可以在不手动打开每个对话并键入另一个提示的情况下,围绕 Cursor Desktop 构建监督机制。

A command that appears only when the bridge is alive

Desktop Bridge 被编译进日期为 2026 年 8 月 14 日的 Cursor 稳定 Windows 构建中。RuntimeWire 检查的副本自述为版本 3.16.17,commit 6b2afae0257df2bb5e1835f15165dc2f0de056b0。

访问受两道控制。一项名为 desktop_bridge 的服务器下发功能门控决定 Cursor 是否显示一个 Beta 设置卡片。该卡包含一个单独的、默认关闭的开关,标注为“Allow CLI to access desktop agents。”Cursor 提示用户在更改后重启应用。

在正常启动条件下,Desktop Bridge 卡片并未出现在 RuntimeWire 的账户上。RuntimeWire 使用 Cursor 内置的测试标志机制暴露了该卡片,启用了用户设置并在进行实时测试前重启了应用。

当本地桥不可用时,该命令会隐藏自身。Cursor 的 CLI 在将 desktop 解析为子命令前会检查是否存在实时发现记录。在 RuntimeWire 首次在桥禁用情况下的测试中,cursor desktop ls 未产生线程列表,Cursor 将 desktop 当作文件系统目标处理,打开了一个同名的编辑器标签页。

一旦桥启动,相同的命令显示了其帮助文本:“在正在运行的 Cursor desktop 应用中与聊天线程交互。”

截至 8 月 18 日,Cursor 当前的 CLI 指南和 CLI 更新日志中都未提及 cursor desktop 或 Desktop Bridge。8 月 11 日的 CLI 发行说明确实记录了在基于终端的代理会话内的引导。Desktop Bridge 则穿越了不同的边界:它将 shell 指令发送到桌面应用中打开的会话。

What Desktop Bridge can do

该实现最多可以枚举跨运行中的 Cursor desktop 实例的 200 个线程。其结构化的 JSON 输出使得列表可被脚本使用,包含线程 ID、标题、来源、状态、更新时间、窗口和应用实例等字段。

desktop send 接受完整线程 ID 或唯一前缀。它可以从命令行参数或标准输入读取指令。如果所选代理正在工作,默认行为是将新消息排队,直到当前轮次结束。--force 选项则立即提交并中断活动轮次。

Cursor 的代码识别 local、cloud、draft 和 Claude Code 线程来源。它拒绝向草稿和 Claude Code 线程发送消息。RuntimeWire 在本地 Cursor 代理上验证了列出和发送功能。我们未对中断选项或云来源线程进行实时测试。

当前的命令集无法创建新代理、检索记录或将代理的回复打印回终端。其角色更窄:查找存在于 Cursor Desktop 中的会话并向其中推送指令。

这已足以支持一个基本的控制循环。本地进程可以以 JSON 的形式轮询线程状态,决定哪个已完成的代理需要另一个任务,为忙碌的代理排队后续任务,或在外部条件变化时中断运行。Cursor 已通过其 CLI 和 SDK 记录了无头代理、自动化和可编程代理;Desktop Bridge 将那些脚本化模式连接到已在桌面界面中可见的工作。

A separate bridge from Cursor's public SDK

Cursor 还为一个名为 SDK Bridge 的产品发布了文档。两座桥承担不同的工作。

SDK Bridge 将 Cursor 的 agent SDK 嵌入其中,并公开了一个用于创建、恢复和操作可编程代理的文档化协议。Desktop Bridge 位于桌面应用内部,目标是已在那里的会话。它使用普通的 cursor 启动器,而非独立的 cursor-sdk-bridge 二进制文件。

Desktop Bridge 背后的本地服务似乎旨在防止任意未认证请求。启动时,它会创建一个随机的 64 字符 bearer token 和一个单独的 renderer-invocation token。CLI 通过存放在用户 .cursor/desktop-bridge 目录下的记录发现本地套接字和 bearer token。每个请求必须先进行认证,桌面进程才会列出或发送线程。在遵守 POSIX 文件模式的系统上,代码以仅属主用户可见的权限创建该目录和发现文件。

这些控制保护桥免受未认证的本地调用。任何已以相同操作系统用户身份运行的进程仍可能读取用户拥有的文件,这使得在更广泛部署之前明确 Cursor 的预期威胁模型和企业控制成为重要问题。

该功能的实现足够成熟,能够处理多个运行中的 Cursor 实例、陈旧的发现记录、模糊的线程前缀、超时、认证失败和消息大小限制。其门控接口和缺失的文档使其发布状态仍不明朗。

目前,Cursor 3.16.17 包含一个可用的从 shell 到桌面的控制界面。RuntimeWire 的测试显示,它可以定位一个真实会话、注入一条新指令,并使桌面代理在用户不通过 Cursor 界面提交该提示的情况下完成另一轮次。

Reader comments

Conversation for this story loads after sign-in.