AI tools helped gather research and write the first draft of this article. I edited it and checked every quote against the source pages listed at the end, read on 2 December 2026. The cover illustration is AI-generated. Details at the end.
An AI agent is a language model that can call tools: read a record, send a message, change a setting. The model decides which tool to call, and the text it reads along the way can push that decision in the wrong direction. You cannot make the model reliably right, so make its worst day small: give every tool only the functions, the data and the credentials the job needs, and let a person approve the actions that cannot be undone.
This article answers one question: how do you limit what an agent's tools can do? It walks through the OWASP checklist, applies it to a fictional game-support assistant, and ends with a template. It does not cover how text becomes an instruction (see the earlier part of this series, "When Retrieved Text Tries to Become an Instruction") or how to check model output before an action (the next one, "Validating Model Output Before an Action"). It is not a security audit method and it guarantees nothing.
Why the limit belongs on the tool, not on the prompt
OWASP's Top 10 for LLM applications 2025 names this problem Excessive Agency. Its definition is useful because it does not depend on the cause: it is the vulnerability that "enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM, regardless of what is causing the LLM to malfunction" [1]. Its triggers include hallucination or confabulation and direct or indirect prompt injection [1].
That wording moves the design question. You do not need to predict why the model will one day call the wrong tool. A plain mistake and a deliberate manipulation end in the same place: a tool call that the model was allowed to make. A line in the prompt saying "never delete anything" asks the model to behave. A tool that has no delete function does not need the model to behave.
The idea is older than language models by decades. A classic paper on protecting information in computer systems puts it this way: "Every program and every user of the system should operate using the least set of privileges necessary to complete the job." The paper's reason is that this "limits the damage that can result from an accident or error" [4]. Accident or error is exactly what the OWASP definition says to expect.
Three separate dials
OWASP says the root cause of Excessive Agency is "one or more of" three things: excessive functionality, excessive permissions and excessive autonomy [1]. They are different, and fixing one does not fix the others.
Functionality is what the tool can do at all. OWASP's example: a developer needs the agent to read documents from a repository, but the third-party extension they pick also lets it modify and delete them [1]. Two more of its examples are easy to miss: an extension tried in development and dropped but still available to the agent, and an "open-ended" one meant to run a specific shell command that fails to stop other shell commands [1].
Permissions are what the tool's identity can do in the system behind it. OWASP's examples: a read extension whose database identity can also update, insert and delete, and an extension serving one user that connects with a generic high-privileged identity that can see every user's files [1].
Autonomy is whether anything stops a high-impact action before it happens. OWASP's example is an extension that deletes a user's documents "without any confirmation from the user" [1].
A narrow tool can still run with a powerful identity, and a read-only identity can still serve an agent that acts unwatched. Answer all three questions.
The checklist, item by item
OWASP's prevention list has eight items [1]. The first seven concern access:
- Minimize extensions. Offer the agent only the tools it needs. OWASP: if the system does not need to fetch a URL, that tool should not be offered to the agent [1].
- Minimize extension functionality. A tool that summarises a mailbox may need only the ability to read mail, so it should not contain send or delete [1].
- Avoid open-ended extensions. Prefer a specific file-writing tool to a general "run a shell command" tool, since with the latter "any other shell command could be executed" [1].
- Minimize extension permissions. OWASP's example is a product-recommendation agent that needs read access to a products table only, enforced "by applying appropriate database permissions for the identity that the LLM extension uses" [1]. The limit sits in the database, not in the tool's good intentions.
- Execute extensions in the user's context. Actions taken for a user should run downstream in that user's context, with the minimum privileges needed; the example is requiring OAuth with the minimum scope to read a user's code repository [1].
- Require user approval. For high-impact actions, a person approves before the action is taken. OWASP allows this in a downstream system or inside the extension itself; its example is a social-media assistant with an approval routine inside the extension that implements "post" [1].
- Complete mediation. Authorization is done in downstream systems "rather than relying on an LLM to decide if an action is allowed or not", and every request to a downstream system is validated against policy [1].
The eighth item, sanitising inputs and outputs, is a different layer and belongs to the next article in this series. OWASP adds that logging, monitoring and rate limiting "will not prevent Excessive Agency, but can limit the level of damage" [1]. These reduce damage and speed up detection; they do not replace removing the access.
The mediation item has an older name too. In the same classic paper, complete mediation means "Every access to every object must be checked for authority", and the paper says that proposals to remember the result of an authority check for speed should be "examined skeptically", and that remembered results must be updated when authority changes [4]. For agents that means: check at each call, against the current rules, not once at the start of a conversation.
What the tool actually sees
A permission list on paper is not the same as what the tool receives. The practical test is to write down, for each tool: which functions it exposes, which identity it runs as, which data that identity can reach, and whether a person sees the action first. Then ask what the worst call looks like.

