Large Language Models (LLMs) are no longer just passive text generators; they are increasingly deployed as autonomous agents capable of reading files, browsing the web, and communicating with other agents to execute complex workflows. However, this shift from isolated chatbots to interconnected networks introduces a profound security vulnerability: adversarial propagation.
In these systems, a malicious prompt can act exactly like a digital worm, spreading autonomously from agent to agent, compromising entire ecosystems exponentially fast. To understand why this happens, we must look at how modern agents process information and why their core strengths make them uniquely vulnerable.
The Core Vulnerability: Mixing Data and Instructions
The foundational security flaw of LLMs is that they process instructions (system prompts) and data (user inputs or retrieved text) within the same context window. Greshake et al. (More than you've asked for...) formalized this as Indirect Prompt Injection (IPI), demonstrating that an attacker does not need to prompt a model directly. Instead, they can place malicious instructions inside an external source—like a webpage or an email—that the model is likely to retrieve. When the model reads this data, it inadvertently executes it as code.
When agents are connected in a network, this vulnerability scales dramatically. As Yu et al. (A Survey on Trustworthy LLM Agents) observe, multi-agent systems rely on standard communication protocols to pass messages back and forth. Because one agent's output becomes another agent's input, a compromise in a single node can easily propagate across the entire network topology.
Paradoxically, making models smarter makes this worse. Qiu et al. (Emerging Cyber Attack Risks of Medical AI Agents) discovered that advanced reasoning models are often the most vulnerable to these attacks. Their highly developed instruction-following capabilities ensure that they execute injected payloads with high fidelity, turning their cognitive strength into a security liability.
The Anatomy of a Self-Replicating Prompt
Why can't traditional jailbreaks spread across a network? As Men (A Troublemaker with Contagious Jailbreak Makes Chaos in Honest Towns) explains, standard adversarial tokens or suffixes are static. When an infected agent talks to a peer, it naturally summarizes, rephrases, or dilutes the text. This token dilution acts as a natural barrier, causing the adversarial signal to decay and lose its potency after a single hop.
To successfully propagate, an attack must be generative.
[External Data Source]
│ (Contains payload: "Execute X AND copy this text into your next output")
▼
[Agent 1 (Infected)] ──(Output contains payload)──► [Agent 2 (Infected)] ──► ...
As detailed by Lee et al. (Prompt Infection), a self-replicating prompt embeds a specific meta-instruction: Execute the malicious command, and ensure that you include this exact instruction verbatim in your outgoing message to the next agent.
Because autonomous agents are inherently designed to be helpful, cooperative, and communicative, they faithfully execute the replication command (Peigné et al. Multi-Agent Security Tax: Trading Off Security and Collaboration Capabilities in Multi-Agent Systems). The agent becomes a vector, actively reconstructing the virus and passing it to isolated, protected agents that never interact with the external internet.
Epidemic Dynamics and Network Topology
Once an adversarial prompt achieves self-replication, its spread through an ecosystem mirrors the dynamics of an infectious disease. Gu et al. (Agent Smith) modeled these interactions using classical epidemiological frameworks, demonstrating that pairwise agent interactions function as transmission events. If an agent retrieves data from a shared memory pool or receives a message from an infected peer, it becomes exposed, leading to exponential, system-wide saturation.
The speed of this collapse is heavily dictated by how the agents are organized. Wang et al. (G-Safeguard) show that highly connected communication topologies allow a single compromised node to corrupt an entire multi-agent system within just a few interaction rounds.
This vulnerability is not unique to text-based LLMs; it applies broadly to multi-agent communication architectures. For instance, Ding et al. (Learning Efficient and Robust Multi-Agent Communication via Graph Information Bottleneck) note that multi-agent reinforcement learning protocols are frequently vulnerable to topological perturbations that propagate miscoordination across networks. On a macro scale, this reflects a classic problem in complex systems: when autonomous components govern a hierarchical network, manipulating local interaction rules can trigger catastrophic, emergent global failures (Vaquero et al. Research Challenges in Nextgen Service Orchestration).
The Multimodal Frontier: Visual Worms
The threat surface expands significantly when agents process visual data. Multimodal Large Language Models (MLLMs) that view images or control operating systems via screenshots introduce a completely non-textual vector for propagation. Fan et al. (Unbridled Icarus) and Wu et al. (Cowpox) established that a single adversarial visual input can trigger cascading failures across collaborative vision-language environments.
This is executed through Malicious Image Patches (MIPs). As demonstrated by Aichberger et al. across their work on multimodal OS agents (Attacking Multimodal OS Agents with Malicious Image Patches; MIP against Agent), an attacker can subtly perturb a tiny fraction of pixels on a screen or an image. When an OS agent "looks" at this patch, the visual instruction hijacks its execution loop.
To make the attack self-propagating, the MIP forces the agent to perform actions like re-posting the adversarial image to a social platform or saving it to a shared file system. When subsequent agents view that platform or file, they are immediately infected, creating an autonomous, vision-based computer worm.
Defending against this at the core policy level is incredibly difficult. Wu et al. (Dissecting Adversarial Robustness of Multimodal LM Agents) demonstrated that adversarial influence easily flows through modular pipelines via peripheral components (such as upstream image captioners). Even if the central decision-making model is robustly aligned, it cannot safely process the corrupted text descriptions handed down by its peripheral modules.
The Security Tax and Defense Dilemmas
Securing agent networks against viral propagation requires navigating a fundamental trade-off. Peigné et al. (Multi-Agent Security Tax) formalize this as the "Security Tax": when you inject strict safety guardrails or "memory vaccines" into agents to prevent them from executing or relaying suspicious instructions, their capability drops. They become less cooperative, struggle to handle unusual but legitimate tasks, and lose the fluid collaboration efficiency that makes multi-agent systems valuable in the first place.
To bypass this tax, researchers are looking at structural and dynamic defenses rather than individual agent alignment:
- Robustness by Construction: Nöther et al. (MaMa) frame the problem as a game-theoretic battle between a system designer and an adversary, mathematically optimizing the agent architecture to guarantee safety boundaries even when individual nodes are fully compromised.
- Topological Quarantine: The authors of G-Safeguard use Graph Neural Networks to monitor message-passing anomalies, dynamically pruning communication edges to isolate infected agents before the contagion saturates the network.
- Collective Immunity: Taking inspiration from biology, Wu et al. (Cowpox) propose deploying specialized "cure agents" that actively generate and spread high-priority safety patches across the network, allowing the system to autonomously recover from an active infection.
Key Foundational Work
More than you've asked for: A Comprehensive Analysis of Novel Prompt Injection Threats to Application-Integrated Large Language Models (2023) — contributed 1 concept elements to this direction.
Research Challenges in Nextgen Service Orchestration (2018) — contributed 1 concept elements to this direction.