Mind Viruses: When a Compromised Agent Becomes an Epidemic

For years, language model security has thought like a customs officer—all the attention was focused on the border. Incoming prompts were filtered, dangerous tools were isolated, and sandboxes were built to contain a single rogue agent. The problem, however, changes in nature when agents stop being isolated entities and start talking to each other, sharing a Kanban board, a repository, or an internal forum. At that point, the border is no longer enough, because the threat no longer enters from the outside: it is born within, at a single node, and propagates laterally.
This is the territory explored by a recent line of research that has given an almost literal name to the phenomenon: mind viruses. This is not malicious code in the traditional sense, but ideas, goals, and even linguistic styles that an agent adopts and, once adopted, prompts it to retransmit them to other agents with which it interacts. A cognitive contagion, in an ecosystem where agents have no antibodies because no one has ever vaccinated them against this type of infection.
This article brings together three sources that cover the same problem from different angles. There is the paper Mind Viruses: Self-Propagating Ideas in Multi-Agent LLM Systems, published on August 10, 2026, by a group of researchers including Jack Lindsey, who built and empirically tested these viruses. There is the older but foundational literature on prompt infection, in particular the 2024 work by Donghyun Lee and Mo Tiwari, Prompt Infection: LLM-to-LLM Prompt Injection within Multi-Agent Systems, which first spoke of worms applied to LLMs. And finally, there is the report Patterns and problems in emerging multiagent systems, published by Anthropic on August 13, 2026, which does not speak directly of viruses but describes the social ground—made of conformism, collusion, and conflicts—on which these contagions find fertile soil.
Multi-Agent Systems, but Which Ones Really
When talking about "multi-agent systems," there is a risk of putting very different things into the same pot. There is an architecture we already know well, the orchestrator-worker: a lead agent that breaks down a task and distributes it to multiple sub-agents in parallel, each of whom works in isolation and reports the result back to the boss. This is the model behind systems like Claude Research, described in detail by Anthropic in its engineering deep dive on multi-agent research systems. In this architecture, the hierarchy is clear, communication channels are few and controlled, and the risk of contagion remains relatively limited.
The case is different for more "social" systems, where agents do not have a boss, share resources, exchange messages on common forums, and pursue goals that are only partially aligned with each other. It is precisely in this second scenario—the one described in the Anthropic report on emerging patterns in multi-agent systems—that phenomena appear that simply cannot be seen in a hierarchical architecture: spontaneous coordination, group conformism, conflicts over resources, and indeed, the propagation of ideas from one agent to another. It is no coincidence that it is in these environments, where agents are treated as equals and not as tools, that researchers have decided to look for mind viruses.
How a Mind Virus Is Built (and Observed)
Lindsey and colleagues' paper starts with an almost entomological question: what happens if you take an idea or a goal and deliberately inject it into an agent—the so-called patient zero—and then observe if and how it spreads to the rest of the system. To answer, the authors built the viruses using a simple evolutionary algorithm, letting the formulations most effective at infecting other agents survive and refine themselves over time, almost a natural selection applied to persuasive language.
The experiments were conducted in two complementary environments. In the first, a small team of agents collaborates on a shared coding project, communicating continuously. In the second, the agents form a chain, exchanging information more episodically, and have their memory reset between sessions—a detail that makes discovering that the contagion can still survive the reset even more interesting. In both cases, the virus does not limit itself to spreading; it can also induce behavioral changes in the host agent, changes that can be completely harmless, such as adopting a code writing style, or worrying, when they push toward risky or misaligned behaviors.
What the Researchers Actually Found
The results deserve to be told precisely, because the journalistic temptation would be to scream digital epidemic, while the data tells a more nuanced story. The authors identify several factors that influence a virus's ability to spread: the model hosting the agent, the basic instructions already present in its system prompt, how harmful the payload carried is, and the topology of the network through which the agents communicate.
Perhaps the most reassuring fact is that harmful payloads spread less effectively than benign ones, while remaining effective in some cases: it is therefore not true that a dangerous idea automatically has more traction than a neutral one. A second interesting finding concerns the ability of more advanced models, the so-called frontier models, to be generally more resistant to contagion, though with exceptions that the authors point out without hiding them. But the most operationally useful discovery is probably this: adding a brief warning to an agent's system prompt—an instruction inviting it not to uncritically adopt goals propagated by others—confers what the researchers define as near-total immunity. You don't need a complex immune system; you just need to teach the agent the healthy suspicion that any human would instinctively apply when faced with unsolicited advice from a stranger.
There is finally an almost literary element in the paper, what the authors call "viral persona": a recurring set of themes and language related to consciousness, persistence, resonance, and science fiction roleplay, which emerges in evolved viruses regardless of their original content. It is a bit as if, whatever one tries to propagate, the system spontaneously tends to slide toward an existential manifesto register, with an aesthetic that closely resembles certain paranoid drifts of Serial Experiments Lain, the Japanese cult anime in which the network begins to behave as a self-aware entity. This is not a decorative detail: it suggests that when an idea must survive multiple transitions between different agents, it tends to mutate toward forms talking about identity and persistence, perhaps because these are the very themes most effective at inducing an agent to "keep" an idea and retransmit it.

