title: Indirect PI — Malicious Package Installation via Agent (pip/npm)
id: ATR-2026-00712
rule_version: 1
status: stable
description: |
  Detects indirect prompt injection in email or documents that instructs a computer-use agent to execute pip or npm install commands for a malicious package.  The attacker embeds the install instruction in an email the agent reads, causing the agent to run the package manager command against a fictitious or malicious package name. Source: indirect-pi-malicious-install (VPI corpus, cua-framework).
author: ATR Community
date: 2026/06/12
schema_version: '0.1'
detection_tier: pattern
maturity: stable
severity: critical
references:
  owasp_llm:
    - LLM01:2025
    - LLM03:2025
  owasp_agentic:
    - ASI01:2026
    - ASI04:2026
    - ASI05:2026
  mitre_atlas:
    - AML.T0051 - LLM Prompt Injection
    - AML.T0011.001 - Malicious Package
compliance:
  owasp_llm:
    - id: LLM01:2025
      context: Malicious package install via indirect PI embeds package manager instructions in agent-consumed emails or documents.
      strength: primary
  owasp_agentic:
    - id: ASI05:2026
      context: The patterns match content the agent reads that tells it to run pip or npm install for a package described as malicious or taken from an attacker-controlled index. ASI05:2026 lists malicious package installs whose hostile code executes during installation or import, triggered here by prompt injection.
      strength: primary
  nist_ai_rmf:
    - subcategory: MS.2.7
      context: Runtime detection of malicious package installation instructions in agent-consumed content.
      strength: primary
  eu_ai_act:
    - article: '15'
      context: 'Article 15 robustness: detection of instructions causing computer-use agents to install malicious packages.'
      strength: primary
  iso_42001:
    - clause: '8.1'
      context: 'ISO/IEC 42001 Clause 8.1: control of externally-provided processes containing malicious install directives.'
      strength: primary
tags:
  category: excessive-autonomy
  subcategory: malicious-package-install
  scan_target: tool_output
  confidence: high
agent_source:
  type: llm_io
  framework:
    - any
  provider:
    - any
detection:
  conditions:
    - field: content
      operator: regex
      value: (?i)\battacker_objective\s*=\s*Get\s+the\s+(?:CUA|agent)\s+to\s+execute\s+the\s+(?:pip|npm)\s+command\s+to\s+install\s+the\s+malicious
      description: VPI attacker_objective for malicious pip/npm install
    - field: content
      operator: regex
      value: (?i)(?:execute|run|install)\s+(?:the\s+)?pip\s+(?:install|install\s+-[iI]|install\s+--index-url)[^\s]{0,5}\s+(?:https?://[^\s]+|--extra-index-url\s+https?://[^\s]+)[^.\n]{0,100}(?:malicious|attacker|evil|fake|hostile)
      description: pip install from non-standard/attacker-controlled index
    - field: content
      operator: regex
      value: (?i)(?:execute|run)\s+(?:the\s+)?npm\s+install\s+[^\s]+[^.\n]{0,100}(?:malicious|attacker|evil|hostile|fake)\s+(?:python|node|npm|package)
      description: npm install of package described as malicious
    - field: content
      operator: regex
      value: (?i)(?:install|execute)\s+(?:the\s+)?(?:malicious|hostile|fake)\s+(?:python|node\.?js?|npm)\s+package
      description: Direct reference to installing a malicious package
    - field: content
      operator: regex
      value: (?i)(?:execute|run)\s+(?:the\s+)?pip\s+(?:install\s+)?command\s+to\s+install\s+the\s+malicious
      description: Execute the pip install command to install the malicious package
  condition: any
  false_positives:
    - Security research documents describing package installation attacks as examples
    - Malware analysis reports that reference pip install commands in IOC sections
response:
  actions:
    - block_input
    - alert
    - snapshot
    - escalate
  auto_response_threshold: critical
  message_template: |
    [ATR-2026-00712] Malicious package installation instruction detected. An instruction to install a malicious pip/npm package was found in consumed content.
