Skip to content

Terminal auto-approval parity for agent host + make CLI/SDK the source of truth #326766

Description

@anthonykim1

Follow up to #323570 and #322112. Rules from chat.tools.terminal.autoApprove are forwarded to agent host and respected (#322774), but the approval experience did not come along. When a command isn't auto-approved, agent host sessions only get "Allow" (once) and "Skip".

From local harness we used to have:

  • Always Allow <command>
  • Allow <command> in this Session / in this Workspace
  • Allow Exact Command Line
  • Allow All Commands in this Session
  • Configure Auto Approve...

None of these show up in agent host copilot today, so users have to re-approve the same command over and over. Awkward part is the agent host side already offers an "Allow in this Session" option over the protocol, but our terminal confirmation UI hardcodes its two buttons and drops it on the floor.

Work needed:

  • Bring the rule-creating options back for agent host terminal confirmations (user/workspace scope can just write to the existing setting, which is already forwarded)
  • Forward session-scoped rules to the agent host process so "allow in this session" actually auto-approves later commands silently
  • Some telemetry on how often people add rules from the confirmation UI, per scope. Would be useful signal for the item below.

Bigger picture: right now VS Code owns the rules and we forward + re-parse commands ourselves. I think this should be the other way around, where Copilot CLI/SDK is the source of truth so approval behavior is consistent whether you're in VS Code, CLI in terminal, etc. The SDK already has most of the pieces (session/location scoped approvals, permissions.configure / modifyRules, persisted grants in ~/.copilot/permissions-config.json). Open questions before we can converge:

  • Rule shape mismatch: our setting is regex/matchCommandLine based, SDK grants are command-identifier based
  • SDK has no user-global allow list today, only per repo/dir
  • AHP has no standard message for standing allow/deny rules (scoped approvals are opaque option ids, approve-all is a vendor RPC)

#323570 and #322791 fall under this umbrella.

Metadata

Metadata

Assignees

Labels

agent-hostIssues for the agent-host implementation (not the protocol)terminalGeneral terminal issues that don't fall under another label

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions