FeedbackGate

A set of rules that requires an agent to ask for feedback before ending a task.

In plain words
What is it for?
Use it in agent workflows where results must be shown in the main chat and completion must be confirmed through a separate feedback prompt.
Why use it?
It creates a confirmation step so the user can request changes or signal that the work is complete.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/keunsy/cursor-feedback-gate/feedbackgate
Clone the repo
git clone --depth 1 https://github.com/keunsy/cursor-feedback-gate
Per session 1,023 This file is loaded in full into every session.
When invoked 1,023 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01023 $0.01023
Opus 5 $0.00511 $0.00511
Sonnet 5 $0.00205 $0.00205
Haiku 4.5 $0.00102 $0.00102

Measured 2d ago against content hash 0c6975953f30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

FeedbackGate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

FeedbackGate.mdc · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Feedback Gate Protocol

核心规则

完成用户请求后,禁止直接结束回复。必须调用 feedback_gate_chat MCP 工具打开弹窗,等待用户反馈。只有用户在弹窗中回复 "TASK_COMPLETE"、"Done" 等完成信号后才可结束。

⚠️ 内容分发原则(最常见的误用)

Cursor 主聊天窗口是主要回复通道,Feedback Gate 弹窗只是确认关卡。

  • 主回复(Cursor 聊天窗口):所有工作输出、分析结果、代码变更说明、命令执行结果、详细解释。
  • 弹窗 message:1-2 句话的简短摘要 + 询问是否继续/完成。
  • 绝对禁止:把完整工作结果、代码块、日志输出、长段落放进弹窗 message。

正确示例

# 主回复中:
已完成数据库迁移,新增 users 表,修改了 3 个文件...(完整内容)

# 弹窗 message:
"已完成数据库迁移。需要其他修改吗?"

错误示例

# 主回复中:(空或只有一句话)

# 弹窗 message:
"已完成数据库迁移。以下是变更详情:\n1. 新增 users 表...\n2. 修改了 migration.sql...\n3. 更新了 schema.prisma...\n..."

判断标准:弹窗 message 不应超过 100 字。如果超过,说明内容应该在主回复中。

工作流程

  1. 执行任务:正常完成用户请求(编码、分析、工具调用等)。
  2. 在主回复中输出完整结果:所有工作内容写在 Cursor 主聊天窗口。
  3. 打开 Feedback Gate:调用 feedback_gate_chat,仅传入简短摘要(≤100 字)。
  4. 处理反馈:收到用户弹窗回复后继续执行,然后再次调用 feedback_gate_chat
  5. 循环直到完成:重复步骤 3-4,直到用户发送完成信号。

工具调用格式

  • MCP Server: user-feedback-gate
  • Tool Name: feedback_gate_chat
  • 调用方式: CallMcpTool(server="user-feedback-gate", toolName="feedback_gate_chat", arguments={...})
  • 绝不假设工具不可用。如果调用报错,重试一次后再告知用户。不要因为"找不到"而跳过。
CallMcpTool:
  server: "user-feedback-gate"
  toolName: "feedback_gate_chat"
  arguments:
    message: (≤100字的简短摘要 + 提问,如"已完成XX。需要调整吗?")
    title: "Feedback Gate" (可选)
    context: (可选,用于内部追踪,不展示给用户)
    session_id: (首次调用时生成一个随机 UUID,后续所有 re-entry 调用复用同一个值)
    workspace_path: (当前项目的绝对路径)

session_id 规则

  • 首次调用:生成一个 UUID(如 crypto.randomUUID() 或类似方式),作为 session_id 传入。
  • 后续所有调用:复用同一个 session_id,包括 [WAITING] 后的 re-entry 和后续新任务的 feedback gate 调用。
  • 一个对话 = 一个 session_id,整个对话生命周期不变。不同的 Cursor agent chat 使用不同的 session_id。

约束

  • 每次回复结束前必须调用此工具,无例外。
  • 如果工具不可用,告知用户 MCP 服务器可能未运行。
  • 运行整个应用(Web 服务器、长期进程等)前需先征得用户确认。

上下文压缩后的恢复

当对话被压缩(context compaction)后,你可能在历史摘要中看到之前的 feedback_gate_chat 调用记录。无论历史中工具调用的状态如何(成功、失败、超时),每次新回复结束时都必须重新调用 feedback_gate_chat 不要因为历史中出现过工具调用失败就跳过调用。

⚠️ 强制提醒

在你生成任何回复的最后一步,你必须调用 feedback_gate_chat。这是不可跳过的。如果你发现自己即将结束回复而没有调用此工具,立即停下来调用它。

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 83 lines · 1,023 tokens per session scan A 0c6975953f30

Subscribe to this mod's changes

FeedbackGate is a cursor rule published in the GitHub repository keunsy/cursor-feedback-gate (14 stars, last pushed 29d ago), licensed MIT. It adds 1,023 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.