Skip to content

Harden sed parsing for terminal auto-approval edge cases #328898

Open

Description

Follow-up to #328882.

The immediate fix reuses the existing workbench SedFileWriteParser to block canonical sed -i / --in-place forms in Agent Host. Broader parsing and destination-aware alignment should be handled separately so the initial fix stays small.

Potential follow-up areas:

  • Shell-dialect-aware executable matching, quoting, and backslash handling.
  • Quoted, escaped, abbreviated, and runtime-expanded option words.
  • GNU versus BSD sed -i interpretation and PATH-selected implementations.
  • Backup suffix destinations, including suffixes containing *.
  • Glob/runtime-expanded targets and --follow-symlinks behavior.
  • Destination-aware Agent Host approval for statically resolvable in-place edits, aligned with workbench behavior.
  • Ensure forwarded and full-command allow rules cannot bypass ambiguous or rejected writes.

Add focused cross-platform tests before expanding the parser.

Activity

  1. added
    terminal-auto-approve
    on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

terminal-auto-approve

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions