agent-routing.pi-input-intercept

agent-routing.pi-input-intercept is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (1,537 once invoked), scanned A, original, MIT.

A routing protocol for handling questions raised by coding agents during delegated work. It decides whether the main agent can answer from existing evidence or must ask the user.

In plain words
What is it for?
Use it to inspect delegated task results, identify genuine questions, answer questions supported by the code or rules, and escalate decisions that need user input.
Why use it?
It prevents agents from guessing when requirements, technical details, or business decisions are unclear. It also preserves the question and answer when work is sent back for another attempt.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: reads .claude/ paths; mentions Codex.

Good fit Use it to inspect delegated task results, identify genuine questions, answer questions supported by the code or rules, and escalate decisions that need user input.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/agent-routing.pi-input-intercept
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.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-routing.pi-input-intercept

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-input-intercept.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-input-intercept)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-input-intercept"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-input-intercept.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,537 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01537
Opus 5 $0.00000 $0.00768
Sonnet 5 $0.00000 $0.00307
Haiku 4.5 $0.00000 $0.00154

Measured today against content hash 63d59ee6126f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

agent-routing.pi-input-intercept 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 today.

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.

template/.cursor/rules/agent-routing.pi-input-intercept.mdc · 123 lines

How it starts

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

Agent Routing — Codex Input Intercept Protocol

核心命題

Pi machine dispatch 使用ephemeral --no-session JSON mode,沒有Codex CLI exec resume語意。Codex模型需要釐清時,prompt要求它在final response輸出## Question;主線收割dispatcher結果後先判斷能否代答,再把「原brief+已確認答案」組成一份新brief重新dispatch。

持有該 dispatch 的主線是攔截層:答案可由既有證據直接推導就代答;需要產品、業務、架構或風險拍板才升級給user。重派是新的Pi session,routing metadata與--retry-of仍完整落ledger。

Prompt附加段(每一個寫code派工 MUST加)

## Asking Questions(MUST)

遇到以下情況,直接在final response提出問題,不要猜測或做假設:

- 需求或spec有歧義,無法從context判斷正確做法
- 需要在兩個以上合理方案之間選擇,且沒有明確偏好訊號
- 缺少必要資訊(API契約、database schema、業務規則)
- brief預期行為與現有code矛盾

提問格式:final response最後輸出`## Question`,每個問題一行。提出問題的這一輪不要做不可逆動作,也不要自行選一案硬做。

問題偵測(每一次terminal收割 MUST執行)

dispatcher stdout是單一JSON。依序讀:

  1. result:成功且可解析的business payload。
  2. errorlastMessagePath:exit 3但Pi已有assistant final text時,讀該檔判斷是否為問題;NEVER只看exit 3就當機械故障。
  3. final text命中任一條件即視為問題:
    • ## Questionsection。
    • 以問號結尾,且該輪沒有成功結果或檔案變更證據。

沒有問題才按exit code正常分流。安全網control turn只檢查task狀態,NEVER提前讀output tail;terminal notification到達並claim task後才做本節判讀。

能否代答

可代答

答案可直接引用以下任一來源,且不存在合理第二解:

  • 原brief已提供但model漏讀的資訊。
  • rules/core/或consumer .cursor/rules/的明確規約。
  • 現有code、config、schema的可驗事實。
  • 上游官方文件的明確定義。

必須升級

  • 產品或業務行為選擇。
  • 架構方向或真實trade-off。
  • 資安、合規、費用或資料風險決策。
  • 主線自己也不確定的技術判斷。
  • brief與現有code矛盾,且無法證明哪邊是SoT。

灰色地帶升級。代答門檻是答案可附一條可重讀的證據來源,不是「主線覺得大概如此」。

重派契約

  1. 建立/tmp/pi-<topic>-<slug>-qa-log.md,記錄question、answer、source與auto/escalated。
  2. 產生新的brief:完整保留原brief,在末尾追加## Confirmed Answers,逐題列question、answer與source。
  3. 用原model/effort/cwd/route/tier-basis重跑dispatcher,label使用新值並帶--retry-of <prior-label>
  4. 新dispatch啟動新的Watch Protocol cycle;回來後重新做問題偵測。
  5. 同一工作連續重派3次仍在問,第4次強制升級user;這代表brief或前置資訊仍不完整。

Read the full file on GitHub · 123 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. today Changed · +2 lines 63d59ee6126f
  2. yesterday Changed 5948e5e279f6
  3. 4d ago Changed b7db06887d9d
  4. 8d ago First seen · 121 lines · 0 tokens per session scan A 0bd7fc86122a

Subscribe to this mod's changes

agent-routing.pi-input-intercept is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,537 tokens. 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.