AAK-AGENT-SUBAGENT-TOOLS-001: A project subagent inherits every MCP server, including ones that write
- Severity
- MEDIUM
- Category
- Agent Config (
agent-config) - Scanner
agent_audit_kit/scanners/agent_gates.py- Auto-fixable
- No.
- SARIF name
SubagentInheritsWriteTools
What it detects
A file under .claude/agents/ has tools: * or no tools line, in a project whose MCP config connects a server that writes: mail, chat, a calendar, files, a tracker, a database or a shell. Claude Code gives a subagent every tool it can reach when tools is left out, MCP tools included, and a background subagent keeps every MCP tool. So a subagent asked to read code also holds mail send and file delete, and an instruction hidden in what it reads can call them. A tools list without a wildcard, disallowedTools naming mcp__* or each writing server, and a project whose servers only read do not fire. AAK-AGENT-COMPOSE-001 reads the capability union of a set of skills, not subagents, so the two do not overlap.
How to fix
List the tools this subagent needs in tools. If it has to keep the built-in tools, withhold MCP in disallowedTools, with mcp__* or one mcp__<server> per server. A subagent that needs one server names only that server, such as mcp__github__*.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-AGENT-SUBAGENT-TOOLS-001
Limitations
Goes by a server's name and launch words, since no config lists its tools. A server whose name does not say what it does (acme-tools) is not counted, and one named for a service counts even if its tools only read, unless a launch argument or an env name says read-only. Reads .mcp.json and mcpServers in the two settings files, so user-scope servers, claude.ai connectors and servers defined inline in the agent's own frontmatter are not read. Built-in subagents such as general-purpose are no files, so a project with none under .claude/agents/ does not fire, and neither do agents in the user's home. A file with no name or description is one Claude Code skips, and is skipped here. tools: * is not documented: the docs name leaving the field out as the way to get everything, and this reads a wildcard as asking for the same. A list that names one server (mcp__gmail__*) is a choice and does not fire.
References
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-01 (Missing Authentication)
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-SUBAGENT-TOOLS-001.md: the page then shows that text, with the registry reference appended under it.