feat(guards): implement structured log events for all guard violations #8541

Open
opened 2026-04-13 20:37:29 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message type: feat
  • Scope: guards
  • Branch name prefix: feat/v3.5.0-guard-violation-logging

Background and Context

As part of Epic #8424 (Guard & Safety System), all guard violations must be emitted as structured log events. This enables observability, auditing, and debugging of guard enforcement in autonomous execution.

This issue depends on the guard implementations (denylist, budget cap, tool call limit) being implemented first.

This issue blocks Epic #8424.

Expected Behavior

  • Every guard violation emits a structured log event with: plan ID, action ID, violation type, guard name, and violation details
  • Log events use a consistent schema across all guard types
  • Log events are emitted at WARNING level
  • Log events are machine-parseable (JSON format)

Acceptance Criteria

  • GuardViolationEvent structured log schema is defined
  • All guard types (denylist, budget cap, tool call limit) emit GuardViolationEvent on violation
  • Log events include: plan_id, action_id, guard_name, violation_type, details
  • Log events are emitted at WARNING level
  • Log events are in JSON format (machine-parseable)
  • Unit tests verify log events are emitted with correct fields for each guard type
  • Integration tests verify log events appear in output during a guarded plan execution

Subtasks

  • Define GuardViolationEvent structured log schema
  • Implement structured logging helper for guard violations
  • Update DenylistGuard to emit GuardViolationEvent
  • Update BudgetCapGuard to emit GuardViolationEvent
  • Update ToolCallLimitGuard to emit GuardViolationEvent
  • Write unit tests for log event emission
  • Write integration tests for log events in guarded execution

Definition of Done

  1. All guard types emit structured log events on violation
  2. Unit tests verify log events for each guard type
  3. Integration tests verify log events in guarded execution
  4. Unit tests pass with >= 97% coverage
  5. Code reviewed and merged to main branch

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Metadata - **Commit message type**: `feat` - **Scope**: `guards` - **Branch name prefix**: `feat/v3.5.0-guard-violation-logging` ## Background and Context As part of Epic #8424 (Guard & Safety System), all guard violations must be emitted as structured log events. This enables observability, auditing, and debugging of guard enforcement in autonomous execution. This issue depends on the guard implementations (denylist, budget cap, tool call limit) being implemented first. This issue blocks Epic #8424. ## Expected Behavior - Every guard violation emits a structured log event with: plan ID, action ID, violation type, guard name, and violation details - Log events use a consistent schema across all guard types - Log events are emitted at WARNING level - Log events are machine-parseable (JSON format) ## Acceptance Criteria - [ ] `GuardViolationEvent` structured log schema is defined - [ ] All guard types (denylist, budget cap, tool call limit) emit `GuardViolationEvent` on violation - [ ] Log events include: plan_id, action_id, guard_name, violation_type, details - [ ] Log events are emitted at WARNING level - [ ] Log events are in JSON format (machine-parseable) - [ ] Unit tests verify log events are emitted with correct fields for each guard type - [ ] Integration tests verify log events appear in output during a guarded plan execution ## Subtasks - [ ] Define `GuardViolationEvent` structured log schema - [ ] Implement structured logging helper for guard violations - [ ] Update `DenylistGuard` to emit `GuardViolationEvent` - [ ] Update `BudgetCapGuard` to emit `GuardViolationEvent` - [ ] Update `ToolCallLimitGuard` to emit `GuardViolationEvent` - [ ] Write unit tests for log event emission - [ ] Write integration tests for log events in guarded execution ## Definition of Done 1. All guard types emit structured log events on violation 2. Unit tests verify log events for each guard type 3. Integration tests verify log events in guarded execution 4. Unit tests pass with >= 97% coverage 5. Code reviewed and merged to main branch --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.5.0 milestone 2026-04-13 20:53:21 +00:00
Author
Owner

[AUTO-OWNR-4] Triage Decision (Cycle 2)

Status: Verified

MoSCoW: Should Have
Priority: Medium
Milestone: v3.5.0

Rationale: This is a required implementation task for the v3.5.0 milestone (Autonomy Hardening). Structured guard violation logging is important for observability and auditability of autonomous execution, but is not blocking core guard functionality — hence Should Have rather than Must Have.

Next Steps: Implementation worker should pick this up as part of the v3.5.0 epic work.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## [AUTO-OWNR-4] Triage Decision (Cycle 2) **Status**: ✅ Verified **MoSCoW**: Should Have **Priority**: Medium **Milestone**: v3.5.0 **Rationale**: This is a required implementation task for the v3.5.0 milestone (Autonomy Hardening). Structured guard violation logging is important for observability and auditability of autonomous execution, but is not blocking core guard functionality — hence Should Have rather than Must Have. **Next Steps**: Implementation worker should pick this up as part of the v3.5.0 epic work. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-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#8541
No description provided.