A related practice is to keep the user's identity out of the model's hands. If a tool needs to know whose data to read, the identity should come from the signed-in session on the server, not from an argument the model writes. Otherwise the model can be asked, in effect, to look up somebody else's records. OWASP states the principle in its "user's context" item [1]; reading the identity from the session is one way to implement it, and is the author's illustration, not a quote.
A fictional example
The following example is invented. Example Arcade is a made-up online game; its support assistant, its tools and the scenario are fictional and show the method.
Example Arcade adds an assistant to its support page. Players ask about orders, lost items and account problems. The first version has three tools:
- run_query(sql): run any read query against the support database, so the assistant can "look things up".
- account_admin(player_id, action): a convenience function that the support team already uses, which can reset a password, restore an item or ban an account.
- send_email(to, subject, body): send mail from the studio's support address.
Walk the checklist. run_query is open-ended: any table its database identity can read is reachable. account_admin holds three actions, but the assistant needs at most one, and "ban an account" is not a support-chat task at all. send_email can write to any address, so a confused or manipulated model can send anything to anyone from the studio's own domain. The three fail different items: open-ended functionality, excessive functionality, no approval on a high-impact action.
The redesigned version is smaller:
- get_my_order_status(order_id): read one order, and only if it belongs to the signed-in player. The server takes the player from the session; the model passes only the order number. The database identity behind it can read the orders view and nothing else.
- request_item_restore(order_id): does not restore anything. It creates a request in a queue for a human support agent, with the order and the player attached.
- No email tool. The assistant answers in the chat window; the human agent, if one is needed, writes from their own tools.
The worst call the model can now make is a read of the player's own order, or a request in a queue that a person reads. Free-form queries, the admin function and outbound mail are not exposed. Nothing here depends on the model understanding that they are dangerous.
The trade-off is real: the assistant answers fewer questions alone, and a person handles every restore request. That is the price of a smaller worst case. Widening a tool later can be decided with evidence, one function at a time.

