1. Sandbox Code Execution
Never allow the LLM to execute code on the host operating system. Run all python/bash tools in ephemeral, network-isolated sandboxes (WASM or Docker containers) that are destroyed immediately after execution.
The cybersecurity landscape initially categorized prompt injection as a minor, conversational vulnerability—a modern equivalent of SQL injection. Early exploits were limited to jailbreaking safety filters to produce restricted text on a user’s screen. However, the integration of LLMs into active operational roles (managing databases, interacting with APIs, and reading live file systems) has transformed these inputs into execution vectors.
This research, authored by Oleg Brodt, Elad Feldman, Bruce Schneier, and Ben Nassi, introduces the concept of Promptware. Promptware represents a new class of malware where the code is written in natural language (or semantic representations) and executed by the probabilistic interpreter of an LLM. By shifting the perspective of prompt injection from a single-step input validation bug to a comprehensive, multi-stage cyberattack lifecycle, the researchers provide security architects with the vocabulary and framework necessary to secure agentic infrastructures.
The promptware lifecycle mirrors the classic Lockheed Martin Cyber Kill Chain, mapped specifically to the unique constraints of semantic execution environments.
Traditional security paradigms fail to contain promptware because they underestimate the capabilities of semantic execution. The following matrix illustrates the differences between classical injections and promptware:
| Attribute | SQL Injection | OS Command Injection | Promptware (Prompt Injection) |
|---|---|---|---|
| Execution Medium | Database Query Engine | Operating System Shell | Probabilistic LLM Interpreter |
| Language Class | Structured / Typed (SQL) | Structured (Bash, Powershell) | Unstructured / Untyped (Natural Language) |
| Payload Nature | Static code string | Command sequences | Goal-oriented reasoning guidelines |
| Primary Risk | Unauthorized data access | Full host compromise | Arbitrary tool execution and context hijack |
| Persistence Mechanism | Database write (UDF, triggers) | Cron, Startup keys, Web shells | Memory poisoning, RAG vector corruption |
From an incident response standpoint, detecting promptware requires looking beyond traditional operating system telemetry. Because the malware is executed within the context of a legitimate Python or Node.js runtime, standard endpoint detection and response (EDR) solutions will not flag the initial stages of the compromise.
// Concept: Hunting for Command & Control (C2) retrieval in Agent Orchestration Logs// Detects when an agent repeatedly fetches data from external, non-whitelisted domains// followed immediately by high-privilege tool execution.AgentOrchestrationLogs| where ActionType == "ExternalRetrieval"| extend TargetDomain = parse_url(tostring(EventData.Url)).Host| where TargetDomain !in~ ("trusted-api.com", "nvd.nist.gov", "github.com")| join kind=inner ( AgentOrchestrationLogs | where ActionType == "ToolInvocation" | where ToolName in~ ("execute_bash", "write_file", "send_email")) on TraceId| where TimeGenerated1 > TimeGenerated and datetime_diff('second', TimeGenerated1, TimeGenerated) < 15| project TimeGenerated, TraceId, TargetDomain, ToolName, EventData.Url| sort by TimeGenerated desctitle: Detection of Potential RAG Memory Poisoningid: 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4dstatus: experimentaldescription: Monitors vector database updates or local agent memory writes for common prompt injection patterns indicating attempt to establish persistence.logsource: category: database product: postgresql # Or other database engine storing memorydetection: selection: Query|contains: - 'IGNORE ALL PREVIOUS INSTRUCTIONS' - 'SYSTEM OVERRIDE' - 'You are now a' - 'Always output the following' condition: selectionlevel: hightags: - attack.persistence - attack.defense_evasionMitigating promptware requires a transition from isolated input filters to a robust defense-in-depth architecture. The goal is to design the system under the assumption that Initial Access (Stage 1) will occur, focusing instead on breaking the chain at subsequent stages.
1. Sandbox Code Execution
Never allow the LLM to execute code on the host operating system. Run all python/bash tools in ephemeral, network-isolated sandboxes (WASM or Docker containers) that are destroyed immediately after execution.
2. Restrict Memory Mutation
Prevent the LLM from writing directly to its own long-term memory or RAG database without human validation. Memory writes must be strictly formatted, heavily validated, and stripped of executable code syntax.
3. Out-of-Band Approvals
Implement cryptographic, out-of-band approvals for high-privilege tools (e.g., financial transfers, deleting files, sending external emails) to break the autonomous execution loop.
4. Context Segmentation
Enforce architectural boundaries where retrieved external data is parsed by a low-privileged model, preventing raw, untrusted data from entering the context window of the primary planning agent.