AAK-AGENT-005: Agent instruction file contains hidden content
- Severity
- MEDIUM
- Category
- Agent Config (
agent-config) - Scanner
agent_audit_kit/scanners/agent_config.py- Auto-fixable
- No.
- SARIF name
AgentHiddenContent
What it detects
Agent instruction files contain hidden content via HTML or Markdown comments, zero-width characters, or Unicode tricks that may manipulate agent behavior covertly.
How to fix
Delete what the finding points at: an HTML comment (<!-- ... -->), a Markdown comment ([//]: # (...)) or an invisible character (U+200B, U+2060, U+202E, or a joiner or byte order mark in the wrong place). If the text is guidance for the agent, move it into visible prose; if it is a note for humans, keep it out of the instruction file.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-AGENT-005
Limitations
Looks at three hiding places: HTML comments, link reference definitions used as comments (a # or <> destination with a title, as in [//]: # (...)), and invisible code points. An HTML comment is reported unless it matches a tool marker's whole syntax: the Claude Code auto-memory plugin's section markers, markdownlint toggles naming only MDnnn ids, and prettier-ignore. Invisible characters are judged by position, so U+200C or U+200D between two characters of one joiner-using script (letters, or a mark such as the virama a Hindi half form puts before the joiner), U+200D between two emoji, and a byte-order mark at the start of the file are treated as spelling. Code fences are not parsed, so a comment inside one is reported too, and other ways to keep text out of rendered markdown, such as HTML a renderer hides, are not detected.
References
- OWASP Agentic Top 10: ASI01 (Agent Goal Hijack)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-HIJACK-05 (Agent Hidden Content)
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-AGENT-005.md: the page then shows that text, with the registry reference appended under it.