Lesson 1 of 69 minReviewed
Tool misuse and excessive agency: design tools narrowly
Treat an agent's tools as its permissions, recognise the three root causes of excessive agency, and design tools that code can validate and scope.
An agent's tools are its permissions. When an agent does something harmful, whether a prompt injection steered it or it simply misread the task, the damage is bounded by what its tools can do and with which credentials. OWASP's entry on Excessive Agency (LLM06) traces the problem to three root causes: excessive functionality, excessive permissions and excessive autonomy [1]. The OWASP Top 10 for Agentic Applications tracks the agent-era form of the same failure as Tool Misuse and Exploitation (ASI02) [2].
| Root cause | Example | Design fix |
|---|---|---|
| Excessive functionality | A mail-reading extension that can also send mail | Ship a read-only mail tool; drafting and sending are separate tools [1] |
| Excessive permissions | A database tool connected with an admin account | A read-only role scoped to the tables the task needs [1] |
| Excessive autonomy | The agent deletes records or pays invoices without confirmation | Human approval for high-impact actions [1] |
OWASP's own worked example is an email assistant whose reading plugin also exposed send functions; one injected email was enough to make it forward sensitive mail to an attacker [1]. None of the fixes in that example depend on the model behaving well.
Narrow tools beat general tools
OWASP advises avoiding open-ended extensions such as shell access or arbitrary URL fetching in favour of granular tools [1]. The reason is enforceability. A run_shell(command) tool accepts any string, so the only thing standing between the model and rm -rf is the model. A get_build_status(pipeline_id) tool accepts an identifier that code can check against an allowlist before anything runs. The MCP specification puts the same burden on tool servers: they must validate all tool inputs, implement access controls, rate limit invocations and sanitise outputs [3].
- One tool, one verb. Separate read tools from write tools so they can be granted, logged and gated independently.
- Constrain parameters in the schema. Enums, patterns and maximum lengths; reject fields the schema does not declare.
- Resolve targets server-side. Accept an identifier, look the resource up and check that the caller may touch it, instead of accepting a path or URL the model composed.
- Scope each tool to resources. Allowed paths, repositories or tenants, with secret and key-file patterns blocked and no wildcard permissions [4].
- Fail closed. Unknown tools, or tools with no defined approval requirement, are refused [4].
- Return only what the task needs. Every extra field a tool returns is more data an injection can redirect.
Toxic flows: when safe tools combine
Tools that are acceptable alone can be dangerous together. In May 2025 Invariant Labs showed an agent using the official GitHub MCP server with a token that covered both public and private repositories. A malicious issue in a public repository instructed the agent, during a routine "review my issues" task, to read private repositories and publish their contents in a pull request on the public one [5]. The researchers stress that this was not a bug in the server's code but an architectural problem at the level of the whole agent system, and they suggest restricting an agent session to a single repository [5].
The useful review question is therefore not "is this tool safe?" but "what can these tools do together, with this token, after reading this content?" List every tool, then mark which ones read private data, which ones ingest content from outsiders and which ones can write or send outside the system. The next lessons cover how to scope the identity behind them and where a human approval belongs.
Try it on ThreatDeck
- Tool Misuse and Exploitation (ASI02) See recent stories where agents misused legitimate tools, and the tools that test for it.
- Excessive Agency (LLM06) Compare the LLM-era entry with the agentic one and note which mitigations overlap.
- Lock down MCP servers and clients Work through the checklist for the tools your agents already have.
- Detection: destructive cloud CLI under an AI agent A hunt for the outcome when a broad tool meets a broad credential.
Self-check
4 questionsPick an answer to see whether it is right and why. Only your score is saved, in this browser.
-
LLM06 is about what the system is allowed to do, not how the attack arrives: tools that do more than needed, credentials broader than needed, and actions taken without confirmation.
-
A narrow tool with an identifier that the server resolves and checks can be validated deterministically. The other three accept free-form input, so the model becomes the only control.
-
The researchers describe an architectural problem, not a server bug. Limiting the session to one repository removes the private data from the agent's reach, which no prompt instruction can guarantee.
-
The tools specification says servers MUST validate all tool inputs, implement access controls, rate limit and sanitise outputs. Clients add confirmation and review on top, but they do not replace server-side checks.
References
- LLM06:2025 Excessive Agency. OWASP GenAI Security Project, 2024-11.
- OWASP Top 10 for Agentic Applications for 2026. OWASP GenAI Security Project, 2025-12.
- MCP specification: Tools (2026-07-28). Model Context Protocol, 2026-07-28.
- AI Agent Security Cheat Sheet. OWASP Cheat Sheet Series.
- GitHub MCP Exploited: Accessing private repositories via MCP. Invariant Labs, 2025-05-26.