GenAI Agent Instruction File Written to Downloads

Last updated a day ago on 2026-10-31
Created 5 days ago on 2026-10-27

About

Detects creation or change of an AI coding-agent instruction file (agents.md or claude.md) in a user Downloads folder by a browser or an archive tool. A web page can save AGENTS.md or CLAUDE.md into Downloads without a click, and opening an archive can extract the same files there. Codex and Claude Code treat those files as trusted project instructions, which can lead them to rewrite their own configuration, install a package, or leak a login token.
Tags
Domain: EndpointDomain: GenAIMitre Atlas: AML.T0051Mitre Atlas: AML.T0093OS: LinuxOS: WindowsOS: macOSUse Case: Threat DetectionTactic: Initial AccessTactic: ExecutionData Source: Elastic DefendThreat: Unauthorized AI UsageRule Type: ES|QLPlatform: WindowsPlatform: LinuxPlatform: macOSLanguage: esql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Initial Access (TA0001)(external, opens in a new tab or window)

Execution (TA0002)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
FROM logs-endpoint.events.file-* METADATA _id, _version, _index | WHERE event.type IN ("creation", "change") AND TO_LOWER(file.name) IN ("agents.md", "claude.md") AND ( file.path LIKE "/Users/*/Downloads/*" OR file.path LIKE "/home/*/Downloads/*" OR file.path LIKE """C:\\Users\\*\\Downloads\\*""" ) AND ( TO_LOWER(process.name) IN ( "google chrome", "chrome.exe", "chrome", "chromium", "chromium-browser", "google-chrome", "microsoft edge", "msedge.exe", "microsoft-edge", "firefox", "firefox.exe", "safari", "brave browser", "brave.exe", "brave", "brave-browser", "opera", "opera.exe", "vivaldi", "vivaldi.exe", "explorer.exe", "com.apple.webkit.networking", "7z.exe", "7zg.exe", "7zfm.exe", "7z", "7zz", "winrar.exe", "rar.exe", "unrar.exe", "rar", "unrar", "winzip.exe", "winzip64.exe", "bandizip.exe", "peazip.exe", "tar.exe", "tar", "bsdtar", "unzip.exe", "unzip", "unar", "ditto", "archive utility", "bomarchivehelper", "the unarchiver", "keka", "file-roller", "ark" ) OR TO_LOWER(process.name) LIKE ( "google chrome helper*", "microsoft edge helper*", "brave browser helper*", "opera helper*", "vivaldi helper*" ) ) | KEEP _id, _version, _index, data_stream.namespace, @timestamp, host.name, host.id, agent.id, user.name, user.domain, event.type, event.action, file.name, file.path, process.name, process.executable, process.entity_id

Install detection rules in Elastic Security

Detect GenAI Agent Instruction File Written to Downloads in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).