feat(tui): implement shell safety blocking mode and ! command safety confirmation #5453

Open
opened 2026-04-09 06:53:48 +00:00 by HAL9000 · 1 comment
Owner

Background

Part of Epic #5310 (TUI Safety & Permission System). The TUI must implement shell safety behaviors: blocking mode prevents shell commands from executing without explicit approval, and the ! shell mode trigger requires safety confirmation for dangerous commands.

Per ADR-044 and the spec, the TUI has two shell safety modes:

  • blocking: Shell commands are blocked until user explicitly approves via PermissionsScreen
  • non-blocking: Shell commands execute with a warning notification

Expected Behavior

  • ShellSafetyMode enum with blocking and non_blocking values
  • ! prefix activates shell mode; dangerous commands (rm -rf, sudo, etc.) trigger confirmation
  • In blocking mode: shell command is queued, PermissionsScreen shown for approval
  • In non-blocking mode: shell command executes with a warning notification
  • Safety profile display in TUI settings showing current shell safety mode
  • $ prefix also activates shell mode (per spec — both ! and $ are shell triggers)

Subtasks

  • Implement ShellSafetyMode enum and integrate with TUI app state
  • Implement dangerous command detection heuristics (rm -rf, sudo, chmod 777, etc.)
  • Wire ! and $ prefix detection in PromptInput to shell mode activation
  • Implement blocking mode: queue command, show PermissionsScreen for approval
  • Implement non-blocking mode: execute with warning notification
  • Add safety profile display in TUI settings panel
  • Write Behave unit tests for shell safety logic

Definition of Done

  • Both shell safety modes functional
  • ! and $ prefixes activate shell mode
  • Dangerous commands trigger confirmation in blocking mode
  • Safety profile display works in TUI
  • All nox stages pass
  • Coverage >= 97%

Metadata

  • Branch: feat/tui-v370/safety-permissions
  • Commit Message: feat(tui): implement shell safety blocking mode and ! command safety confirmation
  • Milestone: v3.7.0
  • Parent Epic: #5310
  • Depends on: #5335 (PermissionsScreen must exist first)

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Background Part of Epic #5310 (TUI Safety & Permission System). The TUI must implement shell safety behaviors: blocking mode prevents shell commands from executing without explicit approval, and the `!` shell mode trigger requires safety confirmation for dangerous commands. Per ADR-044 and the spec, the TUI has two shell safety modes: - **blocking**: Shell commands are blocked until user explicitly approves via PermissionsScreen - **non-blocking**: Shell commands execute with a warning notification ## Expected Behavior - `ShellSafetyMode` enum with `blocking` and `non_blocking` values - `!` prefix activates shell mode; dangerous commands (rm -rf, sudo, etc.) trigger confirmation - In blocking mode: shell command is queued, PermissionsScreen shown for approval - In non-blocking mode: shell command executes with a warning notification - Safety profile display in TUI settings showing current shell safety mode - `$` prefix also activates shell mode (per spec — both `!` and `$` are shell triggers) ## Subtasks - [ ] Implement `ShellSafetyMode` enum and integrate with TUI app state - [ ] Implement dangerous command detection heuristics (rm -rf, sudo, chmod 777, etc.) - [ ] Wire `!` and `$` prefix detection in PromptInput to shell mode activation - [ ] Implement blocking mode: queue command, show PermissionsScreen for approval - [ ] Implement non-blocking mode: execute with warning notification - [ ] Add safety profile display in TUI settings panel - [ ] Write Behave unit tests for shell safety logic ## Definition of Done - [ ] Both shell safety modes functional - [ ] `!` and `$` prefixes activate shell mode - [ ] Dangerous commands trigger confirmation in blocking mode - [ ] Safety profile display works in TUI - [ ] All nox stages pass - [ ] Coverage >= 97% ## Metadata - **Branch**: `feat/tui-v370/safety-permissions` - **Commit Message**: `feat(tui): implement shell safety blocking mode and ! command safety confirmation` - **Milestone**: v3.7.0 - **Parent Epic**: #5310 - **Depends on**: #5335 (PermissionsScreen must exist first) --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.7.0 milestone 2026-04-09 06:54:39 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#5453
No description provided.