feat(guards): implement denylist guard enforcement with GuardViolationError #8927

Open
opened 2026-04-14 04:03:57 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

The v3.5.0 milestone (M6: Autonomy Hardening) requires robust safety guardrails before the system can be trusted to execute large-scale autonomous tasks. The Guard & Safety System Epic (#8424) requires that a denylist of tool names/patterns can be configured, and any plan action attempting to invoke a denylisted tool is rejected with a clear GuardViolationError.

Without denylist enforcement, an autonomous agent could invoke any tool without restriction, including potentially dangerous or disallowed operations. This is a safety-critical prerequisite for the full autonomy acceptance flow.

Parent Epic: #8424 (Epic: Guard & Safety System)

Expected Behavior

When this issue is complete:

  • A denylist of tool names/patterns can be configured in the automation profile
  • Any plan action attempting to invoke a denylisted tool raises GuardViolationError with a clear error message including the tool name and plan ID
  • Guard violations are emitted as structured log events
  • The denylist supports both exact tool names and glob patterns
  • BDD tests cover denylist enforcement scenarios

Acceptance Criteria

  • AutomationGuard enforces denylist: plans attempting to invoke a denylisted tool raise GuardViolationError
  • GuardViolationError includes plan ID, action ID, tool name, and violation type in its message
  • Denylist supports exact tool names (e.g., shell_execute) and glob patterns (e.g., builtin/*)
  • Guard violations are emitted as structured log events with plan ID, action ID, and violation type
  • BDD tests cover: exact name match, glob pattern match, non-denylisted tool passes, empty denylist passes
  • nox passes with coverage >= 97%

Subtasks

  • Audit current AutomationGuard denylist implementation for gaps
  • Implement glob pattern matching for denylist entries
  • Ensure GuardViolationError is raised (not just logged) on denylist violation
  • Wire structured log event emission on guard violation
  • Write BDD scenarios for denylist enforcement (exact match, glob, pass-through)
  • Write unit tests for AutomationGuard.check_denylist()
  • Verify nox passes with coverage >= 97%

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage >= 97%)
  • Code reviewed and approved
  • Documentation updated if needed
  • No regressions introduced

Metadata

  • Commit message: feat(guards): implement denylist guard enforcement with GuardViolationError
  • Branch name: feat/guards-denylist-enforcement

Automated by CleverAgents Bot
Agent: new-issue-creator

## Background and Context The v3.5.0 milestone (M6: Autonomy Hardening) requires robust safety guardrails before the system can be trusted to execute large-scale autonomous tasks. The Guard & Safety System Epic (#8424) requires that a denylist of tool names/patterns can be configured, and any plan action attempting to invoke a denylisted tool is rejected with a clear `GuardViolationError`. Without denylist enforcement, an autonomous agent could invoke any tool without restriction, including potentially dangerous or disallowed operations. This is a safety-critical prerequisite for the full autonomy acceptance flow. Parent Epic: #8424 (Epic: Guard & Safety System) ## Expected Behavior When this issue is complete: - A denylist of tool names/patterns can be configured in the automation profile - Any plan action attempting to invoke a denylisted tool raises `GuardViolationError` with a clear error message including the tool name and plan ID - Guard violations are emitted as structured log events - The denylist supports both exact tool names and glob patterns - BDD tests cover denylist enforcement scenarios ## Acceptance Criteria - [ ] `AutomationGuard` enforces denylist: plans attempting to invoke a denylisted tool raise `GuardViolationError` - [ ] `GuardViolationError` includes plan ID, action ID, tool name, and violation type in its message - [ ] Denylist supports exact tool names (e.g., `shell_execute`) and glob patterns (e.g., `builtin/*`) - [ ] Guard violations are emitted as structured log events with plan ID, action ID, and violation type - [ ] BDD tests cover: exact name match, glob pattern match, non-denylisted tool passes, empty denylist passes - [ ] `nox` passes with coverage >= 97% ## Subtasks - [ ] Audit current `AutomationGuard` denylist implementation for gaps - [ ] Implement glob pattern matching for denylist entries - [ ] Ensure `GuardViolationError` is raised (not just logged) on denylist violation - [ ] Wire structured log event emission on guard violation - [ ] Write BDD scenarios for denylist enforcement (exact match, glob, pass-through) - [ ] Write unit tests for `AutomationGuard.check_denylist()` - [ ] Verify `nox` passes with coverage >= 97% ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage >= 97%) - [ ] Code reviewed and approved - [ ] Documentation updated if needed - [ ] No regressions introduced ## Metadata - **Commit message:** `feat(guards): implement denylist guard enforcement with GuardViolationError` - **Branch name:** `feat/guards-denylist-enforcement` --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-14 04:10:49 +00:00
Author
Owner

Verified — Denylist guard enforcement is a v3.5.0 guard deliverable. MoSCoW: Must-have. Priority: High.


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

✅ **Verified** — Denylist guard enforcement is a v3.5.0 guard deliverable. MoSCoW: Must-have. Priority: High. --- **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.

Blocks
#8424 Epic: Guard & Safety System
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#8927
No description provided.