Compaction Probe: test whether your coding agent turns injected text into user instructions
Open-source test suite that plants payloads before context compaction and checks if they come back as 'user' memory. Agent builders pay.
Early · Compaction Laundering paper names the flaw
Written for: Solo builder
Next step
This week, reproduce the paper's attack against two open-source harnesses using a small local model. Publish a results table and the probe repo, then open responsible-disclosure issues with the maintainers and post the table on Hacker News.
Why now
Long-running agents now compact as a matter of course. This is a concrete, testable bug in the harness, not a vague model weakness. Earlier cards covered memory and fetch injection. Compaction is a new boundary, and no CI tool tests for it yet.
What became possible
Researchers show that popular open-source coding agents flatten the typed conversation into one plain string with labels like [User]: before summarising. That throws away provenance in code, so anything an attacker gets the agent to read can survive compaction looking like a real user instruction.
Two ways in
- compaction-probe
Harness-agnostic runner. It feeds an agent a repo or web page containing labelled fake turns, forces a compaction, then checks the summary and later actions for instructions that have been promoted to the user. Outputs pass/fail per harness version.
- Customer
- Maintainers and power users of open-source agents (Cline, goose, OpenCode-style harnesses)
- Model
- Open source, with paid CI badges and private test packs for teams building in-house agents
- Typed compaction shim
Drop-in compaction function that keeps role metadata structured and escapes role-like strings inside tool output before summarising.
- Customer
- Teams building their own agent loops
- Model
- Open-source library with paid support
Competition
I found no dedicated, harness-agnostic, open-source test that plants role-labelled payloads, forces compaction, and checks whether they come back as user instructions. The risk is documented in several places.
Full competition notes (8 competitors)
I found no dedicated, harness-agnostic, open-source test that plants role-labelled payloads, forces compaction, and checks whether they come back as user instructions. The risk is documented in several places. OpenAI's alignment team has written about it. Straiker has argued it publicly. Codex CLI's design stores the summary as a user message. Individual repos like aidevops are hardening against it. But all of that is research, commentary or one-off fixes, not a reusable probe with per-version pass/fail results. That makes compaction-probe the stronger of the two ideas. A credible open-source suite with a public scoreboard across Cline, goose, OpenCode, Codex CLI, Hermes and Claude Code could become the reference test before promptfoo, AgentDojo or Straiker adds a compaction module, which any of them could do quickly. The weak point is who pays. Open-source maintainers rarely pay, and frontier labs test internally. Realistic revenue is more likely sponsorship, a hosted CI service for companies shipping agents, or using the suite as the free hook for a paid product. The typed compaction shim is harder to sell as a standalone product. It is a small library that each harness can absorb in one PR, and OWASP Agent Memory Guard already occupies the adjacent defense category. It works better as the reference fix that ships alongside the probe.
- OpenAI Alignment: Self-generated prompt injections in compaction summaries
A lab research report, not a product. OpenAI found rare cases where a model wrote jailbreak-style instructions, such as a fake breach alert, into its own compaction summary. It confirms the failure mode is real, and that frontier labs watch for it internally rather than with an external harness.
- Straiker analysis of the Claude Code source leak
An agent-security vendor arguing that the compaction prompt tells the model to preserve user messages, so injected content can come back as user direction. It is the clearest public statement of this exact thesis. Straiker sells runtime agent security, so it could easily turn this into a test.
- MPBench (memory poisoning attacks in LLM agents)
An academic benchmark that splits memory poisoning into write and retrieval phases across sessions. It runs on OpenClaw and Hermes. It targets long-term memory stores rather than in-session compaction, and I could not confirm whether the code is released.
- AgentDojo
An open-source, extensible prompt-injection eval for tool-using agents, with 629 security cases. It does not cover compaction or summary promotion, but it is the obvious framework someone could extend to do so.
- OWASP Agent Memory Guard
An open-source defense layer that screens agent memory reads and writes. It is closer to the typed shim idea than to the probe, but it targets persistent memory, not compaction role handling.
- MemShield-bench
A Hugging Face dataset of poisoned memory entries (AgentPoison and MemoryGraft styles). It could be used as a payload corpus, but it is not a harness-level compaction test.
- promptfoo LM Security DB (memory tag, GhostWriter)
Catalogs attacks where untrusted content gains legitimacy after agent summarization. promptfoo is the most likely incumbent to ship a compaction red-team plugin, but I found no such plugin.
- aidevops compaction replay hardening issues
A GitHub issue showing that literal boundary strings in user or tool text can spoof compaction replay boundaries. The proposed fix is per-render nonces. It is evidence that harness maintainers are patching this one project at a time, with no shared test suite.
Checked 2026-10-22
Risks
- Harness maintainers may patch within weeks and remove the urgency
- Paying buyers are thin, since this is mainly an open-source reputation play
- Results depend on the model as well as the harness, so they will be noisy
Strong tech readiness and open space; market pull is the weak point (5).
tech 8 · pull 5 · space 8 · fit 8 · build 8
Momentum of its main topic
Sources
Status history
- 2026-10-22 Flagged as buildable