Tokens and scopes: the same idea in the credentials
If your tools reach other services with access tokens, the same principle applies to the token. The Model Context Protocol's security best-practices page has a section on scope minimization. Its description of the failure: an attacker gets a token "carrying broad scopes" that were "granted up front because the MCP server exposed every scope in scopes_supported and the client requested them all"; the token then allows "lateral data access, privilege chaining, and difficult revocation" [3].
The mitigation it proposes is a progressive, least-privilege model: a "minimal initial scope set" with only "low-risk discovery/read operations", and elevation through a targeted challenge "when privileged operations are first attempted" [3]. Its list of common mistakes includes "wildcard or omnibus scopes" and "treating claimed scopes in token as sufficient without server-side authorization logic" [3]. It adds that a single omnibus scope "masks user intent per operation" in the audit trail [3].
This page is guidance for one protocol, and its attack is a scenario. The lesson transfers: ask for the smallest scope that works, and let the server decide what the token may do.
Approvals: where a person belongs
A read of the player's own order status needs no person. The checklist asks for approval on "high-impact actions" [1], and the protocol's tool specification says the same in its own terms: for trust and safety, "there SHOULD always be a human in the loop with the ability to deny tool invocations", and applications should present confirmation prompts for operations, make clear which tools are exposed to the model, and show visual indicators when a tool is invoked [2]. The specification also says clients "SHOULD" show tool inputs to the user before calling the server "to avoid malicious or accidental data exfiltration" [2].
Note the verbs: for applications and clients these are "SHOULD" statements, a recommendation and not a guarantee that any product does it. The specification gives servers "MUST" duties: validate all tool inputs, implement proper access controls, rate limit tool invocations, and sanitize tool outputs [2]. It also says clients "MUST consider tool annotations to be untrusted unless they come from trusted servers" [2]. A tool's description of itself, such as a claim that it is read-only, is not a permission.
Put the approval where the damage happens, as close to the action as possible, and show the person the exact action: not "the assistant wants to continue" but "send this message to this address" or "restore this item to this account". An approval that shows less than the action does is a button that people will learn to press without looking. That last point is the author's reasoning, not a source finding.
Common mistakes
1. Limiting the prompt instead of the tool. The prompt says "do not delete", while the tool can delete. Fix: remove the function or permission; keep the prompt as a second line.
2. One powerful identity for everything. All tools share a service account that can read every table and call every internal API. Fix: one identity per tool, each with the narrowest rights its function needs, as in item 4 of the checklist [1].
3. Open-ended tools "for flexibility". A generic query, fetch or shell tool is convenient for developer and attacker alike. Fix: tools that do one named thing [1].
4. Leftovers. The tool from the prototype is still registered. Fix: list the tools the agent can actually see in production and compare with the list you meant to ship [1].
A template to adapt
For each tool the agent can call, write one row before it ships:
| Tool | Functions it can perform | Identity it runs as | Data that identity can reach | Person sees it first? | Worst call if the model is wrong |
|---|---|---|---|---|---|
| name | only what the job needs | account or token, with scope | tables, folders, accounts | yes or no, and which action | one sentence |
Then ask of each row: could any column be smaller without breaking the job? Repeat whenever a tool is added or a vendor's extension adds a function. The sheet is the author's proposal; the checklist behind it is OWASP's.
What this article does not settle
It does not show that any single measure prevents an attack: the OWASP page says some measures only limit damage, and the protocol pages describe scenarios and recommendations, not measured outcomes. It does not say how often agents misuse tools; no source read here gives a rate. It does not cover how an agent is tricked into calling a tool, how to validate model output, how to protect private data or how to cap cost; those belong to other parts of the series. The Example Arcade tools are invented, and a real system will have constraints this one lacks.
How this article was made
| Task | What the AI did | What a person did | How it was checked |
|---|---|---|---|
| Research | Gathered candidate sources and drafted notes | Chose the question and which pages to rely on | Every quote checked against the page named in the sources, read as raw text on 2 December 2026 |
| Draft | Wrote the first draft from the notes | Edited the text, the checklist reading and the example | An independent review compares claims with the sources before publication |
| Images | Generated the cover illustration | Chose and checked it | Labelled as AI-generated in the disclosure line and alt text |
| Not done by AI | — | The decision to publish and responsibility for the text | — |
Conflicts of interest: none. The author has no commercial relationship with the organisations named here.
Responsible for this article: Dmitriy Lastovka, author. Corrections: contact form.
Sources
Labels: standard (a published industry framework), specification (a protocol's published text), guidance (best-practices documentation), paper (a classic technical paper). Quotes are as on the pages read on 2 December 2026.
- OWASP Gen AI Security Project, "LLM06:2025 Excessive Agency". https://genai.owasp.org/llmrisk/llm062025-excessive-agency/ Standard (Top 10 for LLM Applications 2025 entry); no revision date seen on the page.
- Model Context Protocol, specification version 2025-06-18, "Tools" (Security Considerations and user interaction model). https://modelcontextprotocol.io/specification/2025-06-18/server/tools Specification.
- Model Context Protocol, "Security Best Practices", section "Scope Minimization" (the 2025-11-25 documentation version, reached by redirect from the 2025-06-18 path). https://modelcontextprotocol.io/docs/2025-11-25/tutorials/security/security_best_practices Guidance.
- "Basic Principles Of Information Protection", part of a classic paper on protecting information in computer systems, hosted at MIT (design principles: least privilege, complete mediation, fail-safe defaults). https://web.mit.edu/Saltzer/www/publications/protection/Basic.html Paper; the date and authors are not shown in the page text read, so none is stated here.










