UAT: agents audit list missing --user filter — spec requires filtering by user identity #5805

Open
opened 2026-04-09 09:56:57 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Audit Logging — CLI Filtering
Milestone: v3.5.0 (M6)
Severity: Critical — filtering by user is a core compliance requirement

What Was Tested

The agents audit list command filtering options were inspected against the specification's filtering requirements.

Expected Behavior (from spec)

The specification states:

The agents audit list command must support filtering logs by event_type, plan_id, user_id, and a specific time range.

The spec explicitly lists user_id (mapped to user_identity in the implementation) as a required filter.

Actual Behavior

The agents audit list command (src/cleveragents/cli/commands/audit.py) supports:

  • --plan (plan_id filter)
  • --project (project_name filter)
  • --type (event_type filter)
  • --since (time range filter)
  • --user (user_identity filter) MISSING

The AuditService.list_entries() method also lacks a user_identity parameter:

def list_entries(
    self,
    *,
    plan_id: str | None = None,
    project_name: str | None = None,
    event_type: str | None = None,
    since: str | None = None,
    limit: int = 100,
) -> list[AuditLogEntry]:

The user_identity column exists in the database model (AuditLogModel) and is populated during recording, but cannot be queried via the CLI or service layer.

Code Location

  • src/cleveragents/cli/commands/audit.pylist_entries() function missing --user option
  • src/cleveragents/application/services/audit_service.pylist_entries() missing user_identity parameter and filter

Impact

Without --user filtering, security teams cannot:

  • Audit all actions performed by a specific user
  • Investigate security incidents by user identity
  • Generate per-user compliance reports
  • Detect anomalous behavior by a specific actor

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area**: Audit Logging — CLI Filtering **Milestone**: v3.5.0 (M6) **Severity**: Critical — filtering by user is a core compliance requirement ### What Was Tested The `agents audit list` command filtering options were inspected against the specification's filtering requirements. ### Expected Behavior (from spec) The specification states: > The `agents audit list` command must support filtering logs by `event_type`, `plan_id`, `user_id`, and a specific time range. The spec explicitly lists `user_id` (mapped to `user_identity` in the implementation) as a required filter. ### Actual Behavior The `agents audit list` command (`src/cleveragents/cli/commands/audit.py`) supports: - `--plan` (plan_id filter) ✅ - `--project` (project_name filter) ✅ - `--type` (event_type filter) ✅ - `--since` (time range filter) ✅ - `--user` (user_identity filter) ❌ **MISSING** The `AuditService.list_entries()` method also lacks a `user_identity` parameter: ```python def list_entries( self, *, plan_id: str | None = None, project_name: str | None = None, event_type: str | None = None, since: str | None = None, limit: int = 100, ) -> list[AuditLogEntry]: ``` The `user_identity` column exists in the database model (`AuditLogModel`) and is populated during recording, but cannot be queried via the CLI or service layer. ### Code Location - `src/cleveragents/cli/commands/audit.py` — `list_entries()` function missing `--user` option - `src/cleveragents/application/services/audit_service.py` — `list_entries()` missing `user_identity` parameter and filter ### Impact Without `--user` filtering, security teams cannot: - Audit all actions performed by a specific user - Investigate security incidents by user identity - Generate per-user compliance reports - Detect anomalous behavior by a specific actor --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 10:22:33 +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#5805
No description provided.