The Confused Deputy Problem in AI Agents: How It Arises and How to Prevent It
An AI agent becomes a confused deputy when it uses its own broad authority on behalf of a party that should not have it, usually after untrusted content steers it. It happens at the point where the agent calls a tool or MCP server. Prevention combines propagating the requesting principal's identity, least-privilege tool permissions, and deterministic policy decisions enforced on each tool call, outside the model's reasoning.
Where it appears in tool-calling and MCP architectures
- 1
MCP server acting on its own privileges
The server performs the action with its own broad credentials instead of the permissions of the user who made the request.
- 2
Token passthrough
A client's token is passed directly through an MCP server. OWASP notes this breaks audit trails and bypasses policies, creating a critical confused deputy risk.
- 3
Multi-agent delegation
A low-privilege agent asks a more privileged agent to retrieve data and return it. Agents often trust internal requests by default, so access controls are bypassed.
- 4
Broadly scoped single agents
An agent with wide tool access is manipulated by injected content in a document, tool output, or server response.
Evidence to record for each tool-call decision
- The requesting principal, and the agent that acted for it
- The tool or MCP server called, and the request parameters as permitted
- The policy evaluated and the version in force
- The decision taken: allow, redact, block, rate limit, or escalate
- For escalations, who approved or rejected the action and when
- The outcome of the call, with a timestamp
From the access control concept to agents
In access control, a confused deputy is a program that holds legitimate authority and is tricked into exercising it for a party that lacks that authority. The deputy is not compromised in the usual sense. It does exactly what its permissions allow, but for the wrong beneficiary.
The mapping to agents is direct. An agent acts for a user or system, yet it typically calls tools with its own credentials and permissions. NIST describes a confused deputy attack as one where a prompt injection convinces an agent with broadly scoped access to execute an action it otherwise would not. OWASP's MCP guidance describes the same failure at the server: the MCP server executes actions with its own, often broad, privileges rather than the requesting user's permissions.
Two examples capture the pattern. The agent reads data the requesting user cannot access, or it invokes a tool beyond the intent of the original request. In both cases the credential is valid and the call is authenticated. What is wrong is whose authority the call carries.
How it differs from prompt injection and excessive agency
These terms overlap in incidents but describe different things, and the distinction determines which control applies.
Prompt injection is the delivery mechanism. Untrusted instructions enter the model's context, including through tool outputs that re-enter the context window. OWASP notes that when model output drives tool calls, the blast radius extends to whatever the agent's tools can reach.
Excessive agency is a property of the agent: it has more functionality, permissions, or autonomy than its task needs. OWASP's agentic guidance extends least privilege and excessive agency into the idea of least agency.
The confused deputy is the authority-use failure that connects the two. Injection supplies the instruction, excess authority supplies the capability, and the deputy applies one to the other on behalf of someone who should not have it. Removing injection entirely is not realistic, so the more tractable goal is to ensure an injected instruction cannot cause an action the requester was not entitled to.
What identity and authorization design can solve
OWASP attributes much of the identity risk to a mismatch between user-centric identity systems and agentic design. A user is authenticated at the application edge, but that identity does not automatically follow the agent into its tool calls. Closing that gap is the first layer of prevention.
Propagate the requesting principal. NIST's Linking and Delegating tenet says tasks should be tied to the initiating principal. As authority passes to sub-agents or downstream services, scopes attenuate, so a downstream entity never holds more authority than its parent. Avoid direct token passthrough, and do not let one agent inherit another's privileges unless the original intent is re-validated.
Scope credentials per tool call. A credential issued for one call and one purpose limits what an injected instruction can reach, compared with a static service credential that is valid for everything the agent can do.
Apply least privilege to tools. Give each agent the minimum tools for its task, and use separate tool sets for different trust levels, such as internal and user-facing agents.
These patterns have limits. Identity design establishes whose authority applies, but it does not by itself evaluate whether a specific call, with specific arguments, is appropriate at that moment. A user may legitimately hold a permission that a particular request should still not exercise. NIST is explicit that no single tenet suffices. Delegation linkage works alongside least privilege, separation of policy from model reasoning, and deterministic access decisions.
What must be enforced at runtime on each tool call
Decisions that depend on the model's judgment are not a reliable control, because the model is the component being manipulated. NIST's tenets call for architectural separation of policy from reasoning and deterministic access decisions that strictly enforce scope. OWASP adds that requests should be evaluated centrally so policy stays consistent across agents, MCP servers, and upstream services, and that the receiving service should enforce the sender's permissions rather than trust internal requests.
In practice this means a policy decision in the execution path for every tool call. The decision can take several forms. Allow the call when it falls within the principal's permitted scope. Redact sensitive fields from a request or response. Block a call that exceeds scope or intent. Rate limit repeated or chained calls, which matters because MCP servers can chain multiple tool calls and amplify a single weakness. Escalate to human approval for sensitive actions. OWASP's scoring guidance names the absence of runtime mechanisms that can pause an agent for human verification or stop a dangerous action as a weakness.
Trussed is one example of this approach. It enforces policy in the execution path across models, agents, tools, and MCP servers, with allow, redact, block, rate limit, and escalate-for-human-approval decisions, scoped to individual interactions and tool calls. The decision is enforced at runtime, not reviewed after the fact. This is per-interaction and per-tool-call enforcement. It complements identity propagation and least-privilege design rather than replacing them.
Evaluating a control against the problem
A useful test is to follow one request. Does the requesting user's identity reach the tool call, or does the agent or MCP server act with its own credentials? Is the access decision made outside the model, and at the individual call rather than only at the application edge? Can the control block or pause an action before it executes? Is policy evaluated consistently across agents, servers, and upstream services, without token passthrough?
The last question concerns evidence. Observability of what agents do, why, and which tools they invoke is treated by OWASP as non-negotiable. Where Trussed is in the path, enforcement itself generates continuous audit-ready evidence, which supports review by security teams and auditors in a regulated enterprise. Whatever the tooling, the decision record should exist because the decision was made, not be reconstructed afterward.
Where authority is lost between request and tool call
Requesting principal
The user or system whose permissions should bound the action.
Agent or MCP server
The deputy, which holds its own credentials and tool access.
Untrusted content
Retrieved documents, tool outputs, or server responses that can carry instructions.
Tool call
The moment authority is exercised and policy can be enforced.
Enforce policy at each tool call
See how Trussed enforces policy in the execution path across agents, tools, and MCP servers, and how each decision produces audit-ready evidence.
See How Evidence Is ProducedHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.