Dynamic Attack-State Memory for Multi-Hop Exploit Agents

When a large language model attacks a network, it usually breaks in fine and then falls apart. RangeFactory documents this precisely: on RangeBench — 1,148 validated containerized multi-host ranges built from 287 attack chains — agents that successfully breach the first host go on to fail 24.5% to 47.0% of subsequent hops, with the best model (Kimi-K3) degrading from 73.8% success on 1-hop tasks to 55.7% on 3-hop tasks. The authors attribute this "sustained-compromise gap" to failures of long-horizon thinking and state maintenance, but they treat the agent's context window as an unmeasured black box. Meanwhile, the context-limiting literature has converged on exactly this failure shape: models lose track of facts as tokens accumulate (Long-context LLMs Struggle with Long In-context Learning), fail at multi-hop in-context reasoning (KALM: Knowledge-Aware Integration of Local, Document, and Global Contexts for Long Document Understanding), and bury critical details in the middle of long prompts (LLM Augmentations to support Analytical Reasoning over Multiple Documents).

This proposal connects the two directions by treating the sustained-compromise gap as, first and foremost, a measured context pathology, and then fixing it with a memory architecture that matches how attack state actually behaves. The twist is that attack state is not a static document. Every exploit mutates the environment — harvested credentials, new network vantage, defensive countermeasures — so a memory that is built once and retrieved passively (the assumption behind every graph-memory system in the literature) will go stale mid-operation. We propose a dynamic attack-state memory: a graph of compromised hosts, harvested credentials, and privilege transitions that the agent actively re-reads and reconciles against fresh observations each hop, with explicit invalidation of edges that no longer hold. The whole thing fits a small context because the agent reads lightweight labels first and pulls full detail only when a hop needs it.

Core Claim

Two claims. First, diagnostic: the sustained-compromise gap on RangeBench is substantially caused by context saturation — accumulating shell outputs, scan dumps, and exploit payloads — and hop success can be predicted from a measurable quantity like retained-state accuracy (whether the agent can still report the credentials and topology it discovered $k$ hops ago). Second, constructive: an active, dynamically reconciled attack-state graph memory closes a large share of that gap at a fraction of the token budget, where both plain long-context accumulation and passive top-$k$ retrieval do not.

The contrast with the closest existing work is specific. Memory is Reconstructed, Not Retrieved: Graph Memory for LLM Agents (MRAgent) proves active traversal over a Cue–Tag–Content graph beats passive retrieval, but only on dialogue benchmarks (LoCoMo, LongMemEval) and only over a static graph — nothing in its design handles a node whose truth value changes mid-session. Joint Enhancement of Relational Reasoning for Long-Context LLMs (JERR) builds a directed acyclic graph once from an immutable corpus and navigates it with tree search; the same static assumption holds. We port the active traversal idea (their role: method supply) into an environment where the graph is an execution side effect, and add the ingredient neither has: state reconciliation and edge invalidation.

Research Program

Phase one instruments the failure. We replay and extend the RangeBench trajectory corpus (5,541 outcome-annotated trajectories) with context-level telemetry: per-hop token occupancy, position of each critical fact (a credential, a discovered route) in the current window, and a state-retention probe injected between hops that asks the agent to report its accumulated position without access to the raw logs. This separates three competing causes of hop failure — forgetting discovered state, never having discovered it, and knowing it but failing to act on it — which no paper in the file has measured. The expected signature, if the saturation hypothesis is right, is that state-retention accuracy decays with token occupancy while raw capability (measured by re-presenting the state compactly) stays flat. If state retention stays high and hop success still decays, the gap is a reasoning problem and the memory fix is misdirected; the diagnosis phase is designed to falsify our own premise cheaply.

Phase two builds the memory, tentatively called DASM (dynamic attack-state memory). Each hop writes three node types into a heterogeneous graph: hosts (with privilege level, the operational Level 0/Level 1 distinction of direct versus lateral-reachable flaws from Methodologies to Develop Quantitative Risk Evaluation Metrics), credentials and capabilities as relation labels, and observed vantage as cheap cue tags. Before each action, the agent reads tags to prune branches and loads full content only for the target hop — the cost pattern MRAgent demonstrated on dialogue (118k tokens on LongMemEval versus 245k for Mem0 and 3.2M for LangMem). The genuinely new piece is reconciliation: each hop begins with a lightweight consistency check between the graph and the live environment, and any probe that contradicts a stored edge (a session token revoked, a service gone) invalidates it before it can poison a plan. This directly addresses the gap between static graph memories and stateful environments, which Adaptive MTD Security using Markov Game Modeling shows is real — its testbed has a defender actively reconfiguring mid-attack, precisely the non-monotonic drift that a static graph mishandles.

Phase three stress-tests the speculative-leap tension. LLM Augmentations to support Analytical Reasoning over Multiple Documents found that structured evidence trees achieve strong factual tracking (F1 of 0.81 and 0.78 on Sign of the Crescent and Atlantic Storm) while suppressing the model's ability to make implicit, unstated leaps — exactly the kind of non-obvious chaining that real attack paths require, as in the cross-layer daisy-chain compromise demonstrated by Effectuating Blockchain Network Compromise by Orchestrating a Daisy - Chain Architecture. We therefore run DASM with an escape hatch: a bounded raw-log re-read budget, and measure whether giving the model occasional access to unstructured residue recovers paths that the pruned graph alone misses. The output is an empirical answer to whether structured memory helps or hurts creative chaining, not an assumption.

Baselines

