Skip to content

Terminal auto-approval allows git show file output without confirmation #329029

Closed

Description

Problem

Terminal auto-approval treats git show as a read-only command, but git show can write directly to a file through its --output option:

git show --format=%B --output=message.txt HEAD
git show --output message.txt HEAD

Because --output is a Git option rather than a shell redirect, it does not produce a tree-sitter file_redirect node. The write-destination check is therefore not consulted, and the command can be auto-approved.

The existing default rules already require confirmation for git log --output, but not for the equivalent git show option.

Expected

  • git show --output=<path> and git show --output <path> require confirmation in both workbench and Agent Host terminal auto-approval.
  • Plain git show, git show --format=..., and similarly named options remain auto-approved.
  • Workbench and Agent Host use the same default Git rule definitions.

Activity

  1. added
    bug
    terminal-auto-approve
    on Aug 4, 2026
  2. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Aug 4, 2026
  3. vritant24 commented on Aug 10, 2026

    @vritant24
    Member

    verified with the following settings in the workspace:

    "chat.tools.terminal.enableAutoApprove": true,
    "chat.tools.terminal.ignoreDefaultAutoApproveRules": false
  4. locked and limited conversation to collaborators on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedterminal-auto-approveverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions