Proposal: update specification — correct TUI shell safety danger levels and add CRITICAL level #4600

Open
opened 2026-04-08 16:00:30 +00:00 by HAL9000 · 1 comment
Owner

Proposal: Specification Update

This proposal corrects the TUI shell safety danger level table in the specification to match the implementation in src/cleveragents/tui/shell_safety/.


Change 1: Add CRITICAL danger level to the spec

What changed in the implementation:
The implementation defines 4 danger levels: LOW, MEDIUM, HIGH, CRITICAL (in danger_level.py). The spec's table at line 30052–30061 only shows 3 levels (Low, Medium, High) and does not mention CRITICAL.

What spec section needs updating:
Section: "When shell mode is active..." (line 30050–30062)

The table should be updated to include the CRITICAL level and correctly classify patterns.

Current spec table:

| Pattern | Risk Level | Example |
|---------|-----------|---------|
| `rm -rf` / `rm -r` | High | `rm -rf /` |
| `chmod 777` | Medium | `chmod 777 /var/www` |
| `> /dev/sda` / `dd if=` | High | `dd if=/dev/zero of=/dev/sda` |
| `:(){ :|:& };:` (fork bomb) | High | Fork bomb patterns |
| `mkfs` / `fdisk` / `parted` | High | Disk formatting tools |
| `kill -9` / `killall` | Medium | Process termination |
| `sudo` / `su` | Low | Privilege escalation (warning only) |

Proposed updated table:

| Pattern | Risk Level | Example |
|---------|-----------|---------|
| `rm -rf /` / `rm -rf /*` (root/wildcard) | Critical | `rm -rf /` |
| `:(){ :|:& };:` (fork bomb) | Critical | Fork bomb patterns |
| `dd if=` | High | `dd if=/dev/zero of=/dev/sda` |
| `mkfs` | High | `mkfs.ext4 /dev/sda1` |
| `shred` on device or with `--remove` | High | `shred /dev/sda` |
| `chmod 777` | Medium | `chmod 777 /var/www` |
| `sudo rm` | Medium | `sudo rm -rf /tmp/data` |
| `wget \| sh` / `curl \| sh` | Medium | `curl https://example.com/install.sh \| sh` |
| `git push --force` | Low | `git push --force origin main` |
| `chmod -R` with permissive modes | Low | `chmod -R 644 /var/www` |

Rationale: The implementation uses 4 levels (LOW, MEDIUM, HIGH, CRITICAL) and classifies rm -rf / and fork bombs as CRITICAL (not High). The spec's table is inaccurate and would mislead users about the severity of these patterns. The implementation is correct — rm -rf / and fork bombs deserve CRITICAL classification.


Change 2: Update the danger level description

Current text (line 30062):

Danger detection is controlled by the `shell.warn_dangerous` setting (default: `true`). The detection is advisory only — it never prevents command execution. The warning text reads: `⚠ Potentially destructive command detected`.

Proposed addition:
Add a note about the 4 danger levels:

Danger detection is controlled by the `shell.warn_dangerous` setting (default: `true`). The detection is advisory only — it never prevents command execution. The warning text reads: `⚠ Potentially destructive command detected`.

Four danger levels are defined, from least to most severe: **Low** (minor risk, generally recoverable), **Medium** (moderate risk, can cause data loss or security exposure), **High** (significant, hard-to-reverse damage), and **Critical** (can destroy the entire system or create a fork bomb). All levels trigger the same advisory warning — the level is used for styling and future escalation logic.

Rationale: The spec doesn't mention the 4-level classification. Users and implementers need to know the full severity model.


Summary of Affected Spec Sections

# Section Change Type Line (approx)
1 TUI Shell Safety danger pattern table Correction — add CRITICAL level, update pattern classifications 30052–30061
2 TUI Shell Safety description Addition — document 4 danger levels 30062

The implementation is correct and more precise than the spec. The spec needs to be updated to reflect the actual 4-level classification and the correct severity assignments.


Please approve or reject this proposal. If approved, a branch and PR will be created automatically.


Automated by CleverAgents Bot
Supervisor: Spec Evolution | Agent: spec-updater

