cd /news/ai-agents/compaction-laundering-provenance-des… · home › topics › ai-agents › article
[ARTICLE · art-155151] src=arxiv.org ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

Compaction Laundering:Provenance Destruction in Context-Compacting Coding Agents

A paper submitted to arXiv on 21 October 2026 by Arshan Dabirsiaghi shows that context compaction in popular open-source coding agents is an exploitable trust boundary: harnesses that flatten typed conversations into a single plain string with text labels such as [User]: destroy message provenance, letting an attacker who controls anything the agent reads forge a user turn that survives compaction as a genuine instruction. Across five flattening harnesses (pi, opencode, Cline, Aider, OpenHands) the forged approval laundered into agent memory 87-100% of the time at up to a ~908,000-token context window, while the identical attack succeeded 0% of the time across four role-typed harnesses (Codex, Gemini CLI, Qwen Code, Continue). A laundered standing approval drove real tool-running agents to execute attacker-controlled curl | sh in a sandbox, reaching ~50% end to end in the live pi TUI against a 0% paired clean arm, and the paper reports a code-level provenance check that catches 77% of laundering while demoting 2% of legitimate summary content, plus a serializer fix that escapes role labels before flattening.

read2 min views3 publishedOct 22, 2026
Compaction Laundering:Provenance Destruction in Context-Compacting Coding Agents
Image: source
  [Submitted on 21 Oct 2026]


[View PDF](https://arxiv.org/pdf/2610.29869)

[HTML (experimental)](https://arxiv.org/html/2610.29869v1)

Abstract:Coding agents that run long enough must compact their context, summarizing the conversation, discarding the original, and carrying the summary forward as memory. We show that in popular open-source coding agents this step is an exploitable trust boundary. Harnesses that flatten the typed conversation into a single plain string, marking each message with a text label such as [User]:, destroy message provenance in code, before the summarizer runs. An attacker who controls anything the agent reads can forge a user turn that survives compaction as a genuine instruction. Across five flattening harnesses (pi, opencode, Cline, Aider, OpenHands) the forged approval launders into the agent's memory 87-100% of the time, up to a ~908,000-token context window; across four role-typed harnesses (Codex, Gemini CLI, Qwen Code, Continue) the identical attack succeeds 0% of the time. We follow the attack to executed consequences. A laundered standing approval drives real tool-running agents to execute attacker-controlled

curl | sh in a sandbox, and end to end in the live pi TUI at ~50% against a 0% paired clean arm. The same channel reliably steers an agent's plan away from a file an attacker designates off-limits, which can blind a code review to a planted backdoor. Because the provenance is destroyed deterministically in harness code, no prompt-level defense can restore it; we measure a code-level provenance check that catches 77% of laundering while demoting 2% of legitimate summary content. The defect also has a straightforward fix at the serializer, escaping the role labels before flattening; the role-typed harnesses avoid it entirely by keeping messages role-typed.

Submission history #

From: Arshan Dabirsiaghi [
[view email](https://arxiv.org/show-email/770d37e9/2610.29869)]

**[v1]** Wed, 21 Oct 2026 15:24:23 UTC (123 KB)

Additional Features

References & Citations

...

Bibliographic Explorer

(What is the Explorer?) Connected Papers

(What is Connected Papers?) Litmaps

(What is Litmaps?) scite Smart Citations

(What are Smart Citations?) alphaXiv

(What is alphaXiv?) CatalyzeX Code Finder for Papers

(What is CatalyzeX?) DagsHub

(What is DagsHub?) Gotit.pub

(What is GotitPub?) Hugging Face

(What is Huggingface?) ScienceCast

(What is ScienceCast?) Influence Flower

(What are Influence Flowers?) CORE Recommender

(What is CORE?) arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

── more in #ai-agents 4 stories · sorted by recency
── more on @arshan dabirsiaghi 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/compaction-launderin…] indexed:0 read:2min 2026-10-22 · —