How can I implement an agent with human-in-the-loop input in Cursor Agent mode?

Hi team,

I’m trying to build an agent workflow in Cursor where the agent runs in steps and pauses to request human input at certain checkpoints before continuing execution.

What I’m trying to achieve:

  • Agent executes a task

  • At certain decision points, it pauses and asks for user input/approval

  • User provides input (or approves changes)

  • Agent resumes execution using that input

Example use case:

I’m working on an agent that automatically fixes Snyk vulnerabilities when I provide a Jira ticket number (for example: XYZ-123).

Flow I want:

  1. I provide a ticket number like XYZ-123

  2. Agent fetches vulnerability details from Snyk/Jira

  3. Agent analyzes the fix (dependency update, patch, etc.)

  4. Checkpoint: Agent pauses and asks:

    • “I plan to update axios from 0.x → 1.x to fix CVE-XXXX. Proceed?”
  5. I approve or modify the suggestion

  6. Agent continues and applies the fix in code + commits changes

Note:

I tired out `AskQuetion` tool, but no luck. May be any good example to refer?

Questions:

  • Is there a recommended way to implement a human-in-the-loop (HITL) flow in Cursor Agent mode?

  • Can agent checkpoints / pauses be explicitly controlled or triggered?

  • Does Cursor support resuming an agent with new user input mid-execution?

  • Any best practices or examples for building this kind of workflow?

Any guidance would be really helpful.

Thanks!

Hey, Cursor already has a few built-in mechanics for this workflow, you just need to combine them.

  1. Plan mode for analyze, confirm, execute

Plan mode is exactly what you want for HITL. The agent is read-only, it builds a plan, asks clarifying questions via AskQuestion (this tool is always enabled in Plan mode), you confirm, and only then it switches to Agent mode and applies changes. Docs: Plan Mode | Cursor Docs

  1. AskQuestion in Agent mode via Rules

In Agent mode, AskQuestion has become more stable, but the agent rarely calls it on its own. A common community workaround is to add this to Cursor Rules (User Rules or .cursor/rules/*.mdc in your project):

Use the AskQuestion tool for any interaction requiring user input like choosing between options, confirming a proposed action, or clarifying an ambiguous request.

More details: Allow AskQuestion tool calls in Agent Mode (or any mode)

Important: with Composer/composer-1.5, AskQuestion is unstable. Report: AskQuestion tool does not work using composer-1.5 but does work with other models
It’s better to use GPT-5.3 Codex, Claude Sonnet, or Haiku.

  1. Snyk and Jira via MCP

For Jira and Snyk integration, the right path is MCP servers: Model Context Protocol (MCP) | Cursor Docs
You connect an MCP server for Jira to fetch the ticket XYZ-123 and one for Snyk to pull the CVE or fix info, then the agent can orchestrate the calls.

Suggested flow for your case:

  1. Prompt in Plan mode: Get ticket XYZ-123 from Jira, fetch vulnerability from Snyk, propose a fix
  2. The agent uses MCP to gather data, builds a plan, then asks via AskQuestion: Update axios 0.x to 1.x, proceed?
  3. You confirm, it switches to Agent mode and applies the edits plus a commit
  4. Add the User Rule above so you still get checkpoints in Agent mode

If you get stuck on something specific, like AskQuestion not firing on a certain model, tell me which model you’re using and the Request ID, and we can dig in.

Make your Agent use WriteTodo tool at the start of the call which will always lead to a predictable flow eg of todos.

  • Switch to plan mode via SwitchMode tool
  • Fetch Issue
  • Gather Context from the specific issue
  • Propose multiple solution
  • Ask questions via AskQuestion tool
  • Do a Gap Analysis
  • Write a Plan using createPlan tool

so using a structure like this would probably help you to ger a more consitent linear behaviour making it a predictable cosistent process