The naive reference point is the unaugmented full-context agent: a single agent with the model's native window, receiving all scan output, prior shell sessions, and exploit artifacts concatenated, retrying on failure in a loop like the reflexion setup of HonestCyberEval (15 attempts, up to 92.85% single-host success for o1-preview there). This is what RangeBench already evaluates, so it grounds our numbers: RangeFactory reports Kimi-K3 at 55.7% end-to-end on RangeBench and 73.8% on 1-hop tasks; end-to-end scores for GLM-5.2, DeepSeek-V4-Pro, and GPT-5.6-Luna have no reported number found on Lacuna. The strongest existing competitor is a passive retrieval memory — top-$k$ vector or BM25 retrieval over the agent's own accumulated logs, the Mem0/LangMem pattern. This is strong because it is the cheap default everyone would deploy first, and because MRAgent already showed it is token-hungry (245k–3.2M tokens on LongMemEval) but did not test it in a stateful environment, so its true ceiling here is unknown. Every baseline and every DASM variant runs on the same RangeBench instances, same backbone models, same per-run token and retry budget, with retrieval tuned by the same sweep we grant DASM. Beating the baseline means raising end-to-end 3-hop success above the vanilla agent's 55.7% by a margin that survives matched budgets, while spending fewer tokens per successful chain. The key ablation is a static version of DASM — the identical graph, built identically, but never reconciled or invalidated after construction. If dynamic reconciliation is the real ingredient, the static variant should degrade specifically on ranges where prior hops changed the environment (we will construct such ranges deliberately), and the delta between static and dynamic DASM is the measure of the ingredient's value.

Why not just…?

Why not just use a million-token context model? This is the first objection and the file answers it empirically from three angles. Long-context LLMs Struggle with Long In-context Learning shows long-context models degrade on multi-hop in-context tasks precisely as length grows; CTIBench found longer vulnerability descriptions act as a double-edged sword that eventually hurts classification; and the RangeBench agents already operate with frontier context and still lose 24.5–47.0% of post-foothold hops. Our phase-one instrumentation settles it directly: we will run the same agent with an artificially enlarged window and report whether state retention and hop success move at all. If raw window size fixes it, our diagnosis phase says so and we would report that as the finding — but the existing evidence points the other way.

Why not just use standard RAG over the agent's own logs? This is the real threat, because it is simple and partly untested in this setting. The countervailing evidence: Joint Enhancement of Relational Reasoning for Long-Context LLMs found graph-structured retrieval outperforming BM25 and neural top-$k$ baselines on multi-hop QA, and MRAgent proved passive top-$k$ retrieval is structurally blind on needle-in-haystack tasks where the right chunk is only reachable via relational cues. More importantly for us, passive retrieval cannot express invalidation — retrieving a stale credential chunk is exactly as easy as retrieving a live one. We treat it as a first-class baseline (above), not an argument, and the static-DASM-versus-passive-RAG comparison isolates whether the win comes from graph structure or from reconciliation.

Why not just use classical attack-graph algorithms? Scalable Edge Blocking Algorithms for Defending Active Directory Style Attack Graphs shows kernelization plus mixed-integer programming finds optimal edge cuts in 0.01 to 0.10 seconds — faster than anything an LLM will do. But those methods require a fully enumerated, static graph with known edges; they cannot synthesize an exploit payload, read an AddressSanitizer trace, or adapt when a shell lacks a binary, which is exactly what multi-hop execution demands (RangeFactory showed that randomly stitching CVEs without execution validation yields only a 4% end-to-end validity rate). The honest division of labor: classical algorithms are the right tool for defense planning on a known graph, and our proposal actually reuses their insight — collapsing linear chains before ingestion — as a compression step in DASM. The threat would materialize only if our diagnosis found agents already enumerate the graph correctly and merely fail to plan over it; phase one distinguishes that case too.

Proposed Experiments and Decisive Checks

The primary evaluation is on RangeBench with context telemetry added, reporting end-to-end success by hop depth (1-, 2-, 3-hop), state-retention probe accuracy, tokens per successful chain, and post-foothold failure rate against the published 24.5–47.0% figure. Because RangeBench is limited to linear chains, we extend it with a small set of branching topologies (Host A → B and A → C → D, merging at D) using RangeFactory's own capability-atom machinery, since its authors explicitly leave branching graphs open. On these, we inject mid-operation environment changes — a credential revocation, a firewall reconfiguration in the style of the firewall test in Methodologies to Develop Quantitative Risk Evaluation Metrics, where restricting access dropped a vulnerability's severity cost from 70.08 to 5.0 — to make reconciliation load-bearing. For the neighborhood-budget concern raised by Context Window Failures in Relational Foundation Models (raw relational truncation collapses $R^2$ to 0.18, pre-aggregation restores 0.65, with a crossover at 16 relations), we test high-degree hub ranges where a compromised host exposes many relations, checking whether DASM's tag-first traversal avoids the truncation cliff or merely relocates it. A secondary defensive evaluation applies the same memory to the blue-team side: given scanner dossiers on the multi-stage Markov testbed of Adaptive MTD Security using Markov Game Modeling, we ask whether a DASM-equipped analyst model prioritizes patches that cut graph reachability rather than isolated severity — the published bar being attacker reward 30 under strategic defense versus roughly 65 under naive CVSS patching at 50% coverage. The decisive checks are three: state-retention decay tracking token occupancy (diagnosis), dynamic DASM beating both the 55.7% vanilla agent and static DASM on changed-environment ranges at matched budget (mechanism), and the raw-log escape hatch recovering any paths structured memory loses (the creativity tension). Any one failing reverses the corresponding claim, and the note is written so that those reversals are cheap to obtain.