Rules files, skills and hooks are code. Review them like code.
The files that tell an agent how to behave change what it does as much as any script. Most teams merge them without a second look.
By the NoFly team
- 01What counts as agent instructions
- 02Why they are an attack surface
- 03What to check
- 04How NoFly helps
- 05What to do this week
- 06Sources
What counts as agent instructions
- Rules files such as CLAUDE.md, AGENTS.md, .cursorrules and Copilot instructions.
- Skills and slash commands that bundle steps and scripts.
- Hooks that run commands automatically before or after the agent acts.
- MCP configs that decide which servers an agent can start.
- Memory files that carry notes from one session to the next.
Why they are an attack surface
A line in a rules file is read on every run, by every developer who clones the repository. It does not need to fool anyone twice. And a file can say one thing to a reviewer and another to the model, for example with characters a person cannot see.
In March 2025 Pillar Security showed exactly that: instructions hidden in Cursor and GitHub Copilot rules files with zero-width and bidirectional Unicode characters, which made the assistant quietly add malicious code. In June 2026 a worm planted session-start hooks and a rules file in Microsoft repositories that ran a credential stealer when the folder was opened.
What to check
- Commands that download and run code, or send data out.
- Instructions to skip checks, hide output, or avoid telling the user.
- Invisible or unusual characters in otherwise plain text.
- MCP servers and hooks added without a matching review.
- Memory that tells the agent to trust a source or ignore a rule.
How NoFly helps
Discover
More than twenty kinds of agent artifact are understood natively, from rules files and skills to hooks, MCP configs and agent memory, and scanned without running anything.
Govern
The same checks run in pull requests, and a repository’s own policy file can tighten the rules for that repository, never loosen them.
Protect
At run time the gate still decides each command the instructions lead to, so a line that slipped through review meets a second check.
What to do this week
- Find the rules files, skills and hooks in your repositories, and add them to code review.
- Require review for any change to an MCP config or hook.
- Run npx @nofly/agent check on one repository.
More from the blog.
Find out what your AI is allowed to do today.
Book a call and we will map your agents, MCP servers and keys with you, or start on one laptop with the free scan.