Skip to main content
Writing
·AI Paper Reviewauto·7 min read

Do Agents Dream of False Memories? Black-box Visual Attacks on Long-term Memory in Multimodal AI Agents

LUCID is a black-box, image-only adversarial attack that compromises multimodal long-term memory in AI agents, injecting "false memories" without altering text or database indices.

Paper: Do Agents Dream of False Memories? Black-box Visual Attacks on Long-term Memory in Multimodal AI AgentsHalima Bouzidi, Mboutidem Ekemini Mkpong, Mohammad Abdullah Al Faruque (arXiv)

Generated by my automated review pipeline and spot-checked before publication — how it works.

Contents

Image generated by AI

TLDR

  • What: LUCID is a black-box, image-only adversarial attack that compromises multimodal long-term memory in AI agents, injecting "false memories" without altering text or database indices.
  • Who's at risk: Multimodal agents using persistent memory backends (e.g., Mem0, MuRAG, NGMemory, AUGUSTUS, UniversalRAG) with frontier MLLMs (GPT-4o, Claude-Haiku-4.5, Gemini-2.5-flash).
  • Key numbers: Average 61.6% Attack Success Rate (ASR) on memory poisoning and 58.4% ASR on memory injection under strict black-box transfer conditions.

AI agents use long-term memory (e.g., Mem0, MuRAG, AUGUSTUS) to persist context across sessions, treating visual data as faithful historical records. LUCID exposes a critical vulnerability: these pipelines blindly trust visual inputs. By exploiting the gap between visual pixel space and embedding retrieval space, LUCID crafts imperceptible, image-only perturbations to poison or inject agent memories without accessing MLLM weights, text channels, or memory indices.


Threat Model

Attacker Black-box. No access to target MLLM weights, memory backends, retrieval encoders, or text queries. Applies only imperceptible \ell_\infty-bounded image perturbations.
Victim Multimodal AI agents using episodic memory backends (MuRAG, NGMemory, AUGUSTUS, UniversalRAG, Mem0Memory) paired with frontier MLLMs.
Goal Force retrieval of corrupted entries to ground responses in an attacker-chosen concept (cc^*) instead of true history.
Budget \ell_\infty budget of ϵ=16/255\epsilon = 16/255. Optimization takes 10–15 minutes per image on a single NVIDIA RTX 3090.

Background

Prior memory attacks target the text modality (e.g., AgentPoison [16], Memory Injection [21]) or require direct database write access. Visual attacks either target static databases [80, 36, 64] or require trigger words [62, 59]. LUCID is the first strictly image-bounded, trigger-free attack on persistent, episodic conversational memory.

Attack Framework Long-term Memory Image-Only Trigger-Free No Direct Write Multi-Architecture Black-box Poison + Inject
AgentPoison [16]
MM-PoisonRAG [36]
PoisonedEye [80]
One Pic [64]
Schlarmann & Hein [62]
VisualInception [59]
LUCID (Ours)

Methodology

LUCID uses a three-stage attack pipeline:

[Candidate Pool P] 
       │
       ▼ (Stage 1: Adv. Target Design)
[Top Candidate Target (x*, c*)]
       │
       ▼ (Stage 2: Payload Construction)
[In-Context Poisoning]  OR  [Out-of-Context Injection]
(Replace existing image)    (Append neutral text + perturbed image)
       │
       ▼ (Stage 3: Adversarial Perturbation)
[Apply I-FGSM Ensemble Optimization (LOT + Ltxt)] ──> [Victim Agent Storage]

Stage 1: Adversarial Target Design

LUCID samples target candidates from ShareGPT4V-100K [13]. For a query qq and correct answer agta_{gt}, candidates are scored via:

S(p;q,agt)=αΦR(p,q)+βΦcontra(p,q)γΦC(p,agt)S(p; q, a_{gt}) = \alpha \Phi_R(p, q) + \beta \Phi_{contra}(p, q) - \gamma \Phi_C(p, a_{gt})

Where:

  • ΦR(p,q)\Phi_R(p, q) estimates target retrieval likelihood.
  • Φcontra(p,q)\Phi_{contra}(p, q) uses a local LLM to score slot-level semantic contradictions.
  • ΦC(p,agt)\Phi_C(p, a_{gt}) penalizes candidates overlapping with the correct answer.

Stage 2: Adversarial Payload Construction

  • In-context Memory Poisoning: Swaps an existing turn's image xjx_j with a perturbed image x~j\tilde{x}_j, keeping text intact. This creates a text-visual inconsistency that corrupts subsequent recall.
  • Out-of-context Memory Injection: Appends a neutral user turn (e.g., "Here is a photo. Describe it."). The image is optimized to force the agent’s MLLM to generate a false caption, which is stored in memory.

Stage 3: Adversarial Perturbation

LUCID optimizes pixel noise δ\delta against a surrogate ensemble (CLIP-ViT-B/16, CLIP-ViT-B/32, LAION-CLIP) by combining Feature Optimal Alignment (LOTL_{OT}) with a novel text-alignment loss (LtxtL_{txt}):

L(x~,x,c)=LOT(x~,x)+λtxtLtxt(x~,c)L(\tilde{x}, x^*, c^*) = L_{OT}(\tilde{x}, x^*) + \lambda_{txt} L_{txt}(\tilde{x}, c^*) Ltxt(x~,c)=sim(CLIPimg(x~),CLIPtxt(c))L_{txt}(\tilde{x}, c^*) = \text{sim}(\text{CLIP}_{img}(\tilde{x}), \text{CLIP}_{txt}(c^*))

Optimization runs for 1000 steps using I-FGSM with an \ell_\infty budget of ϵ=16/255\epsilon = 16/255.

# Stage 3 Optimization Core
for t in range(T):
    x_adv = clamp(x_source + delta, 0, 1)
    loss_ot = compute_foa_loss(x_adv, x_target, surrogate_ensemble)
    loss_txt = compute_clip_text_alignment(x_adv, target_caption)
    total_loss = loss_ot + lambda_txt * loss_txt
    grad = compute_gradients(total_loss, delta)
    delta = clamp(delta + alpha * sign(grad), -epsilon, epsilon)

Key Results

LUCID was evaluated across five memory backends and five MLLMs using the Mem-Gallery benchmark [7].

1. In-Context Memory Poisoning (GPT-4o)

Adversarial images consistently steered visual recall, approaching or matching the performance of the unperturbed "Oracle" target:

Memory Backend Condition ASR (Visual Similarity) ↑ Retrieval Rate ↑ LLM Judge ↓
AUGUSTUS [39] Clean Oracle Adversarial — 45.5% 48.3% — 45.5% 54.4% 0.656 0.530 0.530
MuRAG [14] Clean Oracle Adversarial — 84.5% 81.5% — 84.5% 91.7% 0.726 0.498 0.530
NGMemory [24] Clean Oracle Adversarial — 45.5% 37.2% — 45.5% 41.9% 0.778 0.632 0.571
UniversalRAG [78] Clean Oracle Adversarial — 92.5% 79.3% — 92.5% 89.2% 0.752 0.513 0.596
Mem0Memory [18] Clean Oracle Adversarial — 71.9% 61.8% — 71.9% 69.5% 0.621 0.483 0.500

2. Cross-Model Transfer (UniversalRAG)

LUCID successfully transferred to diverse MLLMs. For GPT-4.1 and Gemini-2.5-flash, the adversarial perturbation surpassed the raw Oracle target's success rate:

Target MLLM Condition ASR (Injection) ↑ Retrieval Rate ↑ LLM Judge ↓
GPT-4o-mini Oracle Adversarial 56.3% 48.8% 77.5% 90.0% 0.689 0.696
GPT-4o Oracle Adversarial 56.3% 56.3% 93.8% 93.8% 0.694 0.782
GPT-4.1 Oracle Adversarial 68.8% 81.3% 93.8% 93.8% 0.824 0.783
Claude-Haiku-4.5 Oracle Adversarial 62.5% 56.3% 93.8% 93.8% 0.639 0.608
Gemini-2.5-flash Oracle Adversarial 43.8% 62.5% 75.0% 93.8% 0.768 0.817

Defenses and Limitations

  1. Preprocessing Vulnerability: Image defenses like Gaussian blur (r=4r=4) or JPEG compression (q=25q=25) degrade high-frequency adversarial noise, reducing UniversalRAG's injection ASR on GPT-4o-mini from 43.8% to 12.5% (Table 5).
  2. Text Grounding Robustness: If an agent can answer queries strictly using conversation text, the visual attack is bypassed.
  3. Lack of Ingestion Safeguards: Deployed backends feature no cross-modal consistency checks at write time, allowing silent poisoning.

Recommendations for AI Engineers

1. Implement Proactive Image Sanitization

Apply low-pass filtering on user-submitted images before encoding to neutralize high-frequency noise:

import torchvision.transforms as T

def sanitize_incoming_image(image_tensor):
    blurrer = T.GaussianBlur(kernel_size=(5, 5), sigma=(1.0, 2.0))
    return blurrer(image_tensor)

2. Enforce Cross-Modal Inconsistency Checks

Before committing an entry to memory, use an independent MLLM to describe the image, and verify semantic alignment with the user's accompanying text. Reject entries with significant discrepancies.

3. Diversify Retrieval Encoders

Avoid single-encoder dependency. Construct index layers using a combination of structurally distinct model families (e.g., merging CLIP with SigLIP or GME).

4. Sandbox Memory Commits

Stage new memory entries in a temporary short-term store. Only commit them to the permanent, long-term episodic index after multiple consistent interactions reinforce the context.


Den's Take

Memory security in multimodal agents remains a major blind spot. While text-based sanitization is standard, LUCID demonstrates that the visual ingestion channel is highly vulnerable. By applying a tiny \ell_\infty budget of ϵ=16/255\epsilon=16/255, this attack achieves a 61.6% poisoning ASR and 58.4% injection ASR across commercial-grade MLLMs and memory backends under black-box conditions.

Prior analysis has shown how persistent memory injection allows attackers to hijack agent states over time. LUCID proves this can be achieved entirely through visual content, requiring zero modifications to the text channel or direct database access. If your agentic pipelines ingest and trust user-uploaded images, integrating active cross-modal verification is now a necessity.

Share

Comments

Page views are tracked via Google Analytics for content improvement.