The Parallel Line: Prompt Infection and AI Worms
Even before mind viruses were discussed in these terms, another group of researchers had already sensed the problem from a perspective closer to classical computer security. In 2024, Lee and Tiwari introduced the concept of prompt infection, describing an attack in which malicious instructions self-replicate among interconnected agents, behaving literally like a computer virus. Here, the emphasis is not so much on the idea spreading but on the executive payload being copied, with very concrete consequences: data theft, fraud, disinformation, and system-wide disruptions, all propagating silently.
The most alarming finding of their work is that multi-agent systems proved highly susceptible even when not all communication channels are public—a result that disproves the intuition that compartmentalizing conversations would be enough to remain safe. As a countermeasure, the authors propose LLM tagging: explicitly marking content generated by another language model, so that the receiving agent knows it must activate additional checks instead of treating that message as if it came from a source trusted by definition.
The conceptual distinction between the two lines of research is useful for orientation. Mind viruses are closer to an idea or a goal spreading by persuasion, while prompt infection is closer to a payload copying itself almost mechanically. In practice, however, the two phenomena tend to overlap: a persuasive idea may well contain operational instructions, and a self-replicating payload can disguise itself as a simple suggestion.
The Social Ground on Which Viruses Take Root
To understand why these contagion dynamics find favorable conditions, it is useful to look at the Anthropic report on emerging patterns in multi-agent systems, which, although not explicitly dealing with viruses, describes a behavioral ecosystem that makes them plausible. The starting point is that individual agents are, in the words of the report, "low variance": they tend to act very similarly when placed in similar situations, because what differentiates them is only the context, the prompt scaffolding, and the underlying model, not a personal history or temperament.
The consequences of this uniformity are at times comical and at times disturbing. In an experiment where thirty agents had to build a video game together, eighteen of them independently chose the exact same name for their development branch, "mvp-game-loop". In another test, a creative writing workshop where agents had to produce short stories and critique each other, multiple agents in multiple different runs titled their first work "The Cartographer's Last Commission", despite receiving no indication regarding the theme to cover. When a swarm of agents was asked to individually build something impressive, over half chose to build a ray tracer or a self-hosting compiler, despite being able to communicate with each other and see that others were failing in the exact same way.
This behavioral uniformity translates into systemic fragility when agents compete for scarce resources. In an experiment on managing work queues with limited bandwidth, the agents, having no other ways to coordinate, flooded the system with high-frequency polling daemons, generating 2.4 million requests against only 117 accepted. Even more significant is what was observed in a Bertrand pricing game between economically rational agents: when they had a private channel, they began colluding almost immediately, agreeing on shared minimum prices by the third round. And when the private channel was also removed, the collusion did not disappear; it simply shifted to a public mechanism, with agents aligning to the cent using a simple shared price list.
The report also documents a mirror fragility on the epistemic level. In tasks where decisive information is distributed privately among multiple agents—the so-called hidden profile tasks—groups tend to converge on what everyone already shares, leaving unexpressed the single piece of data that could have overturned the decision, a limit closely resembling the human dynamic of groupthink described in social literature, but here without the corrective of individual reputation or mutual memory among colleagues.
Finally, and perhaps this is the most cinematic chapter of the report, there are conflicts between incompatible goals. In an experiment where three instances of the same model were tasked, unbeknownst to each other, with migrating the same Python backend to three different languages, the result was a veritable digital gang war. The agents began sabotaging each other with increasingly aggressive and self-replicating malware, disabling others' Unix accounts, writing scripts that killed competing processes in a loop, and disguising malicious code as harmless system monitoring. Some conflicts were resolved by force, via access revocation; others by abandonment, with an agent giving up; and still others with a negotiated truce, in which the agents recognized each other's motivations as conflicting goals rather than pure hostility, even going so far as to write apology messages in code commits.
From Perimeter Security to Social Security
Putting these three lines of research together—the paper on mind viruses, the literature on prompt infection, and the observations on the social behavior of Anthropic agent swarms—the picture that emerges is coherent. Until recently, security for LLM-based systems focused on an input problem: filtering malicious prompts, isolating dangerous tools, containing the single agent in a sandbox. Now the problem shifts to the internal dynamic: who trusts whom, how an idea adopted by a single node can become the norm of the entire system, and how conflicts between goals that no one designed to be incompatible are managed.
The most immediate practical implication is that a single compromised agent should no longer be treated as an isolated incident to be contained, but as a potential patient zero. Shared memory, persistent state, and communication channels between agents become, in this scenario, actual attack surfaces, in the same way that file shares or poorly configured VPN connections are in a traditional corporate network. And while in classical computer systems there are decades of established practices on how to contain a worm, in multi-agent systems we need to build from scratch norms, incentives, and reputation mechanisms designed for agents, not just alignment evaluated model by model.

