Skip to content

Integrate DCG with command auto-approval and denied-command UX #1058

Description

@navedmerchant

Parent

Part of #1049. This is the fourth and final independently reviewable slice of the Destructive Command Guard work.

Dependency

Depends on the persisted DCG setting and service slices.

Problem

When command auto-approval and DCG are enabled, safe complex/generated commands should run without the legacy allowlist interrupting them, while DCG-blocked commands must retain an explicit approval boundary and clear denial feedback.

Scope

  • Evaluate commands with DCG before asking for command approval.
  • Allow DCG-approved commands to bypass the legacy allowlist only when command auto-approval and DCG are both enabled.
  • Mark DCG-blocked commands as protected so they always require explicit user approval.
  • Preserve existing allowlist/denylist behavior when DCG is disabled.
  • Record auto-deny decisions in command messages and render a dedicated denied state in chat.
  • Show localized DCG reason/rule details when available and hide allow/deny pattern controls where they do not apply.
  • Add focused extension and webview regression tests for policy precedence, command execution, message persistence, and denied rendering.

Acceptance criteria

  • DCG-approved commands auto-run only when command auto-approval is enabled.
  • DCG-blocked commands cannot cross the explicit approval boundary automatically.
  • User approval can still execute a DCG-blocked command; user denial does not execute it.
  • DCG-disabled behavior is unchanged.
  • Denied commands render a clear localized status and optional reason/rule metadata.
  • Focused command-policy, tool, message, and chat tests pass.
  • The complete stacked branch type-checks/builds and the combined feature runs.

Stack

Base: the persisted-setting PR. This final PR completes #1049.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions