How Elastic’s SOC decided to let AI close 12% of cases on its own
The post breaks down our AI alert triage accuracy at every confidence level and includes the ES|QL query that produced it, ready to run against your own cases.
Our AI alert triage agents now close 12% of security operations center (SOC) cases without an analyst, and analysts clear another 16% with a single click. A case auto-closes only if it’s medium severity, has a benign verdict, carries 90% or higher AI confidence, is a common alert type, and has similarities to a case that an analyst already closed by hand. All five conditions must be met every time. Plus, auto-closed cases never count as history for later cases, so every auto-closure traces back to a human decision.
In Part 1 of our series on Elastic’s agentic SOC, we covered how we took AI alert triage from 60% to 92% accuracy, and we explain the agents and case custom fields in more detail. In today’s post, we go through the confidence scale that we wrote into the agent prompt and the 30 days of accuracy data that set the 90% threshold. We also cover the Elasticsearch Query Language (ES|QL) Investigation Trail, which adds every query that an agent ran to the case comments, and the workflow condition that does the threshold check.
Running Elastic Agent Builder in our own SOC as Customer Zero
At Elastic, our internal SOC operates as Customer Zero, meaning that we’re the first and most demanding user of every feature we ship. We run the newest versions of Elastic Security and Elastic Agent Builder in our production environment, often before they reach general availability (GA), across a globally distributed fleet of laptops and servers, as well as cloud workloads. The workflows and agent configurations shown in this post reflect our setup as of version 9.5.5.
How we set the AI confidence scale for alert triage
An important part of the auto-closure step is making sure that the AI confidence guidance inside our L1 Investigation Agent was clear. If a medium-severity alert has an AI verdict with 90% or higher confidence and meets all of the criteria discussed below, it auto-closes. For this reason, it’s important to set clear guidelines for what our agent counts as 90%+ confidence. Following is an excerpt from the Custom Instructions prompt that we give the Investigation Agent, showing its confidence scale for benign and suspicious verdicts. Only the benign tiers at 90% and above can auto-close.
BENIGN scale (True Positive - Benign / False Positive - Benign):
0-69% - Needs user confirmation or more analyst research but no signs of malicious indicators
70-89% - Most of the steps in the investigation guide confirm this is benign but not all steps could be completed. List completed vs. total steps (STEPS_COMPLETED: x/y). If the investigation guide specifies you need user confirmation you must not exceed 89%.
90-94% - All investigation guide steps completed successfully (null or empty results do not qualify), none show malicious indicators. You see near-match cases in the past matching this activity.
95-97% - A prior analyst-closed benign case for the SAME rule shares the same entity (user, service account, host, or IP/IP block) AND the same behavior. It seems to be related to this activity. Cite the case ID and matched fields.
98-99% - Previous analyst-closed benign case with exact same detection, user and 2 other fields that are the same and within a 1 hour timeframe from the original event.
Closures noted as unconfirmed, merged, batch-closed, or auto-closed do NOT qualify for 90%+.
SUSPICIOUS scale (True Positive - Suspicious):
0-74% - Policy-violating or PUA software, or unauthorized activity, that needs user confirmation based on past similar cases.
75-84% - Requires >= 1 positive malicious indicator. "Could not verify ownership or attribution" alone is NOT an indicator.
85-94% - Multiple malicious indicators, or investigation guide steps completed and strongly point towards malicious behavior, or a rare alert with past cases pointing towards true positive suspicious.
95-99% - Most past cases are true positive suspicious and this case follows the same pattern as past cases, or very high confidence of full system compromise needing immediate containment. A confirmed security event (e.g., laptop theft) reported in a ServiceNow ticket would also fall into this category.How accurate is AI alert triage at each confidence level?
Over the last 30 days, we evaluated how often our AI triage agents were correct (had the same verdict that an analyst independently came to). As the chart shows, above 90% confidence, the agents are almost always correct. Accuracy isn’t 100%, but humans aren’t either, especially under alert fatigue. Letting AI handle some lower priority alerts is a good way to reduce alert fatigue, although it isn’t perfect. Every well-understood, repetitive alert that the AI closes gives an analyst more time to spend on the cases that need human judgment. This means faster response and containment for truly malicious activity and less burnout for the people doing the work. We chose the confidence thresholds that we were comfortable with to reduce our analyst alert fatigue and analyst workload. This may look different for every team, depending on its risk tolerance.
You may wonder how we know that the AI stays accurate once analysts aren’t closing these cases themselves. The key is that analysts still close new and unfamiliar alerts. The first few times that an alert fires, the Investigation Agent usually can’t reach 90% confidence, either because it can’t complete the investigation guide steps or because there’s no matching history, so an analyst reviews and closes it. Auto-closure only starts once similar cases follow an analyst-closed case. As we noted earlier, auto-closed cases never count as history for later alerts, so every auto-closure traces back to an analyst’s decision.
Below is the query used to reach the conclusions shown in the chart above. It uses many of the Kibana case custom fields that we discussed in the previous blog post, including:
Custom field | Filled by |
|---|---|
| Analyst |
| Analyst |
| AI agent |
| AI agent |
Once the triage agents were filling out the AI custom fields (AI Verdict and AI Confidence), and analysts were filling out the close reason and flagging AI incorrect when they closed cases, we had the data to confidently start with auto-closure. This decision was based on a history of high accuracy at different confidence levels. The following query looks at cases closed in the last 30 days that have both an AI verdict and an analyst close reason. It counts the AI as correct when its verdict matches the analyst’s outcome and the AI Incorrect field isn’t flagged. It then groups the results by confidence level (100, 90, 80, 70, and all), so you can see how accuracy changes as confidence drops:
FROM .cases METADATA _source
| WHERE case.closed_at >= NOW() - 30 days AND case.created_at >= NOW() - 30 days
| EVAL analyst_close_reason = JSON_EXTRACT(_source, "$.case.extended_fields.analyst_close_reason_as_keyword")
| EVAL ai_verdict = JSON_EXTRACT(_source, "$.case.extended_fields.ai_verdict_as_keyword")
| WHERE analyst_close_reason IS NOT NULL AND analyst_close_reason != "other" AND ai_verdict IS NOT NULL AND ai_verdict != ""
| EVAL ai_confidence = COALESCE(TO_INTEGER(JSON_EXTRACT(_source, "$.case.extended_fields.ai_confidence_as_integer")), 0)
| EVAL ai_incorrect = COALESCE(JSON_EXTRACT(_source, "$.case.extended_fields.ai_incorrect_as_boolean"), "false")
| EVAL ai_is_benign = ai_verdict IN ("True Positive - Benign", "False Positive - Benign")
| EVAL ai_is_suspicious = ai_verdict == "True Positive - Suspicious"
| EVAL analyst_is_benign = analyst_close_reason IN ("benign_positive", "false_positive")
| EVAL analyst_is_tp = analyst_close_reason == "true_positive"
| WHERE analyst_is_benign OR analyst_is_tp
| EVAL correct = ai_incorrect != "true" AND ((analyst_is_benign AND ai_is_benign) OR (analyst_is_tp AND ai_is_suspicious))
| EVAL outcome = CASE(
analyst_is_benign AND correct, "benign_correct",
analyst_is_benign, "benign_wrong",
analyst_is_tp AND correct, "tp_correct",
"tp_wrong")
| EVAL threshold = [100, 90, 80, 70, 0]
| MV_EXPAND threshold
| WHERE ai_confidence >= threshold
| STATS
benign_correct = COUNT(CASE(outcome == "benign_correct", 1)),
benign_wrong = COUNT(CASE(outcome == "benign_wrong", 1)),
tp_correct = COUNT(CASE(outcome == "tp_correct", 1)),
tp_wrong = COUNT(CASE(outcome == "tp_wrong", 1))
BY threshold
| EVAL total_correct = benign_correct + tp_correct,
total_cases = benign_correct + benign_wrong + tp_correct + tp_wrong
| EVAL benign_ptg_correct = CONCAT(TO_STRING(ROUND(100.0 * benign_correct / (benign_correct + benign_wrong), 1)), "%"),
tp_ptg_correct = CONCAT(TO_STRING(ROUND(100.0 * tp_correct / (tp_correct + tp_wrong), 1)), "%"),
total_ptg_correct = CONCAT(TO_STRING(ROUND(100.0 * total_correct / total_cases, 1)), "%")
| SORT threshold DESC
| EVAL confidence = CASE(threshold == 0, "all", TO_STRING(threshold))
| KEEP confidence, benign_correct, benign_wrong, benign_ptg_correct, tp_correct, tp_wrong, tp_ptg_correct, total_correct, total_cases, total_ptg_correctThe five conditions that an alert must meet to auto-close
To put it simply, our team currently uses auto-closure for medium severity cases where the agent has a 90+% confidence in a benign verdict. In practice, the following are the thresholds that our team decided on:
Type of threshold | Value required | Stored location |
|---|---|---|
Alert severity | Medium only | kibana.alert.severity |
AI verdict |
| Custom fields ( |
AI confidence | 90%+ | Custom fields ( |
Uniqueness (from Pattern Finder Agent) |
| JSON from Pattern Finder Agent ( |
Past false positive rate from same detection (from Pattern Finder Agent) | 90%+ | JSON from Pattern Finder Agent ( |
We decided to start this auto-closure with medium-severity alerts only, because our team mainly reviews alerts of medium, high, and critical severity. Low-severity alerts are informational.
We worked closely with our detection team to ensure that all of our medium-severity alerts had detailed investigation guides attached and were safe to auto-close:
Each investigation guide was updated to include step-by-step instructions for our AI triage agents to follow, with example ES|QL queries to ensure that we could reach a high level of accuracy and confidence without analyst interaction.
Any alert that the detection team felt always needed human input and should never be auto-closed was moved up to high or critical severity or had a
NO_AUTOCLOSEtag applied.
This keeps severity reflective of actual risk, with auto-closure handled as its own explicit control. After we’re comfortable with results at medium severity, we plan to extend auto-closure to high-severity alerts. We’ll continue to use the NO_AUTOCLOSE tag to exclude any alert that always needs a human.
After reviewing the data shown above and seeing our accuracy levels at different confidence percentages, we decided to only auto-close alerts that have 90%+ AI confidence and a benign verdict (either True Positive - Benign or False Positive - Benign) from our Investigation Agent.
The next two fields we incorporated came from the Pattern Finder Agent’s JSON output:
Uniqueness (
RAREorCOMMON) and the false positive rate. Uniqueness is based on how many cases we’ve seen for that same rule name in our environment. If we’ve seen fewer than three cases in the last 30 days, that rule isRARE. We want an analyst to review it, sinceRAREalerts have less historical baseline to auto-close on.The false positive rate comes from the closure reasons that analysts specify in the last 50 cases. For example, if 45 of the last 50 cases were closed by an analyst as false positive, that rate would be 90%.
Cases with the verdict of True Positive - Suspicious are never auto-closed. Instead, we plan to go the other direction and auto-remediate high-confidence suspicious cases, such as isolating affected hosts and resetting session credentials.
How do you audit the work that an AI triage agent has done?
Before AI could auto-close cases, we needed to be able to show our work. Previously, the Summarizer Agent dropped raw ES|QL queries into case comments with no context, which made them hard to follow. Now each query comes with why it was run and what it returned, so analysts and auditors can retrace the AI’s reasoning step by step. We called this the ES|QL Investigation Trail. Here’s a snippet from our Summarizer Agent prompt, where we designed this Investigation Trail:
**🔗 ES|QL Investigation Trail** *(in the order run)*
{For each entry in ESQL_QUERIES_RUN, render as below, numbered sequentially. If ESQL_QUERIES_RUN is empty or "None", omit the Investigator queries}
**Query {n}** — {SIGNIFICANCE, one line}
```esql
{QUERY verbatim}
```
> **Returned:** {RESULT}Below is an example of a real case worked by our Investigation Agent and the Investigation Trail that we printed to the comments by our Summarizer Agent:
We also changed the prompt slightly to confirm which steps (from the detection rule’s investigation guide) our Investigation Agent has completed, along with which steps the analyst still has to look into. When it’s above 90% confidence and is auto-closed, this also gives our team more confidence that AI has completed all of the necessary steps. Here’s a subset of that prompt within the agent:
**Investigation Guide Suggestions** (only include if it is present)
- List Investigation Guide Steps in a bulleted list
- Specify if the step has been completed by prefixing the step with [COMPLETED] or [INCOMPLETE] and suffixed with a :: (two colons) then explaining the work you already did on this step or why it was not completed.
- Quick summary of what the analyst should do next based on the investigation guide or how to confirm this activity in a bullet point prefixed with [NEXT STEPS].Where auto-closure fits in the agentic SOC alert pipeline
In our previous post, we left off after the three AI triage agents ran inside a workflow in Elastic Workflows and posted to the Kibana case and Slack. In this post, we wanted to take a step back and show the whole alert ingestion process, beginning with alert ingestion and moving to assessment for potential auto-closure.
Many of our alerts never make it to an agent. This keeps our costs lower than they would be if we ran every alert through one. Most of our alerts are pre-filtered in the following ways:
Filtering out unwanted alerts (development alerts, informational alerts, low severity).
Running API calls, ES|QL lookups, and list checks for alerts that can be closed with one or two lookups.
Deduping for high-volume alerts (more than 15 per hour with the same kibana.alert.rule.uuid).
New for auto-closure is that after we post to the case and Slack, we check the auto-closure thresholds specified above and, if the case meets all of them, we close it. We built the auto-closure thresholds and the child workflow entirely from an IF condition and API calls (not an agent), so there’s no room for interpretation about which thresholds must be met. Cases are closed with the correct custom fields and tags every time. The following check_autoclose_conditions step was added to our Agent Brainstorm Workflow that we discussed in the last post:
- name: check_autoclose_conditions # The IF conditions live here instead of inside the child workflow so the child only launches for alerts that qualify, which cuts noise.
type: if
condition: ${{ steps.format_confidence_and_benign_verdict.output.verdict_is_benign == 'true' and steps.format_confidence_and_benign_verdict.output.confidence_numeric > 89 and steps.resolve_patternfinder_fields.output.uniqueness == 'COMMON' and steps.resolve_patternfinder_fields.output.fp_benign_pct_numeric > 89 and steps.resolve_severity.output.current_severity == 'medium' }}
steps:
- name: CloseCase_Auto_Triaged_By_AI
type: workflow.execute
with:
workflow-id: closecase-auto-triaged-by-ai
inputs:
case_id: "{{ steps.CaseIDLookup_ByAlertID.output.case_id }}"
ai_verdict: "{{ steps.SummarizerAgent.output.ai_verdict }}"
ai_confidence: "{{ steps.SummarizerAgent.output.ai_confidence }}"
uniqueness: "{{ steps.resolve_patternfinder_fields.output.uniqueness }}"
percentage_false_positive_or_benign_last_50_cases: "{{ steps.resolve_patternfinder_fields.output.fp_benign_pct_numeric }}"
case_severity: "{{ steps.resolve_severity.output.current_severity }}"
source_automation: "[Kibana_Workflow]{{consts.workflow_name}} - {{execution.url}}"
else:
- name: debug_autoclose_skipped
type: console
with:
message: |-
Autoclose skipped - one of the following thresholds was not met:
ai_verdict={{ steps.SummarizerAgent.output.ai_verdict }}
confidence={{ steps.format_confidence_and_benign_verdict.output.confidence_numeric }}
uniqueness={{ steps.resolve_patternfinder_fields.output.uniqueness }}
pct_fp_benign={{ steps.resolve_patternfinder_fields.output.fp_benign_pct_numeric }}
severity={{ steps.resolve_severity.output.current_severity }}How auto-closed cases are tagged and sent to Slack
Once a case is confirmed to meet our auto-closure thresholds, we add the tag AutoClose_AI_Triaged, which lets us measure the percentage of cases that are auto-closed versus worked manually by analysts. We then close the case, we place the AI summary prefixed with Auto-Closed in the Close Notes field that analysts would normally fill out.
We’re still sending these cases to Slack with the summary prefixed Auto-Closed. This gives us more visibility about which cases AI triage is auto-closing, and we don’t have to comb through the case queue.
Less than 30% of our cases are now manually triaged
Over the last month, of the cases that reached the analyst queue (after merging and filtering), 71% were closed or directly supported by AI and automation:
Resolved by AI triage with little or no manual work: 28%. Agentic triage closed 12% with no analyst interaction, and analysts closed another 16% with a single click on the Close Case: AI Correct button that we covered in the last blog.
Closed with AI assistance: 19%. Analysts used our internal incident response (IR) Model Context Protocol (MCP) server to query cases and alerts, as well as data, across all security clusters in plain language, rather than manually writing ES|QL. This let the analysts investigate and close faster.
Handled by other automation: 24%. Specifically, 11% were closed through distributed alerting (that is, the user confirmed that the activity was theirs), and 13% were merged by analysts using a Merge Case button.
What we’re building next
Beyond expanding to high severity and adding auto-remediation, we expect agent accuracy to keep improving as we add more context and tune our prompts. Higher confidence means that more cases will clear our thresholds without our intervention. The more cases that we can confidently auto-close, the more detections we can turn on, improving overall visibility without adding to analyst workload.
To maintain accuracy, we plan to add a QA Agent that samples cases and verifies the findings using a different AI model than the one that our triage agents currently run on. We also plan to build a model comparison workflow that runs the same set of cases through two models and calculates the accuracy of each, so we can test a new model before upgrading our triage agents.
Stay tuned for additional blog posts, where we’ll explore our AI triage progress further.
Frequently asked questions
Will there be an agent bias toward true positive or false positive, based on past cases?
This is something we built our prompts to avoid. We’ve seen very similar correctness rates among malicious cases (90%+), which suggests that the model isn't just defaulting to the majority verdict. Our agents have done fairly well at avoiding bias, but it remains a concern as we continue to monitor and tune this process. Following is a line from our Investigation Agent prompt:
Do not assume benign from history alone when the current behavior differs from prior cases.
When the current alert closely matches analyst-closed benign cases (same identifying fields, same
behavior), history is strong evidence and should drive the verdict.How will we decide which detections are noisy and need tuning?
Our team wrote a blog post that covers how we decide on which alerts need to be tuned. We’ll implement the AutoClose_AI_Triaged tag into this process so the detection team can review patterns with alerts that are frequently auto-closed.
How helpful was this content?




