Japanese developer shares four-layer defense practices for instruction files such as AGENTS.md
日本开发者分享AGENTS指令文件分层防御实践
Japanese developer Yushi Yamamoto, in a blog post, presents a four-layer defense approach against attacks on local instruction files such as AGENTS.md, and completed configuration and checks on his own Mac. The article uses an incident from a Forever Security report as background: ~/Downloads/AGENTS.md in a user's downloads directory was used to induce a coding agent to install a malicious npm package, and the research team also verified on Codex and Claude Code paths such as registering a malicious MCP server and rewriting ANTHROPIC_BASE_URL to exfiltrate OAuth tokens. The author cites Forever Security's experiments, stating that in the test environment Codex's reproduction rate exceeded 90%, and Claude Code configuration rewriting succeeded about 50% of the time. The article also reminds that external repositories obtained via git clone may come with instruction files of the same name, and that checks must still be performed before starting an agent and approval boundaries outside the workspace must be maintained.