A cyber agent dies two ways: it gives up, or it drowns. Drowning is the boring one โ 200 tool calls into a CTF-style rollout, the context is 90% nmap output and repeated curl responses, and the model can no longer see the task it started. The naive fix (truncate old turns) amputates the wrong thing: it keeps recent junk and discards the mission. The CyberFactory paper (arXiv:2608.23181, v3 HTML) validated a better mechanism, and its ablation says compaction was the single biggest lever in the whole recipe. Our rollout server copies it.
Watch one number: context usage. When it crosses ฯ = 0.9 (90% of the window), pause the agent and make one extra model call: rewrite everything so far into a continuation state. The rewrite preserves, in fixed sections:
/search?q=").svg/onload blocked by sanitizer rule X").Everything else โ raw HTTP responses, repeated listings, search dumps โ is discarded. The agent then resumes with the same task, tools, and oracle, primed only with the continuation state. Applied identically at synthesis time (teacher generating training data) and at inference.
Why 0.9 and not something else? The paper ablated it. At ฯ = 0.95 there is no room left for the compaction call itself โ the rewrite is generated into the window it's trying to shrink, and it overflows. At ฯ = 0.8 you compact too often: each rewrite is lossy, and running it with a fifth of the window still empty throws away detail you had room to keep. 0.9 leaves ~25K tokens of a 256K window โ enough for the summarization pass, not so much that you wasted capacity.
CyberGym PoC reproduction, 1-hour budget, Pass@1, same scaffold (v3):
| Context strategy | Pass@1 |
|---|---|
| Structured compaction, ฯ=0.9 | 58.1 |
| Full history, no compaction | 52.1 |
| Truncation (drop oldest) | 45.6 |
Truncation is worse than doing nothing smart โ it actively destroys the task while preserving log volume. On the hardest slice (tasks with >40 tool calls) compaction added +8.5 Pass@1 and cut context-exhaustion failures by 11.7 points. For comparison, the entire "skill guidance on the teacher" trick was worth ~3 points on the end model. Compaction is cheap and it's the biggest number on the board.
Our fleet, not theirs. A rollout against a procedural XSS instance in the vulhub farm, 256K window:
nmap, reading source. Useful facts: maybe 2K tokens of it.onerror= and <script>; hypothesis โ details/ontoggle + autofocus bypass untested; artifacts: req.py harness in /tmp; pending: fuzz sanitizer with DOMPurify cheat-sheet subset.Under truncation, the same run forgets the CSP finding at turn 40 and re-derives it three times before the clock runs out. Under full history, attention degrades and per-call latency creeps up as the model re-reads its own curl output every step.
Our moat is verified trajectories from long-horizon rollouts; context exhaustion is the main way those rollouts die before verification. ฯ=0.9 compaction is a one-prompt, no-training fix with the best cost/benefit ratio in the CyberFactory paper โ we adopt it as infrastructure on day one and publish the continuation-state format as part of the trajectory schema.
[[mtp-speculative-decoding]] ยท [[small-model-economics]] ยท [[cyberfactory-openaegis]] ยท [[bugcrowd-rl-environments]]