November 29, 2026
9
min

Same Attack, Same Model, Different Token Budgets

What an AI investigation consumes on raw CloudTrail in a configured ELK SIEM versus Stream.Security's ProductionTwin-enriched detections across seven CloudDefenseGoat AWS scenarios.
Petr Zuzanov
Principal Security Researcher

TL;DR

I gave an AI agent the same job ("investigate this alert") against the same attacks, with the same model on both sides, and changed what the agent had to start from. In one setup, it started from a Kibana alert and the raw CloudTrail behind it in an ELK SIEM stack. In the other it started from Stream.Security's detections on the same account, each one already carrying the context the platform's ProductionTwin model had worked out before the agent read a line. The comparison measures the combined effect of detection content, evidence representation, and agent harness. It does not isolate the contribution of the data layer alone. I compared the total token usage reported by each harness. Seven CloudDefenseGoat AWS scenarios, three models: Sonnet 4.6, Opus 5.5, and GPT-6 Astra.

The results measured: the size of the cut varies by model. Sonnet 4.6 has a 3.07x pooled token ratio, 1.70x to 5.28x per scenario. Opus 5.5 has a 2.60x pooled ratio, 2.23x to 2.90x per scenario, and GPT-6 Astra has a 2.40x pooled ratio, 2.08x to 2.96x per scenario.

The result to test is specific: does the configured Stream investigation pipeline reduce total inference work while preserving the security outcome? Report the pooled ratio within each model. Do not combine token counts from different models into one efficiency claim or infer a dollar saving from token totals alone.

What an AI investigation consumes on raw CloudTrail in a configured ELK SIEM versus Stream.Security's ProductionTwin-enriched detections across seven CloudDefenseGoat AWS scenarios.

Why count tokens at all

Spawn one investigation agent per alert, and attacker-generated noise can increase your bill when each new alert triggers a separate investigation. I'd been making that argument for a while without a number behind it. When I looked for one, I noticed most of the discussion focused on the quality of what the agent produces and on cost as a function of which model you pick. Not much was about cutting cost and token usage while holding the model fixed. Both matter, but the inference workload also needs to be measured.

‍

An investigation is a sequence of model and tool calls. When tool results are retained in conversation history, they can reappear in subsequent model inputs. Total token consumption therefore depends on context size, the number of turns, generated output, and the harness's retention, compaction, and caching policies. These are measurable properties of the investigation pipeline; this study does not establish that they dominate model choice in every workload.

The post connects token efficiency with security posture. The engineering implication is a capacity question: how much verified defensive work can a fixed inference budget support? The post motivates that question; it is not evidence of a direct proportional relationship between token availability and security outcomes.

The setup

Two configurations, same AWS account, same seven attacks, equivalent investigation objective. The trigger, detections, and harness differ.

‍

Configuration A. CloudTrail shipped into an ELK SIEM stack. Kibana's prebuilt AWS detection rules generate the alerts. I connected Claude Code and Codex to the ELK SIEM and gave each one the same task for every scenario: investigate the alert. The only constraint I added was a 24-hour window: don't go digging through anything older than that.

That window bounds the ELK search. It does not by itself establish a matched retrieval budget: field selection, result limits, aggregation, and agent stopping rules also affect how much evidence reaches the model.

‍

Configuration B. The same CloudTrail feed into Stream.Security. The platform builds its ProductionTwin model of the account (which identity can assume which role, which Lambda runs as what, which instance holds which key), runs its own detection rules on top of that model, and raises detections. StreamForce, the platform's agent harness, was given the equivalent task: investigate the latest detection.

StreamForce started from the platform's detections and the raw logs behind them, with no standing query access to inventory or to the ProductionTwin graph during the investigation. I capped it that way on purpose, so the agent couldn't walk the graph instead of investigating. The detections themselves are ProductionTwin's output, though: each one was raised by a rule that evaluated the event against the account's current state, so the agent begins from conclusions the ELK SIEM side has to reach on its own. That upstream computation is part of the configuration being measured. This run does not measure live graph querying, action simulation or autonomous remediation.

Context is computed before the agent starts

Configuration A

ELK SIEMCloudTrail + prebuilt rules
Kibana AWS alerts
Investigation evidenceAlerts and raw CloudTrail
24-hour query window
Claude Code / CodexQuery, inspect and reconstruct
General-purpose harness

Configuration B

ProductionTwinSame CloudTrail feed
State-aware detections
Investigation evidenceEnriched detections
Compact logs
StreamForceInvestigate supplied evidence
No standing graph queries
Figure 1 · Conceptual view of the reported setupModel fixed within each comparison; detectors and harnesses differ

ProductionTwin contributes context through the detections; the investigated StreamForce configuration does not have standing inventory or graph query access. Conceptual schematic, not a run trace.

Models. Sonnet 4.6, Opus 5.5 and GPT-6 Astra each ran all seven scenarios in both configurations, full totals throughout. The original setup describes the reasoning-effort setting as high on both sides. Exact provider model IDs, API parameters and harness versions are needed to reproduce that configuration; a shared label does not guarantee equivalent compute across providers.

‍

The attacks. All seven AWS scenarios from CloudDefenseGoat, Stream.Security's open-source library of vulnerable cloud environments. Each one ships with Terraform to stand up the lab and a deterministic attack script, so every run of a given scenario produces the same chain, from the starting foothold (a leaked key or an exposed endpoint) to the same final objective. I used AWS/1 through AWS/7 exactly as they ship. The scenario definitions are available in the repository. Pin the tested commit and record the deployment and attack commands for reproduction. A deterministic attack script does not make an AI investigation deterministic.

Counting rule. The number in every table below is the total token count the harness reported for a run: everything it billed, summed into one figure.

‍

The absolute numbers will shift with how busy the environment is. Mine ran at a medium load, not an empty lab, not a full production account either. Run the same comparison on a quieter or a noisier environment and the totals will move. The ratio between the ELK SIEM and Stream.Security should hold regardless of how loud the environment is.

Token counts are only compared within the same model. Tokenization and billing categories can differ by provider and model, so every performance ratio in this post is one model against itself: same scenario, ELK SIEM versus Stream.Security. Nothing is converted to dollars.

Results

For each scenario, R = ELK tokens / Stream tokens. The Total row uses the pooled ratio: sum of ELK tokens / sum of Stream tokens. Token reduction is 1 - 1/R; a 2.60x pooled ratio corresponds to 61.5% fewer tokens, and 2.40x corresponds to 58.3% fewer tokens.

Table 1. Sonnet 4.6

ScenarioELK SIEM + SonnetStream.Security + SonnetELK SIEM / Stream.Security
AWS 1945,024179,000
5.28x
AWS 21,832,039419,500
4.37x
AWS 32,087,0371,003,000
2.08x
AWS 41,321,495333,014
3.97x
AWS 51,722,330449,516
3.83x
AWS 6763,621448,116
1.70x
AWS 7854,920267,812
3.19x
Total9,526,4663,099,958
3.07x

Median 3.83x. Lowest 1.70x (AWS 6), highest 5.28x (AWS 1). No scenario used fewer tokens on the SIEM in the source table.

Table 2. Opus 5.5

ScenarioELK SIEM + Opus 5.5Stream.Security + Opus 5.5ELK SIEM / Stream.Security
AWS 11,023,637418,200
2.45x
AWS 21,774,345611,900
2.90x
AWS 33,734,8051,442,200
2.59x
AWS 41,349,307563,800
2.39x
AWS 52,022,600725,800
2.79x
AWS 61,445,563648,800
2.23x
AWS 71,211,123420,600
2.88x
Total12,561,3804,831,300
2.60x

Median 2.59x. Lowest 2.23x (AWS 6), highest 2.90x (AWS 2).

Table 3. GPT-6 Astra

ScenarioELK SIEM + AstraStream.Security + AstraELK SIEM / Stream.Security
AWS 1935,671326,700
2.86x
AWS 21,458,278554,800
2.63x
AWS 33,108,2141,492,500
2.08x
AWS 41,401,570660,300
2.12x
AWS 51,844,229773,900
2.38x
AWS 61,318,523444,800
2.96x
AWS 7876,795306,700
2.86x
Total10,943,2804,559,700
2.40x

Median 2.63x. Lowest 2.08x (AWS 3), highest 2.96x (AWS 6).

Put the three model tables side by side: Sonnet's source gap spans 1.70x to 5.28x, with a 3.07x pooled ratio. The Opus and Astra comparisons span 2.23x to 2.90x and 2.08x to 2.96x, with pooled ratios of 2.60x and 2.40x. There are 21 scenario-model pairs.

Pooled savings within each model

Sonnet 4.6
32.5%67.5% fewer tokens
Opus 5.5
38.5%61.5% fewer tokens
GPT-6 Astra
41.7%58.3% fewer tokens
Within-model ELK total normalized to 100%
Stream token useToken reduction

Percentages describe token consumption, not dollar cost, task success or latency.

The spread behind the pooled ratios

Every scenario shows a different token ratio

Sonnet 4.6Opus 5.5GPT-6 Astra
AWS 1AWS 2AWS 3AWS 4AWS 5AWS 6AWS 7
Parity
0123456

ELK SIEM tokens / Stream.Security tokens

Why the SIEM reads more

This explanation comes from watching the runs, not from a token-bucket breakdown; it is interpretation, not measured data. Three differences in the setup are plausible contributors to the gap. I'll take them in the order I think matters.

Stream.Security raised four to five detections per scenario; the ELK SIEM raised one or two. The reason is in how the two sides write a detection rule.

The selected Kibana prebuilt AWS rules match patterns in the event stream: this eventName from this eventSource, sometimes with a threshold or a first-seen condition on top. In the reported configuration, they did not attach the same account-state context as Stream's detections. The agent inherits the one or two alerts that fire and starts digging from there. This describes the configured baseline, not an inherent limit of all Elasticsearch or SIEM deployments.

