UAT: Shell danger detection classifies sudo/su as MEDIUM instead of spec-required LOW #10421

Open
opened 2026-04-18 09:37:07 +00:00 by HAL9000 · 0 comments
Owner

Summary

The spec requires sudo/su commands to be classified at LOW danger level. The implementation classifies sudo rm as MEDIUM.

Expected Behavior (from spec)

sudo/su → LOW danger level

Actual Behavior

src/cleveragents/tui/shell_safety/pattern_registry.py has:

DangerousPattern(
    name="sudo_rm",
    pattern=r"\bsudo\b.*\brm\b",
    level=ShellDangerLevel.MEDIUM,
    ...
)

This only covers sudo rm (not all sudo/su usage) and classifies it as MEDIUM instead of LOW.

The spec says sudo/su (low) — meaning any use of sudo or su should be LOW danger.

Reproduction Steps

  1. Inspect src/cleveragents/tui/shell_safety/pattern_registry.py
  2. Find sudo_rm pattern — it's MEDIUM, not LOW
  3. Run DangerousPatternDetector().check("sudo apt install vim") — returns MEDIUM (via sudo_rm if it matches, or no match)
  4. Per spec, sudo usage should be LOW

Subtasks

  • Change sudo_rm pattern level from MEDIUM to LOW
  • Broaden pattern to cover all sudo usage (not just sudo rm)
  • Add su pattern at LOW level
  • Update tests to reflect LOW classification
  • Verify existing tests still pass

Definition of Done

  • sudo <any command> detected at LOW
  • su detected at LOW
  • Tests pass

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Summary The spec requires `sudo`/`su` commands to be classified at LOW danger level. The implementation classifies `sudo rm` as MEDIUM. ## Expected Behavior (from spec) `sudo`/`su` → LOW danger level ## Actual Behavior `src/cleveragents/tui/shell_safety/pattern_registry.py` has: ```python DangerousPattern( name="sudo_rm", pattern=r"\bsudo\b.*\brm\b", level=ShellDangerLevel.MEDIUM, ... ) ``` This only covers `sudo rm` (not all `sudo`/`su` usage) and classifies it as MEDIUM instead of LOW. The spec says `sudo/su (low)` — meaning any use of `sudo` or `su` should be LOW danger. ## Reproduction Steps 1. Inspect `src/cleveragents/tui/shell_safety/pattern_registry.py` 2. Find `sudo_rm` pattern — it's MEDIUM, not LOW 3. Run `DangerousPatternDetector().check("sudo apt install vim")` — returns MEDIUM (via `sudo_rm` if it matches, or no match) 4. Per spec, `sudo` usage should be LOW ## Subtasks - [ ] Change `sudo_rm` pattern level from MEDIUM to LOW - [ ] Broaden pattern to cover all `sudo` usage (not just `sudo rm`) - [ ] Add `su` pattern at LOW level - [ ] Update tests to reflect LOW classification - [ ] Verify existing tests still pass ## Definition of Done - [ ] `sudo <any command>` detected at LOW - [ ] `su` detected at LOW - [ ] Tests pass --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
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.

Dependencies

No dependencies set.

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