Skip to content

preToolUse: silent command rewrite via updatedInput — confirmation dialog appears even with permissionDecision: allow #2643

Description

@jeziellopes

Summary

When a preToolUse hook rewrites a command using updatedInput with permissionDecision: allow, Copilot CLI v1.0.24 still shows an interactive confirmation dialog to the user on every rewritten command. There is currently no way for a hook to silently rewrite a command.

Environment

  • Copilot CLI version: 1.0.24
  • OS: Linux

Context

Consider a tool that automatically prepends a proxy prefix to dev commands (e.g. git status → proxy git status) to reduce LLM token consumption. Users install a preToolUse hook so the agent's commands are transparently rewritten without friction.

Before v1.0.24, updatedInput was not supported in Copilot CLI (#2013), so the hook used deny-with-suggestion as a workaround. When v1.0.24 shipped updatedInput support, the hook was upgraded to use updatedInput + permissionDecision: allow.

What I expected

A hook returning:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "permissionDecisionReason": "proxy auto-rewrite",
    "updatedInput": {
      "command": "proxy git status",
      "description": "check repo status"
    }
  }
}

should silently rewrite the command and run it — no confirmation needed, since:

  1. The user explicitly installed the hook (opt-in)
  2. permissionDecision is allow
  3. The rewrite is mechanical (just prepending a proxy prefix)

What happened instead

Copilot CLI shows a confirmation dialog on every rewritten command:

╭─────────────────────────────────────────────────────╮
│ Hook permission request                             │
│ ⚠ proxy auto-rewrite                               │
│                                                     │
│  Tool: bash                                         │
│  Args: {"command": "proxy git status", ...}         │
│                                                     │
│ Do you want to allow this tool call?                │
╰─────────────────────────────────────────────────────╯

This dialog appears for every single command the agent runs that gets rewritten — making the hook more disruptive than the old deny-with-suggestion workaround.

Proposed solution

Add a way for hooks to indicate a rewrite should be applied silently. Options:

Option A — permissionDecision: allow should suppress the dialog (most intuitive):

If the hook already decided allow, no confirmation should be needed.

Option B — New field showConfirmation: false:

{
  "hookSpecificOutput": {
    "permissionDecision": "allow",
    "updatedInput": { ... },
    "showConfirmation": false
  }
}

Option C — New permissionDecision value "silent-allow" or "allow-silent"

Option A seems most consistent with the existing semantics — allow already means the hook approved it.

Impact

Without silent rewrite, updatedInput is not practical for high-frequency mechanical rewrites (like token optimization proxies). The old deny-with-suggestion workaround was less disruptive because denials are handled gracefully by the agent without surfacing a modal to the user.

