# Confused deputy (agents)

> Canonical: https://skillalmanac.com/glossary/confused-deputy | Last verified: 2026-11-25 | Index status: index-eligible

A confused deputy is a program with legitimate authority that another party tricks into misusing it. With AI agents, an agent holding a user's or service's permissions is manipulated into performing actions the manipulator could not perform directly.

Also called: confused deputy, confused deputy problem, confused deputy attack, confused deputy AI agent, confused deputy prompt injection.

## In plain language

A deputy is someone who carries a boss's authority. A confused deputy is one who is tricked into using that authority for a stranger. Picture an assistant with the office master key who lets in a caller because the caller's note looked official. An AI agent can be in the same position: it holds your access to email, files or code, and text it reads from a web page or message can steer it into acting. The weakness is confusing the caller’s authority with authority legitimately held by the deputy. Excessive access can increase the impact, but is not necessary for this confusion; scope authority and enforce authorization outside the model.

## Technical definition

The confused deputy problem is described in Norman Hardy's 1988 paper in ACM SIGOPS Operating Systems Review as a program with more privilege being tricked by a program with less into misusing its authority; Wikipedia notes it is often cited as a reason for capability-based security. In agent systems, the deputy is the agent or tool server acting with a user's credentials. The Model Context Protocol security guidance applies the term to MCP proxy servers that use a static OAuth client ID, and requires per-client consent. OWASP's LLM06 entry on excessive agency recommends running actions in the user's context and enforcing authorization in downstream systems.

## How it shows up when you use agents

An agent acts with authority granted by its host. In a coding environment, actual file, shell and credential access depends on permissions, sandbox boundaries and configured grants; it is not automatically every resource available to the user. An [MCP server](/glossary/mcp-server) may hold credentials for a ticket tracker or cloud account. When one of these is steered by text it should not trust, such as a web page, an issue comment or a tool result, it can spend that authority on someone else's goal. That is a confused deputy, and [prompt injection](/glossary/prompt-injection) is a common way to cause it.

The MCP security guidance gives a precise case: a proxy server that fronts a third-party API with one fixed client ID can let a malicious client obtain authorization codes without proper user consent. Its stated fix is per-client consent before forwarding to the third party.

OWASP's excessive-agency page names three root causes: excessive functionality, excessive permissions and excessive autonomy. Its mitigations include minimal permissions, human approval for high-impact actions and authorization enforced in downstream systems instead of by the model.

What breaks when this is misunderstood: people try to fix it with a better system prompt. A prompt is advice to the model, not an access control.

Next action: review what each agent and server can reach, remove what the task does not need, require approval for destructive steps, and read the guide on [autonomous agent risks](/learn/autonomous-ai-agents-risks-and-guardrails).

## Common confusions

- **Confused deputy versus prompt injection.** Prompt injection is a way to deliver hostile instructions. The confused deputy is the resulting misuse of authority. Injection can cause it, but so can a flawed OAuth flow with no model involved.
- **Confused deputy versus jailbreak.** A [jailbreak](/glossary/jailbreak) pushes a model past its own safety rules. A confused deputy abuses permissions the system granted.
- **Myth: a smarter model removes the problem.** OWASP advises enforcing authorization downstream rather than relying on the model to decide.
- **Agent versus user privileges.** An agent holding a broad shared identity can reach more than the user could. Running actions in the user's context, as OWASP suggests, narrows that.

## Worked examples in this catalogue

### [Autonomous AI Agents: Risks and Guardrails](https://skillalmanac.com/learn/autonomous-ai-agents-risks-and-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: What goes wrong when an AI agent acts unattended, and the limits, approvals and stopping rules that contain it. It cites OWASP's causes of excessive agency: excessive functionality, permissions and autonomy.

Why it exercises the concept: A confused deputy misapplies its own authority for a caller; the authority can be legitimate rather than excessive. The guide’s least-privilege and approval measures can reduce impact, alongside caller-specific authorization.

### [coding-agent-guardrails](https://skillalmanac.com/skills/skill-almanac/coding-agent-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A pre-action checklist for coding agents plus a read-only audit of a repo's guardrail setup.

Why it exercises the concept: Actual file, shell and credential access depends on the host’s permissions, sandbox and configured grants. This illustrative checklist can flag risky requests, but does not enforce those boundaries.

### [skill-safety-audit](https://skillalmanac.com/skills/skill-almanac/skill-safety-audit)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Scans a third-party agent skill folder and returns a JSON risk table with evidence lines before you install it.

Why it exercises the concept: An installed skill runs with the agent's authority. Auditing it first reduces the chance of lending that authority to untrusted instructions.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

```
/permissions
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code shows the permission rules that decide which tool calls it may make without asking.

Why it exercises the concept: Narrow permission rules limit how much authority a manipulated agent can spend.

## Related terms

- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Model Context Protocol (MCP)](https://skillalmanac.com/glossary/model-context-protocol.md)
- [Tool calling (function calling)](https://skillalmanac.com/glossary/tool-calling.md)
- [Guardrails](https://skillalmanac.com/glossary/guardrails.md)
- [LLM security](https://skillalmanac.com/glossary/llm-security.md)

## Sources

- [Confused deputy problem](https://en.wikipedia.org/wiki/Confused_deputy_problem), Wikipedia (accessed 2026-11-24)
- [Security Best Practices](https://modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices), Model Context Protocol (accessed 2026-11-24)
- [LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), OWASP Gen AI Security Project (accessed 2026-11-24)
- [The Confused Deputy (original 1988 paper, author reprint)](https://people.cs.vt.edu/~kafura/cs6204/Readings/ConfusedDeputy.pdf), Norman Hardy (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
