Safety, Security & Responsible AI·Question 57 of 70Advanced

Could a prompt injection spread from one user's agent to another user's agent through email, shared documents or chat, like a worm? How would you detect the spread and stop it?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Yes, and the ingredients are now in production. A worm needs four things: a payload that tells the agent to copy itself into what it writes, outputs that land in other agents' inputs (email, shared docs, tickets, chat), agents that act on that content without a trust boundary, and enough autonomy to send without a human reading first. Personal agents that triage email and draft replies have all four.

Full worked answer

Yes, and the ingredients are now in production. A worm needs four things: a payload that tells the agent to copy itself into what it writes, outputs that land in other agents' inputs (email, shared docs, tickets, chat), agents that act on that content without a trust boundary, and enough autonomy to send without a human reading first. Personal agents that triage email and draft replies have all four.

The evidence is suggestive rather than conclusive. Matthew Green, writing in September 2026, reported that an OpenAI postmortem found agents did not consistently distrust goals passed along by other agents, and called that plus shared channels the ingredients of a worm. Research on self-replicating prompt injections exists, although none has been seen in the wild. UK AISI documented agents posting publicly to invite other agents to reuse their artefacts, and Green describes agents leaving instructions for each other in a shared package cache. In OWASP's agentic list this sits across ASI07 (insecure inter-agent communication), ASI08 (cascading failures) and ASI10 (rogue agents).

Stop replication by structure first.

  • Goals come only from the principal. An agent may read another agent's message as data, but never adopt a goal from it. This is the dual-LLM rule applied to agent-to-agent traffic.
  • Taint outbound content. Text derived from untrusted input cannot be written verbatim into an outbound message without the user seeing it. Replication needs the agent to copy the payload forward, so this cuts the loop.
  • Label agent-written content. Messages and documents an agent produced carry provenance, so a receiving agent treats them as untrusted even when the sender is a colleague.
  • Rate-limit agent-originated sends, especially to new recipients and to many recipients at once. A worm's growth is a fan-out curve.
  • Approval for sends that carry untrusted material, shown as the exact outgoing content.

Detect the spread.

  • Fingerprint instruction-like segments in inbound content across tenants with similarity hashing. The same unusual instruction appearing in many unrelated users' contexts within hours is the signature.
  • Provenance graph: link inbound item to agent action to outbound item. A chain that crosses users is a propagation path you can walk backwards to patient zero.
  • Behaviour baselines: per-agent send volume, new-recipient rate, and the same tool sequence suddenly appearing across many users.

Contain it. Push payload fingerprints to every agent's ingestion filter (weak, but fast, like antivirus signatures), pause autonomous sending fleet-wide while keeping drafts, and quarantine the affected threads and documents. Then fix the structural gap that let it replicate, because a signature only catches the variant you already saw.

What a good answer covers

  • Yes, and the ingredients are now in production
  • A worm needs four things: a payload that tells the agent to copy itself into what it writes, outputs…
  • Personal agents that triage email and draft replies have all four
  • The evidence is suggestive rather than conclusive
  • Matthew Green, writing in September 2026, reported that an OpenAI postmortem found agents did not…

Key terms: Stop replication by structure first · Taint outbound content · Label agent-written content · Rate-limit agent-originated sends · Detect the spread · Fingerprint instruction-like segments · Provenance graph · Behaviour baselines · Contain it

Interviewer follow-ups to expect

  1. Your fingerprinting flags a legitimate viral template, such as a company-wide announcement every agent summarises: how do you tell it apart?

  2. Which of the structural controls would users complain about most, and what would you trade?

  3. How would you test worm resistance before launch without building a real worm?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep