← Lab /Security & privacy

Embedding LLM reasoning in ES|QL queries improves alert triage without extra middleware

Elastic claims that the ES|QL COMPLETION command lets detection engineers embed LLM judgment directly in queries, reducing false positives and manual effort.

Security & privacy Elastic Security Labs 24 Feb 2026 Defense Prototype evidence

Published as “Beyond Behaviors: AI-Augmented Detection Engineering with ES|QL COMPLETION”

Why it matters

Embedding LLM judgment in detection queries can streamline triage and reduce the need for extensive exception lists.

Summary

Elastic adds a COMPLETION command to ES|QL that calls an LLM inside a query, allowing analysts to build a context string from correlated alerts and receive a structured verdict. Pre-built rules aggregate alerts, construct prompts, and parse LLM responses, filtering on confidence > 0.7. The post shows a handful of real-world examples where the LLM correctly labels benign SCCM activity as false positives and flags true attack chains, but the evidence is limited to a few illustrative cases.

What they found 1

  1. COMPLETION limits processing to 100 rows per execution by default

    “By default, COMPLETION automatically limits processing to 100 rows per execution.”

Caveats 5

  • The post notes that feature release timing is at Elastic's discretion and may not be delivered on time or at all.
  • COMPLETION processes at most 100 rows per execution, requiring careful limit and threshold tuning.
  • Requires an Elastic Cloud subscription or self-hosted LLM connector.
  • The authors advise testing prompts with the ROW command before production deployment.
  • Feature availability and timing are not guaranteed.

What’s new here 4

  • Introduces the ES|QL COMPLETION command for inline LLM inference.
  • Provides a pattern (aggregate → build context → COMPLETION → DISSECT → filter) for LLM-as-judge detection.
  • Ships pre-built detection rules for host-based attack chain triage and compromised user triage.
  • Imposes a default 100-row limit per COMPLETION call to control cost and scalability.