Skip to content

Agent Host auto-approves sed in-place edits #328901

Closed

Description

Problem

Agent Host's terminal auto-approval rules allow normal sed commands, but do not distinguish in-place editing forms such as:

sed -i 's/foo/bar/' file.txt
sed --in-place 's/foo/bar/' file.txt

These forms modify files through command arguments rather than shell redirects, so the existing redirect write check does not see them. As a result, a recognized sed command can be auto-approved even though it edits a file directly.

Workbench already detects canonical sed in-place forms through its command-specific file-write parser.

Expected

  • Agent Host should require confirmation for canonical sed in-place forms, including -i, -I, clustered/backup-suffix variants, BSD empty suffixes, and --in-place.
  • A configured full-command allow rule should not override this check.
  • Normal non-in-place sed commands should retain their existing auto-approval behavior.
  • Workbench file-write behavior and settings should remain unchanged.

Broader shell-dialect and dynamic-option hardening is tracked separately in #328898.

Activity

  1. added
    terminal-auto-approve
    bug
    on Aug 4, 2026
  2. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Aug 4, 2026
  3. 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-approve

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions