Cybersecurity
Context Compaction Reduces Agent Input Tokens by 86% in Automated Malware Analysis
SentinelLABS evaluated native context compaction in long-running agentic malware analysis workflows. The technique reduced input token consumption by roughly 86% without degrading output quality, offering a viable method to curb costs and noise in automated security operations.
What Happened
SentinelLABS tested native context compaction mechanisms—specifically evaluating implementations like OpenAI's Responses API—against an automated malware analysis evaluation harness. Long-running security agents typically suffer from context accumulation, where irrelevant historical data degrades model performance and inflates token costs. The evaluation measured the impact of compressing prior agent context into denser working states during complex reverse-engineering tasks.
Impact
The evaluation demonstrated an 86% reduction in input tokens across long-running agent evaluations with no measurable drop in aggregate evaluation scores. Automated malware analysis requires models to maintain working theories, track evidence, interpret decompiler outputs, and manage call relationships over extended execution chains. Compaction successfully pruned operational noise without sacrificing the correctness or completeness of the final analysis against golden reference reports.
What Defenders Should Do
SecOps and engineering teams building or deploying autonomous security agents should integrate context-management patterns to control resource consumption. Defenders should evaluate native runtime compaction features provided by LLM application programming interfaces or implement equivalent state-compression loops to maintain signal-to-noise ratios in extended analysis pipelines.
- Audit existing agentic workflows for unmanaged context accumulation and spiraling token costs.
- Incorporate runtime compaction or custom summarization layers for long-running tasks such as binary analysis and log triage.
- Benchmark agent performance and task accuracy before and after implementing context compression to ensure fidelity.