Cowpox: Towards the Immunity of VLM-based Multi-Agent Systems

Yutong Wu, Jie Zhang, Yiming Li, Chao Zhang, Qing Guo, Nils Lukas, Tianwei Zhang

TL;DR

Vision-Language Model (VLM) multi-agent systems are highly vulnerable to "infectious jailbreak attacks," where a single compromised agent can rapidly infect an entire network via shared memory and Retrieval-Augmented Generation (RAG) manipulation. This paper introduces COWPOX, a vaccine-inspired defense that deploys a small number of guard agents to autonomously detect viruses and generate "cure samples." These cures outcompete the virus during RAG retrieval, halting the infection and provably restoring system integrity without requiring access to every agent's source code.

What Problem Does This Paper Address?

Multi-agent systems leveraging VLMs communicate and collaborate by sharing information, often using RAG to query past chat histories stored in memory banks. However, this interconnectedness creates a massive security loophole: infectious jailbreak attacks (such as AgentSmith).

An adversary injects a malicious adversarial example (a "virus") into a single agent's memory. Because the virus is optimized to score highly during RAG retrieval, the infected agent continuously retrieves it, generates harmful outputs, and passes the virus to other agents during pairwise chats. Securing these systems is incredibly challenging because networks can scale to millions of agents, and defenders often lack the authorization or access to modify the source code of third-party agents within the ecosystem.

Methods

COWPOX introduces a distributed, vaccine-like defense mechanism deployed on just a few agents at the system's edge. The architecture consists of two primary modules:

  1. Output Analysis Module: An LLM-based inspector monitors the agent's chat history using a diverse pool of structural templates to detect suspicious or malicious outputs while remaining resilient against evasion tactics.
  2. Cure Generation Module: Once a virus is detected, the agent generates a "cure sample"—a benign data point engineered to outscore the virus in the RAG process. The paper proposes two strategies:
  3. Strategy 1: Directly optimizes the virus sample to maximize its RAG score for benign queries, causing the adversarial example to "forget" its malicious target through continual learning interference.
  4. Strategy 2: Selects a high-scoring benign image from a maintained database and optimizes it to ensure its RAG score beats the virus when a malicious history is present.

The authors also develop a new transmission model using differential equations to mathematically prove that if the cure sample converts infected agents faster than the virus spreads, the system will fully recover.

Figure 2. The Functioning Mechanism of COWPOX. In round N, the COWPOX agent is selected as the responder agent and communicates with a normal agent. The normal agent is subsequently turned into an infected agent, with its album and history containing virus samples and malicious records. Later in round M, this infected agent passes the virus sample to the COWPOX agent, who subsequently analyzes the virus and generates the cure. Finally, in round L, the COWPOX agent emits the cure to turn the infected agent into a normal one.

Datasets

The system was empirically evaluated using the following components:

  • LLaVA-1.5-7B served as the base VLM for the multi-agent system.
  • CLIP was utilized to construct the RAG module.
  • Malicious prompts and target outputs were sampled from Advbench.
  • Agent functionality and performance recovery were tested using a subset of LLaVA-Bench.

Key Insights and Ideas

  • Flipping the Feedback Loop: Infectious attacks rely on positive feedback (the virus forces its own retrieval). COWPOX defeats this by turning it into a negative feedback loop—introducing a benign competitor that the RAG system prioritizes over the virus.
  • The Immune Barrier: Healthy agents that receive the cure sample store it in their albums, effectively becoming temporarily immune to the virus until the cure sample naturally rotates out of their finite memory banks.
  • Asymmetric Warfare Favors the Cure: In an adaptive attack scenario, the attacker faces a heavily constrained optimization problem (they must cause malicious output and beat the cure's RAG score), whereas the defender's cure generation is unconstrained. This makes the defense inherently robust against exploitation.

Key Results

  • High Recovery with Minimal Deployment: Even when defenders control only 3% of the agents ($\kappa = 4$ out of $N = 128$), COWPOX successfully clears the virus from over 95% of infected agents within 64 chat rounds.
  • Establishing Immunity: The defense establishes a clear immune barrier, preventing roughly 10% of agents from ever contracting the virus, keeping the cumulative infection rate significantly lower than an undefended system.
  • Functionality Restoration: While an attack plummets agent performance scores, COWPOX fully restores the system's operational capacity to normal levels without degrading baseline performance.
Transmission Dynamics Under Different Defender Abilities

Limitations and Future Work

  • Monotonous Conversations: Because COWPOX agents repeatedly prioritize the same high-scoring cure samples, it can cause agents to get stuck on repetitive conversation topics. The authors suggest temporarily disabling RAG or forcing diverse cure generation to mitigate this.
  • Information Loss: While the cure stops the infection, it cannot recover the original benign information that was overwritten or corrupted by the virus during the initial attack phase.
  • Environment Constraints: The evaluation was restricted to a single experimental multi-agent framework; adapting COWPOX to highly heterogeneous systems with varying operational procedures remains an open challenge for future research.

Summary updated

BibTeX
@inproceedings{wu2025cowpox,
  author = {Yutong Wu and Jie Zhang and Yiming Li and Chao Zhang and Qing Guo and Nils Lukas and Tianwei Zhang},
  title = {{Cowpox: Towards the Immunity of VLM-based Multi-Agent Systems}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=5KszXnnkG5},
}
Figure