---
title: "Review a Detection Rule With an LLM, Sigma or YARA"
description: "Have a model review a Sigma, YARA or SIEM rule you wrote: what it matches, where it is too broad or narrow, and what a test looks like. It reviews, not writes."
canonical: https://pentestllm.ai/detection-rule-review-ai
generated: 2026-12-03T14:52:59.380Z
source: https://pentestllm.ai/detection-rule-review-ai
base_url: https://api.pentestllm.ai/v1
---

Detection rule review with an LLM

# Reviewing a detection rule with a model

Give `qwen3.8-27b-cybersecurity` at https://api.pentestllm.ai/v1 a detection rule you have already written, in Sigma, YARA or your SIEM’s query language, together with a few sample log lines or strings, and ask what the rule matches, where it is too broad or too narrow, and what a test for it would look like. This reviews a rule that exists; it does not write a new one from a sample, which is the job of the [YARA and Sigma generation](https://pentestllm.ai/yara-sigma-rule-generation) page.

[Prices per token](https://pentestllm.ai/pricing)

[Get a key](https://app.pentestllm.ai/console) [Try it free in the browser](https://pentestllm.ai/playground)

```bash
curl https://api.pentestllm.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-ptl-live-…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto/security",
    "messages": [{"role": "user", "content": "Rank these scanner findings by severity and say what to verify first."}]
  }'
```

## A second reader for a rule you wrote

Before changing a rule from a newly observed string, check its provenance in an [IOC evidence review](https://pentestllm.ai/ioc-evidence-review); a string appearing in a report does not establish malice.

Detection rules are written fast, often during an incident, and reviewed rarely. A rule that is too broad floods the queue; one that is too narrow misses the next variant; and the author is the worst-placed person to see either, because they know what they meant. A model reading the rule cold is a useful second reader. It is given the rule text and some samples, it explains back what the rule would actually match, and the analyst compares that explanation with what they intended. The rule was written by a person for an authorized defensive purpose and stays theirs; the model changes nothing and runs nothing.

## What to send for Sigma, YARA or a query

A Sigma rule is YAML with a `title`, a `logsource` that names the product, category or service, a `detection` block of named selections and a `condition` that combines them, and usually a `level` and a `falsepositives` list. A YARA rule must have a `condition`, and usually also a `meta` section and a `strings` section of named text, hex or regular-expression patterns the condition refers to. A SIEM query is whatever your platform uses. Send the whole rule as written, including whatever metadata it has, because fields such as `falsepositives` and `description` tell the model what the author already expected and let it say whether the detection logic agrees.

Add three to five samples: lines or strings the rule should match and a couple it should not. Replace real host names, accounts and paths with placeholders, and keep the [redaction setting](https://pentestllm.ai/features/files-and-redaction) on in case a sample carries a secret. The field names above were read from the Sigma and YARA documentation on the date below.

## Ask for what it matches, not for a rewrite

Ask three questions and no more. First, in plain words, what would this rule match, walking each selection or string and the condition that joins them. Second, where is it too broad, with a sample input that would match but should not, and where too narrow, naming the field or value in your samples that the rule does not cover. Third, what would a test look like: which sample inputs, which expected results. `qwen3.8-27b-cybersecurity` reads the rule and the samples in one request and answers in prose you keep beside the rule. Do not ask it to rewrite the rule; a rewrite you did not reason through is a rule you no longer understand.

The price of a review is in `usage.cost` on the reply, with a request id in the response headers for reference; see the [pricing](https://pentestllm.ai/pricing) page for rates.

## Read the review as an opinion

The model has not run the rule against your data and does not know your environment’s normal traffic. It can say that a selection on a process name alone is broad; it cannot know that in your fleet that process name is rare. Treat each point in the review as a question for the author to answer, not a verdict. Points the author agrees with become edits they make themselves; points they disagree with get a one-line note in the rule’s metadata so the next reviewer sees that it was considered.

## Test the rule the way you always would

The review names tests; it does not run them. Run the rule against your own sample set and against a window of real logs, count the matches, and compare with the review’s predictions. Where the model said the rule would be noisy and it is not, your environment differs from the general case and the review was wrong for you. Where it said the rule does not cover a value in your samples and your tests confirm it, you have found a gap before an attacker did. The outcome is still measured by the test, not by the review.

## Where this sits with the other pages

Writing a rule from a sample is on the [YARA and Sigma generation](https://pentestllm.ai/yara-sigma-rule-generation) page. Finding out which log groups deserve a rule in the first place is on the [security log triage](https://pentestllm.ai/security-log-triage-ai) page, and the [malware analysis](https://pentestllm.ai/malware-analysis) hub covers the sample analysis that often produces the strings a YARA rule is built on. This page is the step between those and production: a rule exists, and a second reader checks it before it is trusted.

## 16 security builds, priced per token

USD per million tokens, live on 2026-12-03; `auto/security` bills at the build that answers.

Detected refusals and invalid non-streamed JSON qualify for automatic refunds within the daily cap. [Verify your receipt](https://pentestllm.ai/statements/verify).

| Model | Build | Input $/M | Output $/M | Context | Wire formats |
| --- | --- | --- | --- | --- | --- |
| [Qwen3.8 27B Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity) qwen3.8-27b-cybersecurity | Security | $0.40 | $2.40 | 262K | openai |
| [Uncensored Qwen3.8 27b Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity-uncensored) qwen3.8-27b-cybersecurity-uncensored | Security | $0.40 | $2.40 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity) gemma-4-26b-a4b-it-cybersecurity | Security | $0.4224 | $1.3376 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity (Uncensored)](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity-uncensored) gemma-4-26b-a4b-it-cybersecurity-uncensored | Security | $0.48 | $1.52 | 262K | openai |
| [GLM-5.3 Flash Cybersecurity](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity) glm-5.3-flash-cybersecurity | Security | $0.525 | $1.75 | 1049K | openai |
| [GLM-5.3 Flash Cybersecurity (Uncensored)](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity-uncensored) glm-5.3-flash-cybersecurity-uncensored | Security | $0.525 | $1.75 | 1049K | openai |
| [Red Team (Flash)](https://pentestllm.ai/models/red-team-flash) red-team-flash | Security | $0.90 | $3.00 | 1000K | openai |
| [Red Team (Pro)](https://pentestllm.ai/models/red-team-pro) red-team-pro | Security | $1.455 | $5.82 | – | openai |
| [OrcaCyber MiniMax M3.1 Flash](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity) minimax-m3.1-flash-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber MiniMax M3.1 Flash (Uncensored)](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity-uncensored) minimax-m3.1-flash-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next (Uncensored)](https://pentestllm.ai/models/orcacyber-qwen3.8-flash-next-uncensored) orcacyber-qwen3.8-flash-next-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity) qwen3.8-flash-next-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [Uncensored Qwen3.8 Flash Next Cybersecurity](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity-uncensored) qwen3.8-flash-next-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [Cyber Frontier](https://pentestllm.ai/models/cyber-frontier) cyber-frontier | Security | $5.25 | $15.75 | 1049K | openai |
| [OrcaCyber Zero 1.5](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity) orca-zero-1.5-cybersecurity | Security | $7.50 | $18.75 | 999K | openai |
| [OrcaCyber Zero 1.5 (Uncensored)](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity-uncensored) orca-zero-1.5-cybersecurity-uncensored | Security | $7.50 | $18.75 | 999K | openai |

[Full price list and tool fees](https://pentestllm.ai/pricing) · [Every model](https://pentestllm.ai/models) · [API docs](https://pentestllm.ai/docs)

## Questions

### What can a model tell me about a rule I wrote?

What the rule would match in plain words, selection by selection; where it is too broad, with an input that would match but should not; where it is too narrow, naming the field or value in your samples it does not cover; and what tests would show either. It reads the rule cold, which is the view the author no longer has.

### Will it make my rule less noisy?

It can point at the selection that is broad and suggest what to add, but the edit is yours to make and to test. A rewrite from the model that you did not reason through is a rule you no longer understand, so ask for the review, not the rewrite.

### Does it replace testing the rule?

No. The review names tests; you run them against your sample set and a window of real logs. The model has not seen your data and does not know what is normal in your environment, so the measured match counts decide, not the review.

### Should I send the whole rule or just the logic?

The whole rule, including whatever title, description, level and falsepositives fields it has, plus three to five sample inputs with placeholders. The metadata tells the model what the author expected, which lets it say whether the detection logic agrees with that expectation.

## Read next

[AI YARA and Sigma rules Draft YARA and Sigma detection rules with a security model, then prove each one before you deploy it.](https://pentestllm.ai/yara-sigma-rule-generation) [Malware analysis Models for static triage, behaviour summaries and detection rules. Analysis and detection only.](https://pentestllm.ai/malware-analysis) [Security log triage with an LLM Grouped, redacted auth and security logs get a note per group and a review order; each flag is a lead, not an alert.](https://pentestllm.ai/security-log-triage-ai)

Facts about other products and tools on this page were read from their own pages on 22 November 2026: [Sigma rule basics](https://sigmahq.io/docs/basics/rules.html), [Writing YARA rules](https://yara.readthedocs.io/en/stable/writingrules.html). They change; check the source before relying on a figure.

## One key, from $3

For systems you own or may test in writing: [acceptable use](https://pentestllm.ai/acceptable-use).

[Get a key](https://app.pentestllm.ai/console)
