UAT: agents safety-profile CLI command missing — SafetyProfile domain model exists but has no CLI management interface #3276

Open
opened 2026-04-05 08:59:33 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: feat/cli-safety-profile-command
  • Commit Message: feat(cli): add agents safety-profile CLI command for safety profile management
  • Milestone: None (backlog — see note below)
  • Parent Epic: #362

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Background and Context

The SafetyProfile domain model is fully implemented in src/cleveragents/domain/models/core/safety_profile.py with:

  • SafetyProfile Pydantic model with fields: allowed_skill_categories, require_sandbox, require_checkpoints, require_human_approval, allow_unsafe_tools, max_cost_per_plan, max_retries_per_step, max_total_cost
  • SafetyProfileRef model for plan-level resolution
  • resolve_safety_profile() function implementing plan > action > project > global precedence
  • DEFAULT_SAFETY_PROFILE constant
  • from_config() and from_yaml() factory methods

Robot tests exist for the domain model (robot/safety_profile.robot, robot/safety_profile_enforcement.robot).

However, the CLI (src/cleveragents/cli/main.py) does not register any safety-profile subcommand. The automation-profile command exists for managing automation profiles, but there is no equivalent agents safety-profile command.

The spec (v3.6.0 scope: "Cost/session budgets, safety profiles") requires safety profiles to be manageable via CLI, similar to how automation profiles are managed.

Current Behavior

Running agents --help shows no safety-profile command listed. Running agents safety-profile returns:

Error: Invalid command 'safety-profile'

The _register_subcommands() function in src/cleveragents/cli/main.py does not add a safety-profile typer app.

Expected Behavior

The following CLI subcommands should be available:

  • agents safety-profile list — list available safety profiles
  • agents safety-profile show <name> — show a safety profile's details
  • agents safety-profile add --config <yaml> — register a custom safety profile
  • agents safety-profile remove <name> — remove a custom safety profile

Steps to Reproduce

  1. Run agents --help — no safety-profile command listed
  2. Run agents safety-profile — returns Error: Invalid command 'safety-profile'

Acceptance Criteria

  • agents safety-profile list lists all registered safety profiles
  • agents safety-profile show <name> displays full details of a named safety profile
  • agents safety-profile add --config <yaml> registers a new custom safety profile from a YAML config
  • agents safety-profile remove <name> removes a custom safety profile
  • CLI help text (agents safety-profile --help) is accurate and complete
  • New commands follow the same patterns as the existing automation-profile command
  • All new commands are covered by Robot Framework integration tests

Supporting Information

  • Domain model location: src/cleveragents/domain/models/core/safety_profile.py
  • CLI entry point: src/cleveragents/cli/main.py_register_subcommands() function
  • Existing parallel: automation-profile CLI command (reference implementation pattern)
  • Existing robot tests: robot/safety_profile.robot, robot/safety_profile_enforcement.robot
  • Spec scope: v3.6.0 — "Cost/session budgets, safety profiles"

Subtasks

  • Add safety_profile typer app to src/cleveragents/cli/main.py via _register_subcommands()
  • Implement agents safety-profile list command
  • Implement agents safety-profile show <name> command
  • Implement agents safety-profile add --config <yaml> command
  • Implement agents safety-profile remove <name> command
  • Add CLI help text and docstrings for all new commands
  • Tests (Robot): Add integration scenarios for each new CLI subcommand
  • Tests (Robot): Verify error handling for invalid profile names and malformed YAML
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (feat(cli): add agents safety-profile CLI command for safety profile management), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (feat/cli-safety-profile-command).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `feat/cli-safety-profile-command` - **Commit Message**: `feat(cli): add agents safety-profile CLI command for safety profile management` - **Milestone**: None (backlog — see note below) - **Parent Epic**: #362 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Background and Context The `SafetyProfile` domain model is fully implemented in `src/cleveragents/domain/models/core/safety_profile.py` with: - `SafetyProfile` Pydantic model with fields: `allowed_skill_categories`, `require_sandbox`, `require_checkpoints`, `require_human_approval`, `allow_unsafe_tools`, `max_cost_per_plan`, `max_retries_per_step`, `max_total_cost` - `SafetyProfileRef` model for plan-level resolution - `resolve_safety_profile()` function implementing plan > action > project > global precedence - `DEFAULT_SAFETY_PROFILE` constant - `from_config()` and `from_yaml()` factory methods Robot tests exist for the domain model (`robot/safety_profile.robot`, `robot/safety_profile_enforcement.robot`). However, the CLI (`src/cleveragents/cli/main.py`) does **not** register any `safety-profile` subcommand. The `automation-profile` command exists for managing automation profiles, but there is no equivalent `agents safety-profile` command. The spec (v3.6.0 scope: "Cost/session budgets, safety profiles") requires safety profiles to be manageable via CLI, similar to how automation profiles are managed. ## Current Behavior Running `agents --help` shows no `safety-profile` command listed. Running `agents safety-profile` returns: ``` Error: Invalid command 'safety-profile' ``` The `_register_subcommands()` function in `src/cleveragents/cli/main.py` does not add a `safety-profile` typer app. ## Expected Behavior The following CLI subcommands should be available: - `agents safety-profile list` — list available safety profiles - `agents safety-profile show <name>` — show a safety profile's details - `agents safety-profile add --config <yaml>` — register a custom safety profile - `agents safety-profile remove <name>` — remove a custom safety profile ## Steps to Reproduce 1. Run `agents --help` — no `safety-profile` command listed 2. Run `agents safety-profile` — returns `Error: Invalid command 'safety-profile'` ## Acceptance Criteria - [ ] `agents safety-profile list` lists all registered safety profiles - [ ] `agents safety-profile show <name>` displays full details of a named safety profile - [ ] `agents safety-profile add --config <yaml>` registers a new custom safety profile from a YAML config - [ ] `agents safety-profile remove <name>` removes a custom safety profile - [ ] CLI help text (`agents safety-profile --help`) is accurate and complete - [ ] New commands follow the same patterns as the existing `automation-profile` command - [ ] All new commands are covered by Robot Framework integration tests ## Supporting Information - Domain model location: `src/cleveragents/domain/models/core/safety_profile.py` - CLI entry point: `src/cleveragents/cli/main.py` — `_register_subcommands()` function - Existing parallel: `automation-profile` CLI command (reference implementation pattern) - Existing robot tests: `robot/safety_profile.robot`, `robot/safety_profile_enforcement.robot` - Spec scope: v3.6.0 — "Cost/session budgets, safety profiles" --- ## Subtasks - [ ] Add `safety_profile` typer app to `src/cleveragents/cli/main.py` via `_register_subcommands()` - [ ] Implement `agents safety-profile list` command - [ ] Implement `agents safety-profile show <name>` command - [ ] Implement `agents safety-profile add --config <yaml>` command - [ ] Implement `agents safety-profile remove <name>` command - [ ] Add CLI help text and docstrings for all new commands - [ ] Tests (Robot): Add integration scenarios for each new CLI subcommand - [ ] Tests (Robot): Verify error handling for invalid profile names and malformed YAML - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`feat(cli): add agents safety-profile CLI command for safety profile management`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`feat/cli-safety-profile-command`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-05 09:14:18 +00:00
freemo removed this from the v3.6.0 milestone 2026-04-07 00:11:09 +00:00
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.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3276
No description provided.