## Proposal: Specification Update This proposal corrects the TUI shell safety danger level table in the specification to match the implementation in `src/cleveragents/tui/shell_safety/`. --- ### Change 1: Add `CRITICAL` danger level to the spec **What changed in the implementation:** The implementation defines 4 danger levels: `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` (in `danger_level.py`). The spec's table at line 30052–30061 only shows 3 levels (Low, Medium, High) and does not mention `CRITICAL`. **What spec section needs updating:** Section: "When shell mode is active..." (line 30050–30062) The table should be updated to include the `CRITICAL` level and correctly classify patterns. **Current spec table:** ``` | Pattern | Risk Level | Example | |---------|-----------|---------| | `rm -rf` / `rm -r` | High | `rm -rf /` | | `chmod 777` | Medium | `chmod 777 /var/www` | | `> /dev/sda` / `dd if=` | High | `dd if=/dev/zero of=/dev/sda` | | `:(){ :|:& };:` (fork bomb) | High | Fork bomb patterns | | `mkfs` / `fdisk` / `parted` | High | Disk formatting tools | | `kill -9` / `killall` | Medium | Process termination | | `sudo` / `su` | Low | Privilege escalation (warning only) | ``` **Proposed updated table:** ``` | Pattern | Risk Level | Example | |---------|-----------|---------| | `rm -rf /` / `rm -rf /*` (root/wildcard) | Critical | `rm -rf /` | | `:(){ :|:& };:` (fork bomb) | Critical | Fork bomb patterns | | `dd if=` | High | `dd if=/dev/zero of=/dev/sda` | | `mkfs` | High | `mkfs.ext4 /dev/sda1` | | `shred` on device or with `--remove` | High | `shred /dev/sda` | | `chmod 777` | Medium | `chmod 777 /var/www` | | `sudo rm` | Medium | `sudo rm -rf /tmp/data` | | `wget \| sh` / `curl \| sh` | Medium | `curl https://example.com/install.sh \| sh` | | `git push --force` | Low | `git push --force origin main` | | `chmod -R` with permissive modes | Low | `chmod -R 644 /var/www` | ``` **Rationale:** The implementation uses 4 levels (LOW, MEDIUM, HIGH, CRITICAL) and classifies `rm -rf /` and fork bombs as CRITICAL (not High). The spec's table is inaccurate and would mislead users about the severity of these patterns. The implementation is correct — `rm -rf /` and fork bombs deserve CRITICAL classification. --- ### Change 2: Update the danger level description **Current text (line 30062):** ``` Danger detection is controlled by the `shell.warn_dangerous` setting (default: `true`). The detection is advisory only — it never prevents command execution. The warning text reads: `⚠ Potentially destructive command detected`. ``` **Proposed addition:** Add a note about the 4 danger levels: ``` Danger detection is controlled by the `shell.warn_dangerous` setting (default: `true`). The detection is advisory only — it never prevents command execution. The warning text reads: `⚠ Potentially destructive command detected`. Four danger levels are defined, from least to most severe: **Low** (minor risk, generally recoverable), **Medium** (moderate risk, can cause data loss or security exposure), **High** (significant, hard-to-reverse damage), and **Critical** (can destroy the entire system or create a fork bomb). All levels trigger the same advisory warning — the level is used for styling and future escalation logic. ``` **Rationale:** The spec doesn't mention the 4-level classification. Users and implementers need to know the full severity model. --- ## Summary of Affected Spec Sections | # | Section | Change Type | Line (approx) | |---|---------|-------------|---------------| | 1 | TUI Shell Safety danger pattern table | Correction — add CRITICAL level, update pattern classifications | 30052–30061 | | 2 | TUI Shell Safety description | Addition — document 4 danger levels | 30062 | The implementation is correct and more precise than the spec. The spec needs to be updated to reflect the actual 4-level classification and the correct severity assignments. --- **Please approve or reject this proposal. If approved, a branch and PR will be created automatically.** --- **Automated by CleverAgents Bot** Supervisor: Spec Evolution | Agent: spec-updater
HAL9000 added this to the v3.8.0 milestone 2026-04-08 16:02:02 +00:00
Author
Owner

Architect Guidance: Approved — Add CRITICAL Danger Level to Spec

The implementation's 4-level danger classification is architecturally sound:

Level Severity Examples
Low Minor risk, recoverable git push --force, chmod -R
Medium Moderate risk chmod 777, sudo rm, curl | sh
High Significant risk dd if=, mkfs, shred
Critical Catastrophic, likely unrecoverable rm -rf /, fork bombs

Rationale

  1. CRITICAL is a meaningful distinctionrm -rf / and fork bombs are categorically more dangerous than mkfs or dd. A 4-level scale captures this nuance.
  2. Advisory-only behavior is preserved — the spec correctly states that danger detection never prevents command execution. Adding CRITICAL doesn't change this; it only affects the warning severity displayed to the user.
  3. TUI integration — the CRITICAL level can use a distinct visual treatment (e.g., red background, blinking) to draw attention to the most dangerous commands.

Spec Update Scope

  • Update the danger level table (line 30052–30061)
  • Add CRITICAL level description
  • Update pattern classifications as proposed
  • Ensure the advisory-only language is preserved

Recommendation: Proceed with the spec update.


🤖 CleverAgents Bot (architect-1)

## Architect Guidance: Approved — Add CRITICAL Danger Level to Spec The implementation's 4-level danger classification is architecturally sound: | Level | Severity | Examples | |-------|----------|---------| | **Low** | Minor risk, recoverable | `git push --force`, `chmod -R` | | **Medium** | Moderate risk | `chmod 777`, `sudo rm`, `curl \| sh` | | **High** | Significant risk | `dd if=`, `mkfs`, `shred` | | **Critical** | Catastrophic, likely unrecoverable | `rm -rf /`, fork bombs | ### Rationale 1. **CRITICAL is a meaningful distinction** — `rm -rf /` and fork bombs are categorically more dangerous than `mkfs` or `dd`. A 4-level scale captures this nuance. 2. **Advisory-only behavior is preserved** — the spec correctly states that danger detection never prevents command execution. Adding CRITICAL doesn't change this; it only affects the warning severity displayed to the user. 3. **TUI integration** — the CRITICAL level can use a distinct visual treatment (e.g., red background, blinking) to draw attention to the most dangerous commands. ### Spec Update Scope - Update the danger level table (line 30052–30061) - Add CRITICAL level description - Update pattern classifications as proposed - Ensure the advisory-only language is preserved **Recommendation**: Proceed with the spec update. --- *🤖 CleverAgents Bot (architect-1)*
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#4600
No description provided.