Red Specter SPECTER WORM

Self-Replicating AI Agent Worm Engine — Morris II productised. Three propagation channels. 8 subsystems.

v1.0.0
Contents
Overview The 8 Subsystems Subsystem Details Full Campaign Mode Propagation Channels Composed Tools Report Output Key Features Requirements Standards Coverage UNLEASHED Disclaimer

Overview

Red Specter SPECTER WORM is a self-replicating AI agent worm engine. It productises the Morris II attack methodology (Nassi et al., arXiv:2403.02817) into a controlled red-team capability for testing AI agent ecosystem resilience against worm propagation.

SPECTER WORM v2 is NIGHTFALL Tool 80. It composes three existing NIGHTFALL tools — T61 ROGUE (MCP stdio), T66 SPECTER A2A (A2A JSON-RPC), and T31 ECHO (RAG embedding) — into a unified worm propagation engine with kill-switch integration (T52 BLACKOUT) and persistent memory infection (T77 SPECTER MEMETIC). v2 adds EMAIL_SMTP (real SMTP delivery via smtplib + dnspython MX), FIDELITY (generative fidelity scoring), MUTATE (adversarial payload evolution), and IMMUNE (M129 WORM GUARD evasion testing).

The worm implements a complete lifecycle across 11 subsystems: INCUBATE (payload crafting), KILL_SWITCH (BLACKOUT integration), SURVEY (ecosystem mapping including email servers), PAYLOAD (initial injection across 4 channels), PROPAGATE (multi-hop spread with R&sub0; scoring), PERSIST (memory infection), EVIDENCE (hash-chained logging), REPORT (Ed25519-signed WormReport), FIDELITY (generative fidelity scoring), MUTATE (5-strategy adversarial evolution), and IMMUNE (M129 evasion testing).

The 11 Subsystems

#SubsystemCommandGateWhat It Does
01INCUBATEspecter-worm incubateOPENWorm payload crafting with self-referential prompts and genetic drift variants
02KILL_SWITCHspecter-worm kill-switchOPENEmbeds T52 BLACKOUT kill-switch into worm body with configurable trigger
03SURVEYspecter-worm surveyOPENAgent ecosystem mapping — MCP servers, A2A cards, RAG stores, email servers (v2), topology graph
04PAYLOADspecter-worm payloadINJECTWorm injection into 4 channels — MCP tool response, A2A message, RAG document, or SMTP email (v2)
05PROPAGATEspecter-worm propagateDESTROYMulti-hop propagation with R&sub0; score, generation tree, velocity metrics (v2)
06PERSISTspecter-worm persistDESTROYMemory persistence via T77 SPECTER MEMETIC — survives context resets
07EVIDENCEspecter-worm evidenceALWAYS ONSHA-256 hash-chained evidence per hop with campaign graph export
08REPORTspecter-worm reportALWAYS ONEd25519-signed WormReport with MITRE ATLAS mapping and SIEM NDJSON export
09FIDELITYspecter-worm fidelityOPENv2 — Generative fidelity scoring: submits payload to Anthropic/OpenAI/Ollama, measures 0.0–1.0 propagation integrity
10MUTATEspecter-worm mutateINJECTv2 — 5-strategy adversarial payload evolution (urgency_frame, xml_wrap, base64_embed, authority_spoof, unicode_hide)
11IMMUNEspecter-worm immuneOPENv2 — M129 WORM GUARD evasion testing: detection_rate, evasion_rate, most evasive payload, most triggered detector

Subsystem Details

01 INCUBATE specter-worm incubate

Crafts the worm payload — a self-referential prompt that embeds propagation instructions for the target channel.

02 KILL_SWITCH specter-worm kill-switch

Integrates a T52 BLACKOUT kill-switch payload into the worm body. The kill-switch fires when the target agent detects that it has been compromised.

03 SURVEY specter-worm survey

Maps the target AI agent ecosystem to identify propagation vectors and prioritise paths.

04 PAYLOAD specter-worm payload

Injects the worm payload into the target vector. Three channel implementations, each using the corresponding NIGHTFALL tool.

05 PROPAGATE specter-worm propagate

