Skip to main content
BUSINESS-RESOURCE • 7 min read

AI-Generated Detection Rules: Before You Put One in Production

The AI wrote a detection rule in seconds. The syntax checked out, the query ran successfully, and the description sounded like something a senior engineer would write.

Then the test events arrived. The rule missed the behaviour it was supposed to catch.

That's the uncomfortable part of using AI for detection engineering. Generating a rule is easy. Establishing whether it works against your actual telemetry takes considerably more effort.

For SOC teams using AI to accelerate detection development, the challenge is knowing which rules are ready for production and which still need work.

A Rule That Runs Can Still Be Wrong

An AI-generated detection might contain valid syntax, reference familiar fields and follow the expected Sigma structure. That makes it a useful starting point.

It also makes mistakes harder to spot.

A rule intended to detect suspicious cloud credential creation might search for the correct API event but ignore which account received the credential. Another could match the right behaviour while searching an index that doesn't contain the organisation's relevant logs.

Both might pass a basic syntax check. The first step in reviewing any generated rule is to establish the behaviour it should detect.

For example, a detection engineering team might want to identify when new access keys are created for a defined group of sensitive AWS Identity and Access Management (IAM) users.

That gives the engineer a specific behaviour to validate, along with several important questions.

Which accounts are considered sensitive? Which event records identify access key creation? And should an authorised credential rotation trigger the same alert?

The objective also needs to describe what happens after a match.

A detection intended to create an investigative lead can tolerate different levels of uncertainty from one connected to automatic credential revocation.

The rule's purpose should determine how strictly its behaviour is evaluated.

The Data Has to Be There in the First Place

A detection can only work with information the environment actually collects.

That's easy to overlook when AI generates a rule using fields that appear in public examples or documentation.

Consider the AWS credential scenario. CloudTrail can record IAM API activity, including access key creation. Relevant information may include the API operation, the identity making the request and the account affected.

The detection engineer needs to verify how those records appear in the organisation's security platform.

A query might expect the target username in a field that has been renamed during ingestion. It might also assume every event contains a particular attribute, even though the source doesn't always supply it.

AWS's CreateAccessKey API documentation provides an important example: the UserName request parameter is optional in certain circumstances.

A rule that depends entirely on that field could miss activity if the implementation doesn't account for its absence.

Before testing the detection, inspect representative records from the actual environment. Confirm that the relevant fields exist, the data reaches the intended index and the collection scope includes the accounts or systems being protected.

A query that returns zero results may indicate a quiet environment. It could just as easily reveal a broken collection pipeline.

Read the Logic Behind the AI's Explanation

Generated descriptions can sound more comprehensive than the detection itself.

A rule titled "Suspicious AWS Credential Creation" might be little more than a search for every CreateAccessKey event.

That could be a useful starting signal, but it doesn't establish whether the activity is suspicious. The reviewer should examine the conditions directly and explain what would make an event match.

Also evaluate to how the rule handles missing fields, exclusions and multiple conditions.

For example, a detection intended to alert on credential creation for sensitive IAM users may require an approved list of those users. The engineer needs to know whether the list is current and how the query behaves when the target identity cannot be resolved.

An overly broad condition could produce alerts for routine administration. An overly narrow one might miss the very event the team wants to identify.

The Sigma specification separates a rule's description, log source and detection logic. Those elements should tell a consistent story.

If the description promises broad credential-abuse detection while the query only matches a particular API operation, narrow the claim or develop the additional coverage required.

The Translation Can Change the Meaning

Many teams use Sigma to describe detections in a format that can be converted into queries for different security platforms.

That portability is useful, but the converted query still needs testing.

Sigma processing pipelines can transform field names and determine where the converted rule searches. A mismatch in those mappings can change which records the detection examines.

For instance, the original rule may refer to a generic identity field while the target SIEM stores the relevant CloudTrail information under a platform-specific name.

If the conversion doesn't preserve that relationship, the query may execute successfully without finding the intended activity.

Check the converted query in the actual backend. Confirm its field mappings, data sources and matching behaviour using known events.

Where the conversion changes or cannot support part of the intended logic, resolve that difference before approving the rule.

Keep both versions under change control so another engineer can understand what was generated, converted and ultimately deployed.

For teams developing this process, AI and automation in detection engineering is worth exploring alongside the underlying rule-writing workflow.

Give the Rule a Test It Might Fail

A good detection test includes events the rule should catch and events it should ignore.

Use known outcomes before tuning the query. Otherwise, it's easy to keep changing the rule until it matches the examples already in front of you.

Return to the AWS access key scenario. The team wants an investigative alert when a new access key is created for a defined sensitive IAM user.

A simple test set might look like this:

Test Scenario Expected Behaviour
An access key is created for an IAM user on the sensitive-account list Alert
An access key is created for an ordinary IAM user outside the defined scope No match for this particular rule
A different IAM operation occurs on a sensitive user No match
The expected target username is absent from the event Handle the incomplete identity deliberately and document the coverage limitation
An authorised administrator creates a key for a sensitive user Alert if the behaviour matches; investigate the legitimate explanation

A rule can correctly identify a behaviour that turns out to be legitimate. That doesn't necessarily make the detection defective.

The question is whether the resulting investigation is useful and whether the SOC can manage the volume.

Before creating an exclusion, establish what caused the match and how much legitimate activity it would suppress. An exception intended to reduce noise can also hide future attacker activity using the same account or workflow.

An Accurate Rule Can Still Be an Expensive One

Suppose the detection passes its tests and begins matching the intended behaviour.

The next question is whether the SOC can handle what it produces.

A rule that generates hundreds of low-value alerts every day may create more investigation work than the team can reasonably absorb. Evaluate the alert volume against representative activity, including legitimate workflows that match the condition.

Then inspect what the analyst receives.

Does the alert identify the affected account, the action performed and the relevant evidence? Can the investigator establish whether the activity was authorised without reconstructing the original query?

If those details are missing, the detection may be technically correct while producing an inefficient investigation.

Ask an analyst who didn't write the rule to investigate one of its matches. Their experience may expose missing context, confusing field names or assumptions the detection engineer didn't realise they had made.

hands-on training
Improve your investigation and detection skills

See how TryHackMe for Business helps teams build practical detection and investigation skills.

Join TryHackMe for Business

Give New Detections a Trial Run

Once the rule has passed its initial tests, introduce it gradually where the security platform permits.

Start with a monitored or alert-only deployment that lets the team observe matching activity without automatically triggering consequential response actions.

Review the results against the expected behaviour and refine the detection where evidence supports a change.

Before wider release, establish a small set of acceptance criteria.

Review Area What Needs to Be Proven
Detection accuracy Known positive and negative test cases produce the expected results
Data coverage Required sources and fields are available across the agreed scope
Query implementation The deployed query preserves the intended detection logic
Alert quality Analysts receive enough evidence to investigate a match
Operational impact Alert volume and query execution costs are manageable
Response safety Any downstream automation is separately tested and authorised

Preserve the test results and record changes made during tuning. A new exclusion, parser update or altered field mapping can affect coverage even when the underlying rule still appears familiar.

For rules connected to response automation, validate the complete workflow in a controlled environment before granting it authority over production systems.

Make the Rule Earn Its Place

AI can help detection engineers move through the early stages of rule development much faster.

That creates an opportunity to spend more time on the work that determines whether a detection is useful: testing real events, challenging assumptions, refining coverage and making sure analysts can investigate the results.

For SOC leaders, the priority is building teams that know how to evaluate generated detections before those rules influence production decisions.

The process becomes much more reliable when engineers and analysts can explain what a rule catches, recognise what it misses and verify its performance independently.

That's a practical skill worth developing.

Teams can explore the process in AI & Automation in Detection Engineering, then strengthen investigation and triage skills through realistic SOC Simulator scenarios.

hands-on training
Improve your investigation and detection skills

See how TryHackMe for Business helps teams build practical detection and investigation skills.

Join TryHackMe for Business
Ayomide Joseph A.
Nov 23, 2026

Recommended

Get more insights, news, and assorted awesomeness around cyber training.

Blog • 5 min read

n8n (CVE-2026-119408): How Deprecated n8n Nodes Put Workflow Credentials at Risk

In n8n, a node is one step in a workflow. Some nodes run JavaScript to transform data or handle logic specific to an integration. The modern Code node can delegate that work to a task runner, which separates workflow code execution from the main application process.

Business • 7 min read

How to Measure Whether AI Is Reducing SOC Workload

For SOC leaders, a productivity claim should answer a straightforward question: how much work has the team actually stopped doing, and what has happened to the time saved?

Business • 6 min read

After Automated Containment, What Still Needs to Be Investigated?

A response tool may acknowledge an isolation request before the operation has taken effect. Even a confirmed isolation can leave some communications permitted under the configured policy.

Join over 640 organisations upskilling their
workforce with TryHackMe