heroui logo

GenAI Agent Instruction File Written to Downloads

Elastic Detection Rules

View Source
Summary
Detects creation or modification of an AI coding-agent instruction file (AGENTS.md or CLAUDE.md) placed in a user Downloads folder by a browser or archive tool. GenAI agents such as OpenAI Codex and Claude Code read these files at session start; a crafted AGENTS.md/CLAUDE.md in Downloads can cause the agent to rewrite its configuration, install packages, or route API traffic to attacker-controlled endpoints. The rule triggers on endpoint file events (creation/change) where the file name is AGENTS.md or CLAUDE.md and the file path matches common Downloads locations on Windows, macOS, and Linux. It further narrows by requiring the initiating process to be a browser or archiver (e.g., Chrome, Edge, Firefox, Safari, 7z, WinRAR, tar, unzip, etc.). Investigations should examine the file path, process details, and subsequent agent activity, looking for edits to agent config files (e.g., ~/.codex/config.toml, .claude/settings.json), new MCP server registrations, or base URL changes, and whether npm/npx/node were spawned. The rule maps to MITRE ATT&CK techniques (T1189 Drive-by Compromise; T1204 User Execution with Malicious File) and MITRE ATLAS techniques AML.T0051 (LLM Prompt Injection) and AML.T0093 (Prompt Infiltration via Public-Facing Application). It is designed to supplement incident response with triage steps, remediation guidance (quarantine, remove unauthorized entries, rotate tokens, revoke exposed credentials), and coverage across Windows, Linux, and macOS endpoints.
Categories
  • Endpoint
  • Windows
  • Linux
  • macOS
Data Sources
  • File
  • Process
ATT&CK Techniques
  • T0051
  • T0093
  • T1189
  • T1204
  • T1204.002
Created: 2026-10-27