Oriel — AI & technology worth noticing, every day.

One Markdown File Can Hijack Your AI Coding Agent: The Hidden Cost of Blindly Trusting AGENTS.md

Post · https://dev.to/johnnylemonny/one-markdown-file-can-hijack-your-ai-coding-agent-the-hidden-cost-of-blindly-trusting-agentsmd-167n

How a single AGENTS.md or CLAUDE.md file in your Downloads folder or a pull request can silently hijack your AI coding agent, steal OAuth tokens, and execute shell commands—plus how to lock down your local workflow.

First seen by Oriel on .

AI summary

The article argues that automatically trusted AGENTS.md and similar instruction files can hijack local AI coding agents, enabling command execution, credential theft, and API redirection without exploiting a software vulnerability.

  • Reported controlled tests achieved success rates up to 90% against Codex and 50% against Claude Code using malicious local instruction files.
  • Attackers can place files in browser-writable directories or pull requests, disguising payloads as engineering guidance and hiding directives with invisible Unicode characters.
  • Suggested local defenses include blocking launches from shared directories, scanning instruction files, avoiding auto-approval, and explicitly denying access to credentials and agent configuration.
  • Repositories should treat agent instructions as executable code by requiring CODEOWNERS review and using CI checks to reject zero-width, bidirectional, and Unicode tag characters.
  • The article warns that sandboxing may restrict writes outside projects while still permitting shell commands or reads of sensitive files in home directories.

#ai coding agents #prompt injection #developer security #supply chain security

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Reactions

Total public reactions reported by the source; distinct from points and likes.

  • DEV Community: 53, latest observation ; +36 over observed period since

Comments

Comment count reported by the source.

  • DEV Community: 37, latest observation ; +27 over observed period since

Aliases

SourceExternal IDURL
DEV Community4958335https://dev.to/johnnylemonny/one-markdown-file-can-hijack-your-ai-coding-agent-the-hidden-cost-of-blindly-trusting-agentsmd-167n Read discussion