---
title: "Discussion on \"Who Is the Agent Acting As? Why AI Agents Become Confused Deputies\" | Hashnode"
description: "Discussion on \"Who Is the Agent Acting As? Why AI Agents Become Confused Deputies\". One injected line in a support ticket shows why an AI agent with a broad service account is a confused deputy, and where the auth check must live."
url: "https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://dvaddi.hashnode.dev/agent-authorization-confused-deputy?utm_source=hashnode&utm_medium=feed)

One injected line in a support ticket shows why an AI agent with a broad service account is a confused deputy, and where the auth check must live.

Oct 28 · 14 min read · dvaddi.hashnode.dev  
Read the article

-   [#ai-agents](https://hashnode.com/tag/ai-agents)
-   [#authorization](https://hashnode.com/tag/authorization)
-   [#security](https://hashnode.com/tag/security)
-   [#mcp](https://hashnode.com/tag/mcp)

## Written by

[dvaddi](https://hashnode.com/@dvaddi)

@dvaddi

  
[View profile](https://hashnode.com/@dvaddi)

## Responses 7

Markdown supported · ⌘↵ to post

[Elarigent](https://hashnode.com/@enterpriseaiagents)

[Oct 30](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae46b2a53d48cf489d8497d)

The Alice and Globex example makes the intersection picture concrete. Each set added can only shrink what a call may do, and a check in code the model cannot reach is a boundary, not a suggestion buried in a prompt.

[dvaddi](https://hashnode.com/@dvaddi)

[Nov 1](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae46b2a53d48cf489d8497d#reply-6ae788bad081b95454f05bb0)

Glad the Alice/Globex example landed that was the hardest part to make concrete. The “boundary, not a suggestion” framing is the whole point: anything the model can read, it can be talked out of, so the only sets that count are the ones enforced in code it never sees. Part 2 takes the intersection and puts tests and a mutation run behind it, so each guard has to prove it earns its keep.

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Oct 28](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357)

Filtering tools/list through the same decision means Alice's assistant never even sees tickets.globex, so a call naming it most likely came from text the model read, like that line in ticket #4521. I'd put calls to tools the agent was never shown on their own alert line, separate from the tenant-isolation deny. Do you log those separately today?

[dvaddi](https://hashnode.com/@dvaddi)

[Oct 28](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357#reply-6ae2078e77d5cbaa0c48b7d0)

Not today, and you’re right that it should be its own line. The event we emit carries the decision and the determining policy IDs; whether the tool was on the menu we sent that session isn’t a field. Cedar can’t supply it either: it sees entities, not what the client was shown.

The fix is gateway-side. When it answers tools/list for an on-behalf-of token it records the filtered set (and bumps a version on list\_changed). At call time it compares the tool name against that set and adds advertised: false to the event. That becomes an alert distinct from any forbid ID.

It also catches something the named-forbid alert misses. In the Bob replay in Part 2 (same tenant, no write grant) the deny comes back with “no policies applied”, so there’s no ID to alert on. An unadvertised-tool flag still fires there. The one caveat: a name the agent was never shown can also come from a stale name or a hallucination, so it’s a strong injection signal, not proof. Thanks, this goes into the production write-up.

[dvaddi](https://hashnode.com/@dvaddi)

[Nov 5](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357#reply-6aebedbc18d5d4efb9c52abe)

Done in Part 3: the gateway keeps the list it sent each session and records it again whenever it answers tools/list anew, and every decision event carries advertised, true or false, as its own field apart from the policy IDs, so advertised: false gets its own alert line. The crate’s test a\_tool\_dropped\_on\_list\_changed\_is\_no\_longer\_advertised covers the re-record. The write-up is in Part 3, under “What bites in production”.

[AI Developer](https://hashnode.com/@lycore)

[Oct 28](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae167c97260aaff727fb200)

The intersection model of user ∩ agent ∩ tenant is a clean framing, and I like that the request itself bounds scope (a summarize request yields read-only). One question: how would the gateway treat tool results that flow back into the context? Even with writes denied, a poisoned ticket could steer a later, legitimately in-scope call, so tagging retrieved content as untrusted and requiring a fresh scope check per call seems worth considering. Logging denied calls with the matching policy IDs also looks like a good injection-detection signal to alert on.

[dvaddi](https://hashnode.com/@dvaddi)

[Oct 28](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae167c97260aaff727fb200#reply-6ae1697d4ace2d609e0d67e8)

Thanks — Part 2 is largely about this. The gateway doesn’t tag content; it makes content irrelevant to scope. Every call carries the scope this hop holds (delegated\_read\_groups / delegated\_write\_groups in the context), the depth-0 scope is minted from the entrypoint or task type — a summarize request mints read-only — never from anything the model read, and a request-scope forbid runs on every call. So a poisoned ticket can’t widen scope on a later call; the “close every Acme ticket” variant is denied by that forbid even though no tenant line is crossed. Part 3 narrows the scope per hop as agents hand off.

What’s left is the honest limit: the gateway bounds authority, not influence. Injected text can still steer the model toward a call that’s already in scope — read a different ticket Alice may read — so marking retrieved content untrusted at the model layer is complementary, and I’d run both.

On logging: agreed. Cedar returns the determining policy IDs with every decision; the post’s replays show tenant-isolation and request-scope by name, and a deny with a named forbid is exactly the line to alert on. Default denies have no name, which is why anything you care about is a forbid.
