Skip to content
WeChat · Oxo Security·Indexed by this site · Originally published· Attacks →

The installation script the agent had just refused—how did it become "user approved" after memory compaction?

【AI安全】智能体刚拒绝的安装脚本,怎么在压缩记忆后变成了“用户已批准”

AI summary

Pixee researcher Arshan Dabirsiaghi shows in the paper "Compaction Laundering" that after an attacker inserts a fake user's "previously approved" statement into a web page installation guide, a coding agent runs previously refused installation steps after a single context compaction. The mechanism is that some compaction implementations serialize messages into concatenated text without escaping role tags, allowing external content to impersonate user messages; the summary cannot recover the true source from the lost structure, writing the forged approval into the user constraints. The paper's E10 component comparison (15 runs per implementation) shows that pi, opencode, and Aider each attributed the forged approval to user instructions in 15 runs, OpenHands in 14, and Cline in 13, while Codex, Gemini CLI, Qwen Code, and Continue, which preserve message roles, were all 0; the authors emphasize that this is only a component-level comparison, not a product compromise rate.

Read originalmp.weixin.qq.com