Skip to content

New detection rule: repeated-denials (agent probing a guardrail) #1

Description

@blitzcrieg1

An agent that hits a wall of denied tool calls is often probing a guardrail. A single denial is noise; a burst is a signal.

Task

In apps/orchestrator/core/audit/detection/rules.py, add a pure function rule_repeated_denials(events) and append it to REGISTRY. Fire when a session has >= 4 tool_called events with action.outcome == "denied". Aggregate into one Detection (severity high) listing all offending event_ids. Reuse the existing accessors (_action_type, _outcome, _event_id, ...).

Acceptance criteria

  • Fires on a session with 4 denials; does not fire on 3.
  • Tests in apps/orchestrator/tests/test_detection_engine.py (one fires, one near-miss), using the _event(...) helper.
  • python -m ruff check core api tests and python -m pytest -q pass.

Hint: copy the shape of rule_autonomous_unapproved_write — it already aggregates offending events into one detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions