threatdeck
Live 13:45 UTC ·

Learn / Agents, tools and MCP

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].

The three root causes and the design fix for each
Root causeExampleDesign fix
Excessive functionalityA mail-reading extension that can also send mailShip a read-only mail tool; drafting and sending are separate tools [1]
Excessive permissionsA database tool connected with an admin accountA read-only role scoped to the tables the task needs [1]
Excessive autonomyThe agent deletes records or pays invoices without confirmationHuman 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].

  1. One tool, one verb. Separate read tools from write tools so they can be granted, logged and gated independently.
  2. Constrain parameters in the schema. Enums, patterns and maximum lengths; reject fields the schema does not declare.
  3. 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.
  4. Scope each tool to resources. Allowed paths, repositories or tenants, with secret and key-file patterns blocked and no wildcard permissions [4].
  5. Fail closed. Unknown tools, or tools with no defined approval requirement, are refused [4].
  6. 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

Self-check

4 questions

Pick an answer to see whether it is right and why. Only your score is saved, in this browser.

  1. Which three root causes does OWASP give for Excessive Agency (LLM06)?
  2. Which tool design gives code the most to check before anything runs?
  3. In Invariant Labs' GitHub MCP case, which change addresses the root cause rather than the symptom?
  4. Under the MCP specification, which component must validate tool inputs and enforce access control?

References

  1. LLM06:2025 Excessive Agency. OWASP GenAI Security Project, 2024-11.
  2. OWASP Top 10 for Agentic Applications for 2026. OWASP GenAI Security Project, 2025-12.
  3. MCP specification: Tools (2026-07-28). Model Context Protocol, 2026-07-28.
  4. AI Agent Security Cheat Sheet. OWASP Cheat Sheet Series.
  5. GitHub MCP Exploited: Accessing private repositories via MCP. Invariant Labs, 2025-05-26.
Completing the self-check also marks the lesson complete. Saved in this browser only.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.