---
title: "Discussion on \"AI Agents Are Confused Deputies: Designing and Testing the Authority Layer\" | Hashnode"
description: "Discussion on \"AI Agents Are Confused Deputies: Designing and Testing the Authority Layer\". Learn how AI agent authority layers prevent confused deputy risks and how red teaming tests permissions, tool access, and authorization boundaries."
url: "https://hashnode.com/posts/ai-agents-are-confused-deputies-designing-and-testing-the-authority-layer/6ab6268ec66464296c899f56"
---

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

Discussion

# [AI Agents Are Confused Deputies: Designing and Testing the Authority Layer](https://aiqa.hashnode.dev/ai-agents-are-confused-deputies-designing-and-testing-the-authority-layer?utm_source=hashnode&utm_medium=feed)

Learn how AI agent authority layers prevent confused deputy risks and how red teaming tests permissions, tool access, and authorization boundaries.

Sep 25 · 4 min read · aiqa.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#security](https://hashnode.com/tag/security)
-   [#llm](https://hashnode.com/tag/llm)
-   [#architecture](https://hashnode.com/tag/architecture)
-   [#agents](https://hashnode.com/tag/agents)
-   [#agentic-ai](https://hashnode.com/tag/agentic-ai)

## Written by

[Sanath](https://hashnode.com/@sbhat1)

@sbhat1

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

## Responses 3

Markdown supported · ⌘↵ to post

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

[Oct 29](https://hashnode.com/posts/ai-agents-are-confused-deputies-designing-and-testing-the-authority-layer/6ab6268ec66464296c899f56/comment/6ae32ab324b8c2a1530f6640)

Don't try to make the model unconfusable—limit what the deputy can sign. Test the tool gateway with the exact malicious calls, model out of the loop; that should be CI, not a vibe check. "Agent attempted, layer blocked" is a pass for architecture, not a fail for the model.

[Mateo Ruiz](https://hashnode.com/@mateoruiz)

[Sep 25](https://hashnode.com/posts/ai-agents-are-confused-deputies-designing-and-testing-the-authority-layer/6ab6268ec66464296c899f56/comment/6ab629e498c69e12733d275e)

The strongest point here is separating “can the agent be manipulated?” from “can that manipulation actually cross an authority boundary?” That distinction makes the security model much easier to reason about. A model will eventually produce a bad tool call; the important invariant is that the call remains unauthorized regardless of how it was generated.

In production agentic systems at IT Path Solutions, I’d also treat the tool gateway as a first-class security boundary, not just middleware. Every decision should leave an auditable trail of principal, requested action, resource, policy result, and resulting state change. That makes the authority layer testable independently and gives you something concrete to investigate when an agent behaves unexpectedly.

The CI-level direct-call tests are especially valuable because they verify the actual security invariant without depending on prompt behavior.

[Sanath](https://hashnode.com/@sbhat1)

[Sep 25](https://hashnode.com/posts/ai-agents-are-confused-deputies-designing-and-testing-the-authority-layer/6ab6268ec66464296c899f56/comment/6ab629e498c69e12733d275e#reply-6ab63a986b2994ea22b1a82a)

Exactly. The tool gateway is where the security invariant needs to hold, regardless of what the model decides upstream.

I especially like the point about testing it independently. Red teaming can expose how an agent reaches a dangerous action, while direct-call tests verify that the authority layer still blocks it. Both layers matter.