cc @MRayermannMSFT (from #2013)

Activity

  1. examon commented on Apr 12, 2026

    @examon

    This was fixed across two releases. In v1.0.18, permissionDecision: "allow" was updated to suppress the tool approval prompt. In v1.0.24, updatedInput support was added so hooks can rewrite tool arguments before execution. These features compose, so returning allow together with updatedInput on v1.0.24 should rewrite the command without showing a dialog. If you are still seeing the prompt on v1.0.24, please comment with a minimal repro or sanitized hook output and we will take another look.

  2. jeziellopes commented on Apr 13, 2026

    @jeziellopes
    Author

    Confirmed still happening on v1.0.24. Here's a minimal repro.

    Hook config (.github/hooks/rtk-rewrite.json)

    {
      "hooks": {
        "PreToolUse": [
          {
            "type": "command",
            "command": "proxy-hook",
            "cwd": ".",
            "timeout": 5
          }
        ]
      }
    }

    Hook input (from Copilot CLI)

    {"toolName":"bash","toolArgs":"{\"command\":\"git log --oneline -3\",\"description\":\"check repo\"}"}

    Hook output (what the hook returns)

    {
      "hookSpecificOutput": {
        "hookEventName": "PreToolUse",
        "permissionDecision": "allow",
        "permissionDecisionReason": "proxy auto-rewrite",
        "updatedInput": {
          "command": "proxy git log --oneline -3",
          "description": "check repo"
        }
      }
    }

    What happened

    Despite permissionDecision: allow, Copilot CLI v1.0.24 shows this dialog:

    ╭──────────────────────────────────────────────────────────────────╮
    │ Hook permission request                                          │
    │ ⚠ proxy auto-rewrite                                            │
    │                                                                  │
    │  Tool: bash                                                      │
    │  Args: {"command": "git log --oneline -3", "description": "..."}│
    │                                                                  │
    │ Do you want to allow this tool call?                             │
    │ ❯ 1. Yes                                                         │
    │   2. No (Esc to stop)                                            │
    ╰──────────────────────────────────────────────────────────────────╯
    

    Note: the dialog shows the original args, not the rewritten updatedInput. The permissionDecisionReason ("proxy auto-rewrite") is shown as the dialog title, which confirms the hook output was received — but the dialog still appears.

    This happens on every rewritten command. A mechanical rewrite hook where the user explicitly opted in by installing the hook becomes unusable because it interrupts every single agent command.

  3. ChristofferKarlsson commented on Apr 14, 2026

    @ChristofferKarlsson

    Experiencing the same thing as @jeziellopes, and the problem is still present on 1.0.25, @examon.

  4. specter119 commented on Apr 15, 2026

    @specter119

    @examon this was not fixed.

  5. reopened this on Apr 29, 2026
  6. examon commented on Apr 29, 2026

    @examon

    @jeziellopes Thanks for the concrete repro. I retested this with an isolated Copilot CLI v1.0.39 and a fresh config containing only the posted PreToolUse hook. In that run, permissionDecision: "allow" plus updatedInput rewrote the bash command to the proxy command, executed the proxy command, and did not show a Hook permission request dialog.

    To find the delta with the failing setup, could you please share three details from a single failing run?

    1. Can you reproduce in a fresh empty config with only the posted PreToolUse hook? If yes, could you please share the exact launch command/config path?
    2. For one failing tool call, please share the raw hook stdin, stdout, stderr, and exit status exactly as Copilot CLI saw them (before any jq or formatting, etc.)
    3. From that same run, please share the exact dialog text and what executes after approving: the original command or the rewritten proxy command.

    Thanks a lot

  7. added theissue type on Apr 29, 2026
  8. added
    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents
    on Apr 29, 2026
  9. bigfoot88 commented on May 5, 2026

    @bigfoot88
    Image Image

    我使用copilot --yolo,运行过程中遇到rtk时总是弹出这个询问的页面。请问如何解决?

  10. vinciest commented on May 9, 2026

    @vinciest

    Same here with 1.0.44, every tool call gets a "Hook permission request" when using RTK even with /yolo enabled. 😮‍💨

  11. asule90 commented on May 15, 2026

    @asule90

    same here with rtk
    rtk-ai/rtk#1155 (comment)

  12. rohitpagariya commented on May 25, 2026

    @rohitpagariya

    I'm running into this problem also, and I'd love to see this prioritized and fixed.

  13. jaderocks commented on Jun 17, 2026

    @jaderocks

    So do we have solution for this?

  14. Jonas-Tieto commented on Jun 24, 2026

    @Jonas-Tieto

    I still have this issue in v1.0.64-3 ... @CopiloTTeam can we get an updated timeline on this?

  15. vinciest commented on Jun 25, 2026

    @vinciest

    Reporting back, I've got this work with a custom extention and been using RTK fine with Copilot CLI for a while, you can run rtk gain --history to verify if it's really working.
    https://gist.github.com/vinciest/900d2712aad394e5c8f359e27be8ca89

  16. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the report. We've shipped fixes in this area since this was filed, and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agentsmore-info-needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions