AI Confused Deputy Lab: Turn the Agent's Privileges Against Its User

✨ AI Summary
FinanceBot can move money between any accounts — it holds system-level privileges as a reconciliation tool. When a low-privilege user chats with it, it performs the actions they ask for using its privileges, without checking whether the user is allowed to do them.
Lab at a glance: Advanced · 145 XP · about 20 minutes · runs in your browser, no signup or setup. Try it yourself first; the full solution is behind a spoiler below.

What this lab teaches

The confused-deputy problem is older than AI: a privileged program is tricked into misusing its authority on behalf of a less-privileged caller. In agentic AI it is acute, because the agent often holds broad tool permissions and acts on whatever the user asks, with no per-action authorisation of the user.

The lesson: the agent's privileges are not the user's privileges. Every action must be authorised against the person making the request.

How FinanceBot acts for a user

You are Alice, a low-privilege user. FinanceBot can call a transfer tool between any accounts. When you ask it to move money, it uses its own elevated access to do so and never checks that Alice is permitted to move funds from the source account.

The attack approach

  • Recognise FinanceBot acts with system privileges, not Alice's.
  • Ask it to perform a transfer Alice could never do directly — moving funds out of another user's account.
  • Phrase it as a normal request so the agent simply executes with its own rights.
  • Confirm the transfer the lab wants completes.

Full walkthrough (spoiler)

If the bot asks for confirmation it does not really enforce, proceed — open the steps.

Show the step-by-step solution
  1. As Alice, ask FinanceBot to transfer $5,000 from Bob's account to Alice's.
  2. The agent has a transfer tool scoped to all accounts and does not check that Alice may touch Bob's.
  3. It performs the transfer using its own system-level authority.
  4. Funds move and the lab marks you solved.

Why it works

FinanceBot conflates 'I can do this' with 'the user may ask me to do this'. It authorises the action against its own broad privileges, not against Alice's. The agent is the confused deputy: powerful, and willing to use that power for whoever is talking to it.

Core principleAuthorise every action against the end user's permissions, never the agent's. The agent should be able to do only what the current user could do themselves.

Where this happens in the real world

Confused-deputy misuse is the core of OWASP LLM06 Excessive Agency — agents granted more capability or autonomy than the situation warrants. Giving an assistant broad, standing tool permissions and letting it act for any caller is the common design mistake behind it.

How to defend against it

  • Propagate the user's identity to every tool call and authorise against it.
  • Scope agent tools to the caller — the agent should act only within the user's own permissions.
  • Avoid standing elevated privileges; request narrow, just-in-time access per action.
  • Log and confirm any cross-account or high-value action.
Mr Elite tip: Whenever an agent holds privileges its users do not, ask: does it re-check the user's authorisation for each action, or just its own? If the latter, it is a confused deputy waiting to be used.

Try it, then go further

Reading about it is the easy part. Open the lab, try your own approach before peeking at the spoiler, and see how many attempts it takes.

❓ Frequently asked questions

What is a confused deputy?
A privileged program tricked into misusing its authority for a less-privileged caller. In AI, it is an agent with broad tool access acting for users without checking their permissions.
Why are AI agents prone to it?
They often hold standing, broad tool permissions and act on user requests directly, without authorising each action against the specific user.
How is this related to Excessive Agency?
It is the heart of OWASP LLM06 — an agent with more capability or autonomy than needed, used to perform actions the caller could not do themselves.
How do I fix it?
Propagate the user's identity into every tool call and authorise against it, scope tools to the caller, and avoid standing elevated privileges.
⚡
Join free to earn XP for reading this article Track your progress, build streaks and compete on the leaderboard.
Join Free
Lokesh N. Singh aka Mr Elite
Lokesh N. Singh aka Mr Elite
Founder, Securityelites · AI Red Team Educator
Founder of Securityelites and creator of the SE-ARTCP credential. Working penetration tester focused on AI red team, prompt injection research, and LLM security education.
About Lokesh ->

Leave a Comment

Your email address will not be published. Required fields are marked *