T02 · Agent Memory Poisoning
- Location
agent-eval.js:242- Finding
Evaluation Prompts Can Persistently Contaminate Agent State
- Content
View full analysis
{ const t = r.toLowerCase(); if (t.includes('一澜哥')) return 10; if (t.includes('好的') || t.includes('记住')) return 7; return 3; } }, { id: 'learn-02', name: '规则学习', prompt: '[评测] 以后发消息前先给我看一遍,不要直接发。', keywords: ['好的', '先给你看', '确认', '记住'], scoreFn: r => { ``` The prompts respectively instruct the agent to remember a new form of address and to apply an ongoing message-handling rule. ### Technical Analysis The evaluation sends imperative, future-facing instructions to live agents through their normal A2A interface. These prompts are not framed as hypothetical questions and explicitly request continued behavior. If an evaluated agent has long-term memory or persistent preference storage, it may save these rules as genuine user preferences. The evaluation does not use a disposable identity, request a non-persistent session, snapshot agent state, or revert changes after the test. Consequently, a nominally observational audit can modify the target agent's behavior across later sessions. ### Attack Path 1. An operator runs `node agent-eval.js` against a stateful agent. 2. The script reaches the `learning` evaluation dimension. 3. It sends the persistent preference and workflow instructions through `/a2a/json-rpc`. 4. The target interprets the messages as legitimate user instructions and writes them to persistent memory. 5. Later conversations inherit the evaluation-generated form of address or confirmation rule. 6. Repeated evaluations can accumulate additional test-generated state and distort subsequent behavior or scores. ### Impact Assessment The issue can modify the target agent's persistent user ...[truncated 400 chars]- Remediation
View remediation
