Ilmu Komputer & AI editorial
Open AccessOA2026
Evaluating Context Segmentation in Locally Deployable SLMs for Cybersecurity CTF Tasks
A two-level agentic framework that isolates sub-problems to combat context bloat in memory-constrained small language models
Sebastiano Nordio; Michele Lottoยท 2026ยท DOI 10.48550/arXiv.2609.12839
The core problem
The proliferation of highly capable open-weight Small Language Models (SLMs) democratizes access to advanced cybersecurity capabilities, posing an escalating risk as these models can bypass proprietary API guardrails when deployed locally. However, SLMs deployed as autonomous agents often struggle with long-horizon, exploratory tasks like cybersecurity Capture The Flag (CTF) challenges due to context bloat and cognitive degradation from accumulated tool-call outputs. To understand and mitigate this cybersecurity threat, the authors introduce **context segmentation**, a two-level agentic framework that divides complex exploitation tasks into manageable, contextually isolated sub-problems. The work is motivated by the observation that as an agent accumulates tool-call outputs, its effective reasoning capacity degrades, leading to failed exploitation attempts. The central research question is whether explicitly segmenting the context can restore performance on long-horizon tasks without increasing model size or memory footprint.
Innovation
The evaluation on picoCTF with gemma-4 E4B models yields three key quantitative findings. First, for the E4B model, context segmentation acts as an **intelligent search**, achieving competitive rewards with **superior token efficiency** compared to brute-force retries. Second, the framework successfully solves **18.52%** of tasks that standard agentic execution fails to complete. Third, the token efficiency gain is attributed to the reduction of redundant tool calls and the avoidance of context bloat, which in baseline agents leads to repeated or contradictory actions. The authors report that the segmentation strategy does not require additional memory beyond the base model, making it suitable for locally deployable SLMs. The 18.52% improvement is measured as the proportion of tasks where the segmented agent succeeds and the baseline agent fails, relative to the total number of tasks attempted. No absolute success rates are provided in the abstract, but the relative improvement is statistically significant in the reported experiments.
The proliferation of highly capable open-weight Small Language Models (SLMs) democratizes access to advanced cybersecurity capabilities, posing an escalating risk as these models can bypass proprietary API guardrails when deployed locally. However, SLMs deployed as autonomous agents often struggle with long-horizon, exploratory tasks like cybersecurity Capture The Flag (CTF) challenges due to context bloat and cognitive degradation from accumulated tool-call outputs. To understand and mitigate this cybersecurity threat, the authors introduce **context segmentation**, a two-level agentic framework that divides complex exploitation tasks into manageable, contextually isolated sub-problems. The work is motivated by the observation that as an agent accumulates tool-call outputs, its effective reasoning capacity degrades, leading to failed exploitation attempts. The central research question is whether explicitly segmenting the context can restore performance on long-horizon tasks without increasing model size or memory footprint.
The proposed context segmentation framework operates at two levels. At the **outer level**, a high-level planner decomposes the overall CTF challenge into a sequence of sub-goals, each representing a self-contained exploitation or reconnaissance objective. At the **inner level**, a worker agent executes each sub-goal in an isolated context window, receiving only the task description and the minimal state required, thereby preventing irrelevant tool-call outputs from polluting the reasoning process. Formally, let the full task be and the accumulated context at step be . Standard agentic execution conditions the policy on the entire history:
Why it matters
The results suggest that context segmentation addresses a fundamental limitation of SLMs in long-horizon tasks: the degradation of reasoning due to accumulated irrelevant information. By isolating sub-problems, the framework effectively resets the model's working memory, allowing it to focus on the current objective. This is analogous to **chunking** in human problem-solving, where complex tasks are broken into manageable parts. The cybersecurity implications are twofold. On one hand, the framework lowers the barrier for malicious actors to leverage locally deployed SLMs for exploitation, as it improves success rates without requiring larger models or cloud APIs. On the other hand, it provides a blueprint for defenders to understand how such attacks can be automated, potentially informing the design of guardrails or detection mechanisms. The authors note that the approach is general and could be applied to other long-horizon agentic tasks beyond CTF. Limitations include the evaluation on a single dataset (picoCTF) and a single model family (gemma-4), which may affect generalizability. Future work could explore adaptive segmentation strategies and integration with memory-augmented architectures. The code is available at https://github.com/9xeb/context-segmentation.
Who should read this
CS practitioners and researchers
Opening member contentโฆ