Skip to content

Two published rules have no benchmark corpus case: host-subagent-swarm-burst and off-hours-activity #36

Done

Description

@blitzcrieg1

python -m cli benchmark reports rules covered 9 against 15 built-in rules.
Six rules have no corpus case at all, so nothing detects it if they silently
stop firing.

The benchmark corpus is the strongest evidence this project has that its
detections are trustworthy. Six rules currently sit outside that evidence.

Uncovered rules

Confirm the exact set by comparing BUILTIN_RULE_IDS in
core/audit/detection/rules.py with the rules that fire during a benchmark run.
As of writing, the covered nine come from the existing 12 attack sessions, so
the gap is roughly the rules relating to approval flow, off-hours activity, and
the swarm and burst family.

Task

Add one attack case per uncovered rule to
apps/orchestrator/tests/fixtures/detection_corpus/, registered in
corpus.yaml.

Each case is a JSONL session that would have made a real operator look twice.
Synthetic sessions that exist only to satisfy the matcher teach the rule nothing
and give false confidence.

Notes

Rules with time semantics need care. Off-hours detection depends on the business
timezone resolution in _business_tz(), and a case that only passes in one
timezone is worse than no case.

If a rule turns out to be genuinely hard to trigger with a realistic session,
that is a finding worth reporting rather than a case worth forcing. A rule that
cannot be provoked by plausible activity may be tuned wrongly.

Acceptance criteria

  • rules covered equals the number of built-in rules
  • Benign case count grows alongside, so coverage does not come at the cost
    of the false-positive claim
  • pytest -q green

Activity

  1. added
    help wanted
    on Aug 1, 2026
  2. changed the title [-]Six of fifteen built-in rules have no benchmark corpus coverage[/-] [+]Two published rules have no benchmark corpus case: host-subagent-swarm-burst and off-hours-activity[/+] on Oct 23, 2026
  3. blitzcrieg1 commented on Oct 23, 2026

    @blitzcrieg1
    OwnerAuthor

    Narrowed on 2026-10-23. agentmetry benchmark now reports 13 rules covered: 12 of the 14 published rules plus the experimental one. The two left without a corpus case are host-subagent-swarm-burst and off-hours-activity (both still named in tools/generate_sigma_pack.py so the Sigma pack keeps them). The task is unchanged: one attack case each, registered in corpus.yaml. Benign sessions are #25.

  4. blitzcrieg1 commented on Nov 25, 2026

    @blitzcrieg1
    OwnerAuthor

    Partially addressed by #472 (merged today): the benchmark now scopes host rules per host_id, and host-subagent-swarm-burst has its corpus case, so that half is done. Remaining: off-hours-activity still has no corpus case. Retitling not needed; this stays open until off-hours-activity is covered.

  5. rumangsanya commented on Nov 27, 2026

    @rumangsanya
    Contributor

    claim

    Taking the remaining half of this under the bounty program (#454, corpus-only task): an attack corpus case for off-hours-activity, plus a benign companion so the false-positive claim grows with the coverage. Contributor from #486 (repeated-denials).

    One finding from reading the benchmark first: off-hours-activity is opt-in (settings.detect_off_hours) and the benchmark never enables it, so a corpus case on its own cannot fire. My PR will therefore include a small harness change — per-case settings in corpus.yaml, with business_tz/business_hours pinned for this case so it passes in any host timezone (per the warning in this issue) — plus the two cases. Flagging it here in case you'd rather the harness change look different.

    Plan: attack = unscheduled autonomous agent performing an impact action at 02:30 UTC on a weekday, window 09–18 UTC pinned. Benign = the same hour, a cron-triggered nightly job (excluded by design). Benchmark and README counts refreshed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions