Skip to content

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

Done

Description

@blitzcrieg1

Blocked by the detection freeze (2026-10-23). This edits detection/rules.py, which is hashed into the ruleset fingerprint, so a PR now would restart the dogfood clock. It waits until the maintainer ends the freeze; see CLAUDE.md and #317. Paths below updated to the agentmetry/ package layout.

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/agentmetry/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 agentmetry tests and python -m pytest -q pass.

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

Activity

  1. added
    good first issue
    detection-rule
    on Jul 14, 2026
  2. added
    bounty
    on Nov 24, 2026
  3. rumangsanya commented on Nov 25, 2026

    @rumangsanya
    Contributor

    Claiming this one under the bounty program in #454. I have a completed implementation ready (rule_repeated_denials: ≥4 tool_called denials → one high Detection with all event_ids, plus attack/benign corpus entries and tests — official benchmark 106 cases, 0 missed, 0 false positives). Opening the PR from my fork as rumangsanya shortly; posting this claim now so the slot is marked. Happy with the current program terms (recognition now, cash when a funding round lands).

  4. blitzcrieg1 commented on Nov 25, 2026

    @blitzcrieg1
    OwnerAuthor

    Claim noted and you are assigned, @rumangsanya. When your PR opens: CI needs a maintainer approval on the first run (normal for new contributors, I will approve it), the gate is agentmetry benchmark plus the full suite with the refreshed README block, and expectations in corpus.yaml must be written from what the session is, not what the engine prints. Looking forward to the PR.

  5. blitzcrieg1 commented on Nov 25, 2026

    @blitzcrieg1
    OwnerAuthor

    Friendly nudge, @rumangsanya: the claim is noted and you're assigned, but no PR has opened yet. When it does, CI needs a maintainer approval on the first run (I'll approve it), and the gate is agentmetry benchmark (0 missed / 0 FP) plus the full suite with the refreshed README block. If you've hit a blocker, say so here and we'll scope it down.

  6. added 7 commits that reference this issue on Nov 25, 2026
    d2f41a3
    cf9ee2d
    0edaa57
    6918ff5
    8f0c33d
    74d9676
    f4ca21f
  7. added a commit that references this issue on Nov 27, 2026
    4f38316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bountydetection-rule

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions