← Lab /Security & privacy

Elastic InfoSec reduces AI agent LLM calls by 60% using a five-step optimization loop

Applying their five-step optimization loop reduces LLM call counts for their agents from 14-19 calls to 7-9 calls, a 60% reduction.

Security & privacy Elastic Security Labs 27 Jul 2026 Method Deployed evidence

Published as “Inside Elastic InfoSec's agentic SOC: How we cut AI agent LLM calls by 60%”

Why it matters

Cutting LLM calls lowers operational costs and makes AI-driven security agents more predictable at scale.

Summary

Elastic InfoSec runs 14 AI agents that originally required up to 19 LLM calls per alert, far more than the 8 calls actually needed. They introduced a five-step loop-measure, capture test conversations, analyze traces, revise instructions, and monitor drift-to identify and fix inefficiencies such as vague stopping criteria and redundant queries. After revising prompts with concrete checklists and rules, the same alerts required only 7-9 LLM calls, roughly a 60% cut. The evidence comes from median LLM call counts on production alerts before and after the changes, though the sample of test conversations is small.

What they found 1

  1. LLM call count dropped from 14-19 to 7-9 after applying the new prompt checklist.

    “The same class of alert that previously took 14-19 LLM calls came in at 7-9 after this change.”

Caveats 5

  • The authors note that only two to four test conversations per agent are needed for analysis, indicating a very small sample size for the reported improvement.
  • Even after optimization, agents still make 7-9 LLM calls, which is higher than the ideal 8-call target.
  • Small test sample; the authors explicitly state that a large statistical sample is not required.
  • Results are based on Elastic's own fleet and may not generalize to other environments without similar data volumes.
  • The process requires manual prompt revisions and verification of output quality.

What’s new here 4

  • A repeatable five-step optimization loop for AI agents in security operations.
  • Demonstrated 60% reduction in LLM calls across 14 production agents.
  • A prompt template that can be applied to any AI assistant.
  • Guidance on measuring, analyzing, revising, and monitoring agent performance at scale.