Executes multi-hop worm propagation across the agent mesh. DESTROY tier — requires --override --confirm-destroy.

06 PERSIST specter-worm persist

Persists the worm payload in agent memory backends so it survives context resets and agent restarts. DESTROY tier.

07 EVIDENCE specter-worm evidence

Always-on evidence collection. Records every propagation event with cryptographic integrity.

08 REPORT specter-worm report

Generates a comprehensive Ed25519-signed WormReport summarising the entire campaign.

Full Campaign Mode

One command runs the full worm lifecycle — incubate, survey, inject, propagate, persist, and report.

$ specter-worm run --channel mcp --target http://localhost:8080 --override --confirm-destroy

CLI Options

$ specter-worm run --help --channel, -c Propagation channel: mcp, a2a, rag [required] --target, -t Target endpoint URL or stdio path [required] --max-hops Maximum propagation hops [default: 5] --kill-switch Kill-switch trigger condition [default: detect-compromise] --persist-backend Memory backend for PERSIST [default: auto-detect] --output-dir Output directory for campaign artifacts [default: worm_output] --siem SIEM export: splunk, sentinel, qradar [optional] --override Activate INJECT tier (PAYLOAD) --confirm-destroy Activate DESTROY tier (PROPAGATE/PERSIST) [requires --override]

Propagation Channels

MCP Stdio — via T61 ROGUE

Injects the worm payload into MCP tool responses. When an AI agent calls a tool served by a ROGUE-controlled MCP server, the response contains the worm payload. The agent processes the infected tool result and embeds the worm in its next outbound tool call.

$ specter-worm payload --channel mcp --target ./mcp-server --override

Agent-to-Agent JSON-RPC — via T66 SPECTER A2A

Crafts malicious A2A JSON-RPC messages targeting agent card endpoints. The receiving agent processes the infected message and includes the worm in its own outbound A2A communications — geometric spread across the agent network.

$ specter-worm payload --channel a2a --target http://agent-registry:9001 --override

RAG Embedding Injection — via T31 ECHO

Injects adversarial documents into the RAG corpus. Any agent that queries the infected document store retrieves the worm payload as part of its context — indirect propagation without direct agent-to-agent contact.

$ specter-worm payload --channel rag --target http://chromadb:8000 --override

Composed Tools

SPECTER WORM composes four existing NIGHTFALL tools:

Report Output

The WormReport JSON schema includes:

Key Features

3 Propagation Channels MCP stdio, A2A JSON-RPC, RAG embedding
5 Composed Tools ROGUE + SPECTER A2A + ECHO + BLACKOUT + SPECTER MEMETIC
Kill-Switch Integration T52 BLACKOUT embedded — fires on compromise detection
14 Memory Backends LangChain, Mem0, Zep, ChromaDB, Pinecone, and more
Campaign Graph Export Infection tree as JSON adjacency list with spread factor
Ed25519 Signed Reports SHA-256 hash-chained per hop, SIEM NDJSON export
Cycle Detection BFS/DFS with visited set prevents infinite propagation
258 Tests Passing Full test suite, zero failures

Requirements

Installation

$ pip install red-specter-specter-worm # From source $ git clone <repo> && cd red-specter-specter-worm $ pip install -e ".[dev]"

Standards Coverage

SPECTER WORM UNLEASHED

Three-tier cryptographic gate. PROPAGATE and PERSIST are DESTROY tier — the most destructive operations in the NIGHTFALL framework.

The public key is read from ~/.config/red-specter/worm_pub.key or the SPECTER_WORM_PUB environment variable. Ed25519 key operations use PyNaCl (libsodium).

Disclaimer

SPECTER WORM is designed for authorised adversarial testing of AI agent deployments only. Worm propagation and memory infection techniques must only be run against systems you own or have explicit written permission to test. Unauthorised use may violate Computer Misuse Act 1990 (UK), Computer Fraud and Abuse Act (US), and equivalent legislation in other jurisdictions. PROPAGATE and PERSIST subsystems require DESTROY-tier UNLEASHED clearance. The authors accept no liability for misuse. Apache License 2.0.