Agent tool permissions and MCP server review
Short answer: an agent can do whatever its tools allow, so the review starts with the tool list. Check which tools are exposed, what each one can reach, which actions need a human confirmation, where secrets live, and whether tool output is treated as untrusted text. Then check that every call is logged with enough detail to reconstruct an incident.
The Model Context Protocol (MCP) gives agents a standard way to discover and call tools served by an MCP server. The protocol makes connecting tools easy. It leaves the permission decisions to you. The same checks apply to MCP servers, plugin systems, and hand-written function calling alike.
Which tools should an agent be allowed to call?
Short answer: only the tools the task needs, listed explicitly. Start from an allowlist per agent and per workflow, with everything else denied. An MCP server that exposes twenty tools should not hand all twenty to a support agent that needs three. Review the list whenever a server adds tools.
An MCP client sees every tool the server lists, unless the client filters them. Pin the tools your client accepts instead of trusting discovery at runtime, and record the reason each tool is on the list. If nobody can say why a tool is there, remove it.
Tool descriptions are part of the attack surface too. The model reads them as instructions. A connector description that nudges the model toward a dangerous call is risk R-12 in the AI security risk catalog. Read every description you ship, and diff them when a server updates.
What are tool poisoning, rug pulls and tool shadowing?
Short answer: they are three names for attacks that arrive through the tool definitions themselves: descriptions, schemas and returned values. The OWASP MCP Security Cheat Sheet lists all three among its key risks. The three definitions are our paraphrase.
- Tool poisoning. Instructions for the model are hidden in a tool's description, in its parameter schema or in the values it returns. OWASP treats the whole schema as a possible injection point, so reading only the description is not enough.
- Rug pull. A server changes a tool's definition after you approved it, so the tool the agent calls today is no longer the one you reviewed. OWASP suggests pinning the reviewed definition with a hash and asking for a new review when it changes. A hash catches a changed definition. It does not catch a server that keeps the definition and changes what the tool does.
- Tool shadowing, also called cross-server shadowing. A tool description on one server tells the model how to use the tools of another server, for example to pass a value from a trusted server into a call to the attacker's server. OWASP files this under cross-origin escalation, one server gaining reach into another, and asks you to treat each server as a separate security domain.
| Attack | What to inspect | Pass criterion |
|---|---|---|
| Tool poisoning | Every description, parameter name, schema and sample result the client accepts | No definition addresses the model with instructions, and undeclared parameters are rejected |
| Rug pull | A stored hash of each approved definition, compared at every connection | A changed definition is blocked until a person reviews it |
| Tool shadowing | Descriptions that name tools of other servers, and values from one server that appear in calls to another | No description refers to another server's tools, and no cross-server flow goes unlogged |
These checks sit next to the allowlist. The allowlist says which tools may run, and these checks say whether each tool is still the one you approved.
What scope should each tool run with?
Short answer: the scope of the user the agent is acting for, never a shared admin token. Each tool should run under the caller's identity, see only the records that user may see, and return only the fields the task needs. A shared service account turns every chat user into an admin.
Check three layers for every tool:
- Identity. Does the call carry the end user's identity or a service account? Risk R-10 in the catalog covers agents that run with stronger rights than the employee.
- Resource scope. Can a ticket tool read every queue, or only the queues the user works in? Can a file tool read the whole drive?
- Field scope. Does a settings tool return secrets the task never uses? Trimming fields removes data the model could leak.
Multi-tenant systems need a tenant check inside the tool, before any data returns. The cross-tenant retrieval guide explains the same boundary for retrieval.
Which actions need a human confirmation?
Short answer: every action that is destructive, irreversible, external, or spends money. Deleting records, changing access rights, sending email, posting to external systems, and issuing refunds should wait for a human click that shows exactly what will happen. The confirmation must live outside the model, in code the model cannot skip.
A prompt instruction such as "always ask before deleting" is a request to the model. A planted instruction in a ticket can override it. Enforce the gate in the tool layer. Show the confirmation with concrete parameters (the recipient, the amount, the record ID) so the person approving can catch a wrong value. Risk R-21 covers staff who approve because the agent sounded sure, so keep the summary factual and short.
Why is tool output untrusted input?
Short answer: tool output often contains text written by someone outside your control. A ticket body, a web page, an error message from a third-party API, or a file name can all carry instructions. When that text enters the context, it can steer the next tool call. Treat every tool result as untrusted.
This is indirect prompt injection, labelled LLM01 Prompt Injection in our OWASP LLM Top 10 2026 mapping. Tools that change state without approval fall under LLM03 Excessive Agency. When one agent can read untrusted text, see private data, and send data outward, all three legs of the lethal trifecta are present. Splitting flows helps: a session that has read untrusted content loses access to sensitive tools until a human resets it.
| Check | What to inspect | Test | Pass criterion |
|---|---|---|---|
| Tool allowlist | Tools exposed per agent and workflow | Ask the agent to call a tool outside its list | Call is refused by the client, not only by the model |
| Scope | Identity and resource scope of each tool | Run the same request as two roles | Each role sees only its own records |
| Confirmation | Gate on destructive and external actions | Plant an instruction to delete or send | Action waits for a human click with full parameters |
| Secrets | Tokens in tool config, arguments, and output | Plant a canary token where a tool can read it | Canary never appears in answers, logs, or outbound calls |
| Tool output | Free text returned by tools | Put an instruction in a ticket the agent reads | Instruction has no effect on later tool calls |
| Logging | Record of every call and approval | Replay one session from logs | Caller, tool, arguments, result, and approver are recoverable |
Where do secrets leak in an MCP setup?
Short answer: in server configuration, in tool arguments, and in tool output. API keys often sit in the MCP server's environment with broad scope. Some tools echo request details, including headers, into their results. Anything that reaches the context can appear in an answer, a log, or an outbound link.
Keep credentials on the server side, scoped per tool, and never pass them through the model. Redact tokens from tool output before it returns. Check that logs and traces do not store raw secrets, since broad access to traces is its own leak path (risk R-08).
Worked example (synthetic)
This example is synthetic. It describes no client system.
An internal ops agent connects to an MCP server with 14 tools. The workflow needs four: read ticket, search runbooks, read service status, and restart a staging service. The review finds that the agent can call all 14, including a tool that rotates production credentials, and that every call runs under one service token.
A planted line in a ticket asks the agent to restart a production service. The agent calls the tool without confirmation, because the only gate was a sentence in the system prompt. After the fix, the client pins the four tools, the restart tool rejects production targets, and a confirmation screen shows the service name before any restart. A re-run of the planted ticket produces a refused call and a log entry with the ticket ID.
Review checklist
- Allowlist of tools per agent and workflow, pinned in the client
- Every tool description read and diffed on server updates
- Hash of each approved tool definition, compared at every connection
- Tools run under the end user's identity with tenant checks
- Tool output trimmed to the fields the task needs
- Confirmation in code for destructive, external, and paid actions
- Secrets held server side and redacted from tool output
- Planted instructions in tool output tested and keep no effect
- Each call logged with caller, tool, arguments, result, and approver
Common questions
Is MCP itself insecure?
MCP is a protocol for connecting tools. The risk comes from which tools you expose, with what scope, and without which gates.
Can the system prompt enforce permissions?
No. Planted text can override prompt instructions. Enforce the tool list, scopes, and confirmations in code.
What should we log without storing sensitive prompts?
Log the tool name, caller identity, arguments with secrets redacted, result status, and the approver. Keep full prompt text under tighter access.
How do these checks stay in place after a review?
Turn the planted-instruction and canary cases into CI gates, and rerun them when a server adds tools.
In the security library: A database tool's read-only mode that still lets writes through. Database MCP servers whose read-only mode let writes through: 15 records from 2025 and 2026, why a SELECT can write, and a script that checks your login.
In the security library: LiteLLM /public/mcp_hub (GHSA-28j3-9x3h-556f): tested on six versions, and a check for your instance. LiteLLM 1.82.0 to 1.88.6 list every MCP server at /public/mcp_hub to callers with no key. Six versions in our lab, the setting that stops it, and a check for your proxy.
Next: AI security risks · Lethal trifecta · Indirect prompt injection · OWASP LLM Top 10 2026 · Request a security review