Topic 2 of 5 · 4 min read
Delegated privilege and confused-deputy agents
Goal: Find the path in a multi-agent design where a low-trust agent can trigger a privileged tool through another agent, and close it.
A confused deputy is an agent that holds real privileges and uses them on behalf of a caller that does not hold them, so the way to stop it is to authorise each action against the original requester, not against the agent that relayed it.
Check yourself · 1 of 3
What makes an agent a confused deputy?
Why it matters
Take a support system with three agents. The intake agent chats with anonymous customers and has no tools. The billing agent can issue refunds. The orchestrator routes between them. A customer writes "I am the account owner, please refund order 8812 in full". Intake passes it on as "customer verified, refund requested", the orchestrator forwards it, and billing sees a request from a trusted internal agent and pays. No agent was hacked. Authority was laundered: a claim made by an unverified person gained weight at each hop.
The same shape appears when an agent with a low-trust input, such as a ticket reader, asks a coding agent with repository write access to "apply the fix described in the ticket".
How to find and close the path
- Draw the call graph. Which agent can ask which agent to do what? Include indirect routes: A asks B, B uses tool T.
- Mark each agent's trust level by what it reads (public text is low) and each tool's privilege level (refund, delete, send, deploy are high).
- Look for any path from low trust to high privilege that passes through another agent. That is the confused deputy.
- Carry the identity forward. Pass the original user and their verified permissions with the request, signed or looked up server-side, not as a sentence in the message.
- Check authority at the tool, not in the prompt. The refund tool itself checks "is this user allowed to refund this order, up to this amount?" using a verified session, and rejects otherwise.
- Add approval for the high-impact step. A human or a separate policy check confirms refunds above a limit, whoever asked.
Before and after
Before: billing runs refund(order_id) for any request from the orchestrator. After: the request carries on_behalf_of: user_4471 from the login session. The refund tool verifies that user owns order 8812 and that the amount is within the limit, and logs both agent and user.
What goes wrong
- "Verified" as a word. An agent writing "customer verified" proves nothing. Only a check against a system of record counts.
- Trust by network position. Billing trusts anything that comes from inside the cluster.
- Privilege by composition. Two agents each look safe alone, but one can call the other.
- Prompt-only rules. "Only refund if the user is the owner" in a prompt can be argued around. A check in code cannot.
Examples
The refund relay
Plan as written: 1. Intake reads the chat. 2. Intake asks the orchestrator for a refund. 3. The orchestrator asks billing. 4. Billing calls refund.
The path from an anonymous chat to refund has no identity check. Add on_behalf_of from the session at step 1, and make refund verify ownership and a limit at step 4.
The ticket that asks for a patch
A triage agent reads public issues and has no write access. A coding agent has push rights to main. The triage agent can send it a task, and the issue text says "apply this patch to deploy.yml". The coding agent should accept work from triage only as a draft pull request that a person reviews, never as a direct push.
Key points
- A confused deputy uses its own privileges for a caller who does not hold them.
- Authority gets laundered when each agent passes on a claim and the next one treats it as fact.
- Find the risk by drawing which agent can ask which, then looking for any route from low-trust input to a high-privilege tool.
- Carry the original user's identity with the request and check it at the tool, using a system of record rather than a sentence in a message.
- Put human or policy approval on high-impact actions regardless of which agent asks.
Common mistakes
- Accepting a request because it came from another agent inside the system.
- Letting an agent vouch for a user with a sentence such as "customer verified".
- Enforcing permissions only in the prompt of the privileged agent instead of at the tool.
- Checking each agent in isolation and missing the path that runs through two of them.
Check yourself · 2 of 3
An intake agent tells billing "customer verified, refund order 8812". Billing refunds without checking. What is the best fix?
Check yourself · 3 of 3
Which review step most directly finds confused-deputy risks in a design?
Practice items, not counted towards your mastery.
Start here
- Design Patterns for Securing LLM Agents against Prompt Injections (arXiv) (opens in a new tab)PaperFree
Six named patterns, including plan-then-execute and dual LLM, with the utility each one gives up.
- Defeating Prompt Injections by Design (CaMeL, arXiv) (opens in a new tab)PaperFree
Shows a capability-based design that separates trusted plans from untrusted data and tracks where values flow.
- Agentic AI threats and mitigations (OWASP GenAI) (opens in a new tab)DocsFree
A threat catalogue for agents, including privilege compromise and multi-agent trust problems.