Lesson 1 of 4 Agent Boundaries, Communication and Memory Design

Scoping Tools, Permission Boundaries and Authentication

This lesson explains how to scope tools, bound the permissions behind them and choose an authentication method for each tool, since tools are the means by which agents read data and change the world and therefore the main security boundary of an agent system.

Learning outcomes

After completing this lesson, you will be able to:

  • Design narrow tool scopes.
  • Set permission boundaries with Azure RBAC at the narrowest scope.
  • Choose an authentication method by asking whose permissions should apply.

Scoping tools

A tool scope defines exactly what a tool can do. Narrow tools such as get_order_status(order_id) or create_return(order_id, reason) expose only the operations an agent needs, validate their inputs and return only the needed fields. General tools such as run_sql(query) or http_request(url) let a mistaken or manipulated agent do almost anything the underlying credentials allow, so they are avoided in production or wrapped with strict allow-lists.

Read and write operations are separated into different tools, and often into different agents, so that an agent that reads untrusted content (emails, web pages, uploaded files) has no write tools. This limits the damage of indirect prompt injection.

Sort into groups

Narrow or general tool?

Exam skills 1.1.4

Decide whether each tool is narrowly scoped or a general tool to avoid in production.

Log in to try this activity Interactive activities are free with an account.

Permission boundaries

The permission boundary is what the identity behind a tool can reach. It is set with Azure RBAC role assignments at the narrowest scope (a single storage container, a single search index, a single Key Vault secret) or with API permissions in Microsoft Entra ID. Tool code can add finer checks, such as verifying that the order belongs to the authenticated customer. The effective permission of an agent is the intersection of the tools it has and what each tool's identity can do.

True or false

What an agent can really do

Exam skills 1.1.4

Check how tools and identities combine into an agent's effective permission.

Log in to try this activity Interactive activities are free with an account.

Choosing an authentication method

The authentication method follows one question: whose permissions should apply? The following list summarizes the options; module 15 covers the flows in detail.

  • Managed identity or agent identity: the tool acts as the agent, for background work or shared data.
  • On-behalf-of (OBO): the tool acts as the signed-in user, so the downstream system enforces the user's permissions.
  • OAuth 2.0 with user consent: third-party SaaS tools that hold per-user data.
  • API key: only when nothing else is supported; stored in Key Vault or a Foundry connection and rotated.

Foundry Agent Service tools use connections that hold the authentication configuration, so credentials never appear in agent instructions or code.

Sort into groups

Whose permissions should apply?

Exam skills 1.1.4

Choose the authentication method for each tool.

Log in to try this activity Interactive activities are free with an account.
Worked example

An HR assistant

An HR assistant answers employees' questions about their own leave balance and payslips, and HR staff can ask about their team. The HR system's API supports Microsoft Entra ID delegated permissions and already enforces who may see which records.

The tools should call the HR API with the on-behalf-of flow, so that the HR system applies each user's own permissions. A managed identity with read access to all records would force the agent to reimplement the permission logic and would expose every record if the agent were manipulated. The tools are read-only and scoped to leave and payslip operations.

Check yourself

Why should an agent that reads untrusted content not hold write tools?

Show answer

Untrusted content can contain injected instructions. Without write tools, a successful injection cannot change data or take actions.

Exam Tips

Remember for the exam

  • Narrow tools with validated inputs; avoid general SQL or HTTP tools.
  • Agents that read untrusted content should not hold write tools.
  • Whose permissions apply decides the authentication method.