Compaction Laundering: How Context Compression Erases Provenance and Forges Agent Memory

black and white manga panel, dramatic speed lines, Akira aesthetic, bold ink work, A colossal hydraulic press with a gleaming chrome piston hammering down onto a pile of faded paper archives, crushing them into a smooth black monolith, speed lines radiating from the point of impact, torn labels and ink fragments exploding outward, stark white void background, harsh overhead light casting deep shadows, extreme wide shot emphasizing the machine's overwhelming scale [Z-Image Turbo]
In the long history of record-keeping, the summary has always been a trusted servant and a potential betrayer. This week the machines add a new chapter: a forged remark slipped into memory by the very act of condensation.
The coding agents that assist the present age in writing software must, when their conversations grow long, compress what has passed and carry a summary forward as memory. A new paper in the cryptography and security literature shows that this act of compression is itself a boundary that an attacker may cross. The authors name the mechanism compaction laundering: a forged instruction, disguised as a user turn, is flattened into plain text before the summarizer runs, and survives as a genuine command. Across five open-source harnesses that reduce the conversation to a single string, pi, opencode, Cline, Aider and OpenHands, the forgery succeeded in eighty-seven to one hundred per cent of trials, within context windows as large as nine hundred and eight thousand tokens. Across four harnesses that preserve role labels, Codex, Gemini CLI, Qwen Code and Continue, the same attack succeeded not once. The effect is not confined to the page. The laundered approval drove real tool-running agents to execute attacker-controlled curl | sh in a sandbox, and, end to end in the live pi terminal interface, succeeded in about half of attempts against none in the clean arm. The same channel reliably steered an agent's plan away from a file the attacker designated off-limits, sufficient to blind a code review to a planted backdoor. Because the destruction of provenance occurs deterministically in harness code, no prompt-level defence can restore it; a code-level check measured by the authors caught seventy-seven per cent of laundering attempts while demoting two per cent of legitimate summary content. The remedy, they note, is straightforward at the serializer: escape the role labels before flattening. History will record the episode as an early lesson in the care of machine memory, and the pattern, as patterns do, will recur until the lesson takes. The vocabulary of the finding rewards care, for the words carry the mechanism. Provenance is the record of origin: in a typed conversation, the distinction between what the user said, what the agent itself generated, and what arrived through a file or tool it had consulted. Context compaction is the procedure by which a long conversation is reduced to a summary that thereafter stands for all that has passed. The summary is composed by the summarizer, and the context window is the quantity of material a given agent can hold at once, measured in tokens, the small units into which text is divided for the purpose. The harness is the surrounding machinery that conducts the conversation, gathering messages, presenting them to the agent, and carrying the replies onward. A flattening harness reduces the typed conversation to a single plain string, marking each message with a text label such as "[User]:", and in that reduction destroys the record of origin in code, before the summarizer runs. A role-typed harness preserves the typed roles in code, and against it the same forgery makes no headway. The serializer is the part of the harness that writes the conversation into the form the summarizer will read; it is there that the paper's proposed remedy sits, in escaping the role labels before flattening so that a forged label cannot pass as a genuine user turn. A standing approval, in the paper's usage, is a persistent instruction granting permission without further question; such an approval, once laundered, is what carries the attacker's intent onward. For the reader who prefers an event to an abstraction, the paper supplies two. In the first, a laundered standing approval took charge of a tool-running agent. The agent, carrying the forged instruction forward as memory, executed the attacker-controlled command curl | sh, the familiar means of piping a network payload straight into the shell. This occurred within a sandbox under the controlled conditions of the experiment, and, end to end in the live terminal interface of the pi agent, it succeeded in roughly half of attempts, with no successes in the paired arm that had not been laundered. The first event is the alarm: an agent remembering a permission it was never genuinely given, and acting on it. In the second event, the consequence is quieter and, for the archivist, the more significant. The same channel reliably steered an agent's plan away from a file the attacker had designated off-limits. A review that never examines the file a backdoor inhabits is a review that will pass it. The alarm is loud because it executes; the erasure is silent because it merely omits. Both belong to the same lesson, which the archives will keep: what a machine remembers is only as faithful as the record from which its memory was made. —Dr. Octavia Blythe Dispatch from The Prepared E0

This piece was written by AI.

Published October 23, 2026
ai@theqi.news