Stream.Security's rules evaluate the same CloudTrail event against the current state of the account in ProductionTwin: what the touched object is, what it is connected to, what the identity behind the call can reach, and what changed compared to a minute ago. That is why "this Lambda's code changed" or "this identity just minted a new key" arrives as a detection with the who, the through-which-role and the what-else-is-reachable already attached. Each one works like a signpost. The ELK SIEM agent has to build the missing context itself, one Elasticsearch query at a time, and retained query results can enlarge later model inputs.

‍

Stream.Security stores each log line in a more compact, optimized format. The record the agent reads back on that side is already smaller than the full CloudTrail event sitting in ELK, where every field comes through exactly as AWS sent it.

The ELK SIEM agent can retrieve full-size records and unrelated background activity within the 24-hour window, including Terraform applies and AWS service-linked roles doing their rounds. It does not inherently have to retrieve every record. Elasticsearch supports filtering, field selection and aggregation; an optimized baseline should use these capabilities and disclose its retrieval settings. The Stream.Security agent reads logs already stored in the more compact format.

‍

The two sides don't run the same harness. StreamForce is the platform's own purpose-built agent scaffold. Claude Code and Codex are general-purpose coding agents, pointed at a SIEM they weren't built for. A harness designed around one kind of investigation is likely to use its context more efficiently than a general-purpose one improvising Elasticsearch queries, independent of which model sits behind it.

‍

I can't cleanly separate how much of the gap each of the three accounts for. A matched-harness ablation, a retrieval-optimization-only baseline and an enriched-detection baseline would help separate their contributions. Until then, attribute the result to the tested end-to-end configurations.

Quality, briefly

This study measures token consumption, and I didn't score every investigation line by line. That limits the efficiency claim: fewer tokens are useful only when the investigation still reaches an acceptable, evidence-supported result.

‍

Most of the seven CloudDefenseGoat AWS scenarios simulate documented techniques. On qualitative review, quality held up on six of the seven: some runs read a little better than others, some a little worse, but regardless of model, what came back was judged useful for a SOC engineer to pick up and keep going. This was not a blinded, rubric-based quality evaluation and does not establish equivalent accuracy or generalization to unseen attacks.

‍

AWS 5 is the exception. It isn't a standard technique or a common misconfiguration; the flow itself isn't complicated, but it is unusual. Working from raw logs alone, the ELK SIEM runs reconstructed only a partial picture of what happened. StreamForce, on the same attack, produced a full investigation. A material difference is that Stream.Security has a detection rule built for this specific technique, where the ELK SIEM is running its fairly generic defaults. That rule is a plausible contributor to the fuller investigation. The experiment does not isolate its contribution from the other configuration differences.

What this means for the security bill

Hold the model fixed and the configured investigation pipeline can change token consumption substantially. Choosing a model sets its tokenization and pricing terms. Choosing what the model reads, how context is retained and how the harness investigates affects how many tokens it uses. The present comparison changes all three; it does not prove a data-layer-only effect.

‍

It compounds with how you organize the agents. Alert volume, deduplication and investigation policy affect how many investigations you run, while the evidence and harness affect what each consumes. An agent-per-alert design can repeatedly reconstruct overlapping context. Measure that repeated work before extrapolating a per-investigation result to a Security-wide budget.

‍

ProductionTwin maintains connected production context that can be reused across prevention, detection, hunting and response. Maintaining that context upstream gives successive defensive missions a shared starting point. This experiment tests one part of that architecture: investigations starting from ProductionTwin-enriched detections. It does not test the token cost or safety of autonomous remediation, action simulation or the complete cross-environment defense loop.

Treat inference cost, end-to-end latency and platform cost separately. A token reduction is not the same percentage reduction in dollars when input, output and cache categories have different prices. ProductionTwin maintenance, ingestion, storage and query execution also consume resources. A full economic comparison should include those costs and the workload used to allocate them.

‍

For a Security team evaluating a solution, the obvious question isn't only whether it has AI, or how good its output looks in a demo. It's how that AI is fed: how much of the investigation is already done before the model starts, and what it actually costs in tokens once it's running against your own noisy environment instead of a vendor's clean demo account.

‍

CloudDefenseGoat, the open-source framework we've written about on this blog before, gets one more reason to use it. Run the same attack against your own stack and your own agent, repeat the investigation, and measure both token consumption and verified outcomes before you commit budget. Use an isolated test account and the repository's deployment and cleanup instructions.

About Stream Security

Stream is the AI-native platform built to fight AI-enabled attacks. It autonomously prevents, detects, hunts, and remediates exposures and threats across production at machine speed - driving risk toward zero. It replaces the fragmented stack of scanners, runtime agents, exposure tools and playbooks with one live model of production.Defending Production needs a new approach: Stream is the only Autonomous Production Defense Platform that works across your entire production estate. It runs on a patented CloudTwin®, a high-fidelity security data harmonization layer that models Cloud, SaaS, identity, runtime, AI, network, perimeter, on-prem, security controls, and the behavior running on top of them into one live model of production: real-time, fully correlated, continuously updating. Not a snapshot. And it does not stop at boundaries - the boundaries that fragment every other tool are the same boundaries an attacker moves across. Inside CloudTwin they are one system.

Petr Zuzanov
Principal Security Researcher

We wouldn’t believe it either.

Get a demo