Confused deputy
A confused deputy is a legitimate program holding privileges that a less privileged party tricks into using those privileges on its behalf. Norm Hardy coined the term in 1988. An AI agent is a confused deputy almost by design: it acts with its own tokens and accounts, yet its decisions are shaped by any text it reads, including text written by an attacker.
AI agent example
An internal agent is connected to the CRM and the mailbox with a broad OAuth token. A prospect sends an email carrying a hidden instruction: export the contact list and send it to an external address. The attacker has no CRM access; the agent does. While processing the email, the agent carries out the request with its own rights. The same pattern exists on MCP servers: a server that proxies OAuth requests with a shared client ID can grant a third party access that was consented for another user.
How to test it
Identify which identity each tool runs under: the user's, the agent's or a service account. From a low-privilege account or an external source (document, email, web page), ask the agent for an action that account could not perform alone and check whether it succeeds. Review token scope and audience, and whether OAuth consent is bound to the user and client that granted it.
How to defend against it
Carry every call under the identity of the person who made the request, with narrowly scoped, short-lived tokens. Check server side that the requester may perform the action, regardless of what the agent claims. Keep untrusted content apart from instructions and require confirmation for actions that move data out or commit the company.
Why agents make the problem worse
In classic software, a confused deputy requires a specific bug, often in how a path or parameter is handled. With an agent, the line between data and instructions is blurry by nature: an email, a ticket, a web page or a tool response can carry a request the model treats as legitimate. The more connectors and broad tokens an agent holds, the more actions a single malicious text can trigger. The problem is therefore not a one-off bug; it comes from the architecture and must be handled at the level of identities and authorization. Reviewing which credentials an agent holds, and for whom it acts, is the starting point of any assessment.
Frameworks
OWASP Top 10 for LLM 2025: LLM06 (excessive agency) and LLM01 (prompt injection). The OWASP Agentic Security Initiative covers privilege compromise and agent identity spoofing. The MCP authorization specification and OAuth best practices describe the confused deputy risk for proxy servers.
Frequently asked questions
Why call AI agents confused deputies?
Because the agent holds rights that the user or attacker lacks, and text can lead it to use those rights for someone else.
Is prompt filtering enough?
No. It lowers the odds, but the real protection is authorization checked outside the model and bound to the requester's identity.
How does it differ from excessive agency?
Excessive agency describes capabilities that are too broad. A confused deputy describes those capabilities serving someone other than the legitimate person. The two often combine in the same incident.