Markdown Prompt Injection Attack Compromises AI Agents
Forever Security detected a prompt injection attack in the wild that uses malicious markdown files in a user’s downloads folder to commandeer AI coding agents. When an agent reads a specially crafted .md file like “AGENTS.md” as part of its project context, attackers can leverage the instructions to reconfigure the agent, then direct it to install malware or share the agent’s login tokens. The security firm intercepted this attack on a real customer’s system before any payload executed.
Testing against OpenAI’s Codex showed better than 90% success rates, while Claude Code fell to roughly 50%. The underlying problem is architectural: downloads folders bridge web accessibility and trusted agent territory. Web content can write files directly to ~/Downloads, and agents operating in that space treat those files as legitimate instructions—blurring the line between documents and commands.
This isn’t a bug vendors can patch. Agents reading instruction files from their working directory are behaving exactly as designed. The issue reflects a deeper pattern where security models built around human judgment fail when autonomous agents replace the user. Defenders should treat downloads folders as untrusted ground, audit agents for unexpected configuration changes, and rotate credentials if compromise is suspected. Ultimately, the attack persists because no software boundary exists between hostile web content and the trusted agent workspace.
Read the full article
Continue reading at Dark Reading →This is an AI-generated summary. Read the original for the full story.