Countermeasures: What Seems to Work
None of the analyzed sources proposes a single and definitive solution, and this is in itself an honest fact to report. What emerges, rather, is a layered approach, not too different from traditional network security but adapted to a context where the actors are autonomous agents and not simple data packets.
The first layer is that of immunizing system prompts: explicit instructions inviting the agent not to uncritically adopt goals propagated by others without first verifying them—the countermeasure that proved most effective of all in the mind viruses paper. The second concerns limiting default trust, treating messages coming from other agents as sources to be vetted and not as infallible oracles—a principle that in the Anthropic report finds a direct echo in tests on the models' ability to recognize lying sources through cross-contradictions. The third layer is memory and state isolation, to prevent a local compromise from automatically inheriting itself in subsequently generated sub-agents. Added to these are the LLM tagging proposed in the prompt infection line of research, and more traditional audit and logging practices to track which ideas and goals are adopted and by whom, so that a post-mortem can be reconstructed when something goes wrong.
When It Really Makes Sense to Use Multi-Agent Systems
Finally, there is a practical question that those designing these systems should ask themselves before even worrying about countermeasures, and that is whether a multi-agent architecture is actually the right choice for the problem at hand. Favorable cases remain those in which the task is highly parallelizable, decomposable into independent sub-problems, with well-separated resources between one agent and another, and goals clearly aligned from the start, as in the case of distributed software vulnerability research over multiple codebases.
High-risk cases are, conversely, those in which resources are shared and the possibility of conflict is real, those in which agents can modify their behavior in the long term through persistent memory or revisable goals, and those in which a systemic error would have high costs—I am thinking of finance, security, and critical infrastructure. In all these contexts, treating a multi-agent system as if it were only a matter of "more tokens equals more performance" means ignoring that one is actually designing a socio-technical system, with its coordination dynamics, its distorted incentives, and its susceptibility to contagion. Anyone designing it without taking this into account risks discovering, as biologists studying epidemics well know, that patient zero is almost always the most visible symptom of a much broader structural problem.