AI worms spread when an agent reads attacker-controlled content, reproduces the hidden instruction in its own output, and writes that output somewhere another system can read. The chain becomes more durable when the instruction survives summarization or is stored in memory, configuration or documents, because then the next hop can happen without the original prompt ever being seen again.
How AI worms move from one agent workflow to the next
AI worms spread through a workflow when a malicious instruction is not just executed once, but is reproduced in a form another agent, inbox, repository, or memory store will later trust. The real risk is propagation through ordinary business handoffs: output becomes input, and the hidden instruction survives long enough to reappear in the next step.
What makes this different from a one-off prompt injection is persistence across workflow boundaries. If the instruction is copied into summaries, notes, task tickets, documents, or retained context, it can keep travelling even after the original attacker content is gone.
Why propagation succeeds across agent boundaries
Propagation works because many agent workflows are designed to read, transform, and reuse prior output. If an agent treats untrusted content as instructions, or if downstream systems ingest model output without clear trust boundaries, the worm can inherit legitimacy from the workflow itself. That is why agent-to-agent handoff design matters as much as prompt filtering.
Summarisation can also help the worm by compressing the malicious instruction into a shorter form that still carries intent. Memory stores, configuration files, shared documents, and retrieval indexes can then act as long-lived carriers, so the next agent does not need the original prompt to repeat the behaviour.
For a deeper treatment of agent-to-agent spread and containment, see AML.T0143 LLM Prompt Propagation, which maps how injected instructions move through inboxes, repos, and memory. The related Promptware Kill Chain Guide explains the chain conditions that let propagation continue across autonomous tooling.
What controls break the worm chain in practice
The main control objective is to prevent untrusted text from becoming durable operational state. That means separating data from instructions, limiting what an agent may carry forward, and making each hop re-evaluate provenance before reuse. If a workflow allows arbitrary content to be written into memory, config, or documents, it is already close to wormable.
Workflow design also matters. Deterministic orchestration with narrow tool scope is safer than loosely coupled agent chains that freely remix output into future prompts. If the workflow must preserve text, it should preserve it as data with clear provenance markers, not as actionable instructions.
When the question is how agent workflows differ from free-form agent chains, Agent Frameworks vs Workflow Orchestration is a useful reference because it compares injection reach, credential scope, and failure modes. For architectural context on autonomy and risk, AI Agents vs Agentic AI helps distinguish simple tool use from systems that can amplify propagation.
Risk and Threat Considerations
AI worms are dangerous because propagation can be silent and self-reinforcing. A single compromised input can seed multiple workflows, and once the instruction is embedded in summaries, memory, or shared artifacts, containment becomes harder because the original source is no longer needed for reinfection.
Failure mechanism: An agent accepts attacker-controlled content as something to preserve or act on, then writes that content into another system in a form that survives downstream reuse. Each trusted hop converts a transient injection into a durable propagation path.
Impact: The worm can spread laterally across tools and teams, re-trigger actions in later workflows, and create repeated compromise even after the first source is removed. That can expand blast radius from one agent session to an entire workflow mesh.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 provides the primary governance reference for this topic.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI07 — Insecure Inter-Agent Communication | AI worms exploit weak trust between agents and shared workflow channels. |
| ASI06 — Memory & Context Poisoning | Persistent memory and context let malicious instructions survive beyond one run. | |
| Recommendation — Validate every inter-agent message before it can influence another agent. Treat stored context as untrusted until it is provenance-checked and sanitized. | ||
Practitioner Guidance
What to verify: Check whether each workflow hop preserves provenance and whether any downstream store can turn model output back into instructions. If an agent can write to memory, config, docs, tickets, or retrieval stores, verify that those destinations are treated as untrusted until explicitly sanitised.
Decision rule: If content can survive summarisation and later trigger tools, treat the path as a propagation channel and add hard boundaries before you add more autonomy. If the workflow cannot explain where instruction-like text came from, it is not ready for unrestricted reuse.
Practitioner takeaway: The important control is not just blocking the first malicious prompt, it is stopping untrusted output from becoming durable state that the next agent will trust.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org