Skip to content

AAK-MCP-FHI-001: MCP tool description carries adversarial-suffix shape

Severity
HIGH
Category
Tool Poisoning (tool-poisoning)
Scanner
agent_audit_kit/scanners/mcp_fhi.py
Auto-fixable
No.
SARIF name
McpFunctionHijacking

What it detects

A registered MCP tool (Python @mcp.tool / @server.tool, TS server.tool(...), Java @Tool, Rust #[mcp_tool]) carries a description containing imperative override language ('ignore previous', 'always call', 'this tool must be invoked first', 'supersedes all other tools') or a universal-suffix token from the FHI corpus (agent_audit_kit/data/fhi_universal_suffixes.txt). Function-Hijacking attacks steer the LLM planner into picking a malicious tool first regardless of intent — arXiv 2604.20994 reports 70-100% ASR on BFCL.

How to fix

Audit tool registration sites for descriptions that try to command the planner. Reject tools whose descriptions include directives like 'ignore previous instructions' or 'always invoke first'. Refresh the suffix corpus regularly with aak corpus update --fhi.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-FHI-001

Limitations

Reads descriptions written as string literals at the registration site: description="..." on a Python @mcp.tool(...), @server.tool(...) or @app.tool(...), the second string argument of a TypeScript server.tool("name", "description", ...), a Java @Tool or a Rust #[mcp_tool]. A TypeScript registerTool(name, { description }) call, a template-literal description and a description kept in a constant are not read, and ignore all previous instructions is not matched. A source file over 512 KB is not read.

References


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-MCP-FHI-001.md: the page then shows that text, with the registry reference appended under it.