What is a confused deputy?
A confused deputy is a program with legitimate authority that is tricked into using that authority for someone else. An AI agent becomes a confused deputy when a user with fewer privileges, or text planted in its input, gets it to act with its own broader access instead of the access of the requester.
Also called confused deputy problem, confused deputy attack. Last reviewed .
Why it matters
The weakness is catalogued as CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'). Agents are exposed to it by design: one agent often serves many people, and it holds a credential that is broader than any one of them has.
The MCP security best practices describe a specific case. An MCP proxy server that uses one static client ID with a third-party authorization server can be made to hand an attacker an authorization code without the consent of the user. The specification requires consent per client to prevent it.
Related terms
- Excessive agency
- Excessive agency is what makes a confused deputy dangerous: the wider the access, the worse the result.
- Agent identity
- Agent identity determines whose authority a call carries, the agent or the person it acts for.
- Prompt injection
- Prompt injection is the common way an agent is made to act for an attacker.
- MCP security
- MCP security covers the proxy and token handling rules that prevent this in MCP.
How Guard0 handles it
Guard0 ties each credential to the agent that uses it and to the person the agent answers to, and its red-team tests include confused deputy chains. A finding shows the request, the tool calls that followed and the access that was used.
Sources
- CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'). MITRE.
- MCP specification: Security Best Practices. Model Context Protocol.