---
title: "Comment by Kartik N V J K on \"Who Is the Agent Acting As? Why AI Agents Become Confused Deputies\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357"
---

[Discussion](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)

Comment [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)

[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”.
