Ask Mode Terminal Commands

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I was asking Opus 4.6 1M High questions in the Cursor chat about some bug with my codebase in Ask mode. I realized there was an issue that I wanted to revert and told the agent to use git to revert the change (didn’t realize I was in ask) and then it started running in the terminal.

I later realized it was in Ask mode, but let it continue since these changes were fine for what I wanted to do, but then while I wasn’t looking Opus kept running terminal commands and staged the reverted file and then tried to commit and push it to remote. In Ask mode there should definitely be a hard ban (any way to strictly enforce it through the CLI tool rather than LLM instructions) on even calling git push, much less commit / revert. Absolutely crazy stuff.

Steps to Reproduce

Directly asking the agent to perform git terminal commands that make changes to the code and / or remote.

Operating System

MacOS

Version Information

Version: 3.9.16 (Universal)
VS Code Extension API: 1.105.1
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80
Date: 2026-06-27T06:41:01.941Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Darwin arm64 25.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

indeed, can be concerning. Would you mind going back into this chat, clicking the 3 dots and sharing the request ID ? with that, team will be able to look into it and see why the model bypassed the /ask mode restrictions

Hey, thanks for the detailed report. Git commit or push from Ask mode is a really unpleasant surprise.

Here’s how it works right now. Ask mode removes edit apply and MCP tools, but the terminal itself isn’t hard blocked at the tool level. Write protection relies on a read only sandbox, which isn’t always active yet. It depends on whether the OS sandbox is enabled. When the sandbox isn’t active, shell commands in Ask mode, including git add git commit git push, can run with full access. So this isn’t the model bypassing instructions. It’s that the hard block on the terminal in Ask mode isn’t enforced at the tool level yet. This is a known limitation and it should be tightened, but I don’t have a timeline for it right now.

For now, here’s a workaround to guarantee no writes:

  • Set Auto Run so every command needs confirmation. Don’t use an allowlist or auto mode that approves itself.
  • When you actually need changes, switch to Agent mode with manual approve, instead of asking git to run in Ask mode.

Also, like @Tom_Coustols said above, if you share the Request ID from this chat, it’ll help us look at your exact case. Three dots in the top right of the chat > Copy Request ID.

Sorry for the late response and thanks for the explanation. The request id is here: 044deb48-dd39-47aa-861f-96db7fa6a989. Unfortunately, privacy mode is on because it is on an enterprise version of Cursor, so I’m not sure if the request can be accessed. I can provide other information that would help, but it is difficult because of the IP protections.

Thanks for the Request ID. There’s an important detail though: since Privacy Mode is enabled and it’s on by default on Enterprise, we don’t store request data. So we most likely can’t pull up the details from that ID. That’s expected, no worries, and there’s no need to try to fetch anything else because of IP restrictions.

For your case, we don’t actually need the request anyway. What you described fits a known limitation I mentioned above. It’s not that the model is ignoring instructions, it’s that in Ask mode the terminal hard-block isn’t consistently enforced at the tool level. Write protection depends on the read-only sandbox, and that isn’t always active. So digging into your specific request won’t add anything new.

The limitation is known and the team is aware, but I don’t have a fix timeline yet. For now, the workaround is the same:

  • Set Auto-Run so every command requires confirmation, and don’t use an allowlist or auto mode that approves itself.
  • When you actually need changes, switch to Agent mode with manual approve, instead of asking for git commands in Ask mode.

Let me know if anything else comes up.

It sems like the Cursor team has acted on this bug report, but instead of only blocking the mutating commands like git commit, git revert, and git push, they blocked all terminal access while in Ask Mode, even when using an allowlist full of vetted read-only commands. So now the Ask Mode agent cannot run useful read-only commands like git log, git diff, git status. See the following posts:

The workaround is to use Agent Mode instead of Ask Mode, but then the agent has access to its file edit tools.

Hey, you laid it out correctly, and thanks for not just pointing it out here but also filing a separate feature request Configurable read-only shell access in Ask Mode. That’s the right place where we track this.

Quick status update: the original block was tightened for write safety, and on environments where the OS sandbox isn’t available (like Windows in your case), Shell in Ask mode is currently disabled entirely, with no allowlist-aware middle option. So read-only commands like git log, git diff, and git status got caught by the same block as mutating ones, yes, it’s broader than we’d like.

All three items in your request are logged, including that the agent fails the command silently and doesn’t mention the block in the main reply. It’s on the team’s radar, but I can’t share a timeline yet.

It makes sense to keep further discussion in your FR thread so the context and votes stay in one place. I’ll follow up when there’s an update.

Sharing a note with the community on the misleading confinement of the CLI agent in Ask mode.

--mode ask is not isolation (cursor agent 2026.09.02-c22c1a3)

This looks like a confined, read-only headless call. It isn’t:

cursor agent --print --mode ask --trust \
  --workspace /tmp/some-empty-dir \
  --output-format text \
  "Read prompt. Answer in JSON object."
  • --print still has Shell (and writes) unless something else blocks them.
  • --mode ask is not a process jail.
  • --workspace is not a chroot.
  • --trust only skips the trust dialog.

Without --sandbox enabled, that combo did run Shell and did read paths outside the tmpdir.

After a couple of tests I figured out that --sandbox enabled is not confinement either. here are the results I got using --mode ask and--sandbox enabled

Capability Observed
Shell (incl. pwd / echo / ls . / python3) Blocked
Write / edit Blocked
Delete Blocked
MCP execute (e.g. calendar list_calendars) Blocked
WebFetch Blocked
Task / subagent Allowed
MCP catalog (getMcpTools) Allowed
Read / Glob / Grep Allowed, including files outside the workspace (/etc/hosts, ~/.zshrc)

Hey, thanks for the detailed breakdown. The table is especially helpful.

Your notes mostly match how it works today. Key point: --mode ask, --workspace, --trust, --print were never meant to be isolation or a process jail. --mode ask disables edit/apply and MCP-execute, --workspace sets the working directory (not chroot), --trust only skips the trust dialog.

--sandbox enabled protects against write, delete, network, and exec (which matches your table: Shell/Write/Delete/MCP-execute/WebFetch are blocked). It’s a write and network guard, not read confinement. So Read/Glob/Grep aren’t limited to the workspace, and reading /etc/hosts or ~/.zshrc under the current design is expected behavior, not a bypass.

If you need to truly restrict reads (and writes) by path, use the permissions allow/deny rules in ~/.cursor/cli-config.json or the project <project>/.cursor/cli.json. For example, you can add Read(.env*) or other sensitive paths to deny:

I’ll pass along the point about Task/subagent and the MCP catalog still being available in ask + sandbox. There’s separate discussion about subagent behavior in Ask mode. I can’t share an exact timeline.

Also noted that this flag set can look like confinement even though it isn’t. I’ll share that feedback so expectations are clearer. If you want read scoping in ask/sandbox tracked separately, it’s best to open a dedicated thread so the context and +1s don’t get lost. Let me know if anything else comes up.