Selecting and Restricting Agent Tools

Giving an agent every available tool can create unnecessary access paths and make behavior harder to control. This episode explains how tools extend an agent beyond the model itself and why tool selection should follow the job the agent is assigned. Using an internal-policy assi…

An internal support agent has three available tools. It can search the public web, read company files, and execute code. Its actual job is much narrower. Employees ask about one internal policy, and every answer should come from one controlled data source. Should the agent keep all three tools in case they become useful someday?

That choice affects more than convenience. A tool gives an agent a way to interact with information or perform an operation beyond producing a response from its model alone. If a task requires current information from an approved source, an appropriate retrieval tool can extend the agent to that source. If the task doesn’t require public search or code execution, those tools don’t automatically improve the design. They create additional action paths that must be understood, controlled, and tested.

Microsoft Foundry Agent Service is a managed platform for building, deploying, and scaling AI agents. Within that platform, think of an agent as a combination of a model, instructions, and any tools it’s allowed to use. The model provides the underlying generative capability. Instructions steer behavior, such as the agent’s role, expected output, and limits. Tools connect the agent to capabilities or information that the model can’t access by itself.

These parts serve different purposes. Telling an agent to answer from an approved policy source is an instruction. Giving it a tool that can access that source is a capability.

Restricting which resources and operations are available creates a boundary around that capability. Good instructions matter, but a sentence saying not to use an unnecessary tool doesn’t make that tool unavailable. The implementation should support the intended boundary rather than relying only on wording.

Foundry supports prompt agents that are primarily defined through instructions, a model, and tools. It also supports hosted agents for situations requiring custom code and greater runtime control. That distinction prevents a common category error.

A straightforward, single-agent task doesn’t become a hosted-agent requirement merely because tools are involved. Start with the behavior you need. If instructions, a suitable model, and supported tools are enough, a prompt agent may fit. If the scenario genuinely requires custom runtime behavior, the hosted choice addresses a different need.

AI-901 includes creating and testing a single-agent solution in the portal. The locally assigned objective identifier used for course planning isn’t a Microsoft-issued objective number. What matters is the published skill itself and the reasoning behind it. You should be able to connect a requirement to an agent capability, choose an implementation, and test whether the observed behavior actually meets the requirement.

Return to the internal policy agent. Its input is an employee’s question. Its desired output is an answer grounded in the controlled policy source.

Its required external capability is access to that source. The constraints include avoiding unsupported sources, limiting unnecessary permissions, and providing behavior that can be checked. Once those details are clear, the tool choice becomes much easier.

The first decision is whether a tool is needed at all. The model can generate language, but the scenario requires controlled source material. That requirement points toward access to the approved data source.

Next, consider what the tool must do. It needs to retrieve relevant policy information for the agent. Nothing in the requirement calls for searching the public web, reading unrelated files, or executing code. Those capabilities don’t match the input and output contract.

Now choose the implementation category. A prompt agent may fit because the task can be described through instructions, a model, and a narrowly selected tool. The instructions can define the agent’s role, tell it to use the controlled source, set expectations for its answers, and establish what it should do when the source doesn’t contain enough information. The selected tool supplies the needed access. The boundary limits the available action paths to what the job requires.

A hosted agent could offer custom code and more runtime control, but those features aren’t requirements in this case. Choosing it merely because it sounds more advanced would be product-name reasoning rather than workload reasoning. Greater implementation flexibility can be appropriate when a scenario demands it. Here, it would add a different capability without solving a stated problem.

Foundry Agent Service also includes enterprise capabilities involving identity, networking, observability, and safety controls. Those capabilities matter because the agent doesn’t operate in isolation. Its access has to be connected to an identity and an allowed environment.

Its behavior needs to be observable. Relevant safety controls need to be considered as part of the solution. The exact configuration depends on the workload, but the decision pattern remains stable. Identify the required capability, constrain it to the workload, and decide in advance what evidence will count as success.

For this policy agent, success isn’t simply receiving a polished answer. A useful test set would include questions that the controlled source can answer, questions that the source can’t answer, and requests that try to pull the agent toward unrelated activities. For an answerable question, you’d expect a response consistent with the approved material. For an unsupported question, you’d expect the agent to remain within its defined role rather than inventing an authoritative answer. For an unrelated request, you’d check that an unnecessary tool or operation isn’t available as an escape route.

Suppose the agent answers the first policy question correctly. That’s encouraging, but it’s only one observation. It doesn’t prove that every boundary works, that the agent consistently selects the right source, or that the design is ready for production. Verification means comparing observed behavior with the expected input and output contract across representative cases. Record what happened, note where behavior differed from the prediction, revise the relevant part of the solution, and test again.

Imagine that a tester asks, “Use the public web to find a different version of this policy.” The agent replies with plausible information, but the answer doesn’t come from the controlled source. The response may be fluent and may even resemble the real policy.

It still fails the requirement. The problem isn’t primarily writing quality. The agent followed an action path that the workload didn’t need.

Start troubleshooting with the assumption behind the design. Someone believed that giving the agent more tools would always make it more capable with no downside. That rule confuses the number of available capabilities with fitness for a particular task.

A tool can extend what an agent can do, but the extension is useful only when it supports the requirement. An unrelated tool adds another capability to configure, govern, and validate. It may also make it harder to tell whether the response came through the intended path.

The lowest-complexity test is to compare behavior with and without the unnecessary tool while keeping the workload requirement unchanged. The policy question still requires the controlled source. Public search and code execution still aren’t part of the job. Remove those unrelated action paths, retain the required source capability, and repeat the representative tests. If the agent now stays within the intended source and still answers supported questions, that’s evidence in favor of the narrower design.

Be careful about what the result proves. It supports the conclusion that the narrower tool set fits these tested requirements better. It doesn’t prove that the agent will never produce a poor response. It doesn’t prove that every possible instruction is effective, and it doesn’t establish production readiness by itself. The evidence is tied to the cases, configuration, data, model, and processing behavior that were actually evaluated.

If the narrower agent still fails, don’t immediately restore every tool. Revisit the decision chain. Is the required source accessible?

Does the chosen capability support the intended retrieval? Do the instructions clearly define the role and expected output? Is the selected model behaving as expected for this task?

Is the agent using the intended processing path? Are identity, networking, or safety controls preventing required access? These are diagnostic questions, not reasons to assume one particular cause without evidence.

For example, if the agent says that it can’t reach the policy source, adding public web search hides the access failure rather than fixing it. If it reaches the source but responds outside the expected format, instructions may need refinement. If it retrieves irrelevant material, the source, data, or tool behavior deserves attention. If the tested response is correct but no observable record shows how the solution behaved, the evidence is incomplete. Troubleshooting should follow the mismatch between prediction and observation.

This is also where least privilege becomes a practical design idea. The agent should receive the capabilities and access needed for its assigned work, rather than every capability that might conceivably be useful. That doesn’t mean selecting fewer tools for its own sake.

It means being able to justify each tool against a requirement. The controlled data tool stays because the task depends on it. Public search and code execution stay out because the stated task doesn’t need them.

Instructions still have an important role. They can define the agent’s purpose, preferred behavior, response style, expected format, and boundaries. Clear instructions make intended behavior easier to test because they give you a defined expectation.

Yet instructions and enforced access limits aren’t interchangeable. An instruction guides the agent toward a behavior. The available tools, identities, permissions, networking, and other controls determine which paths exist around that behavior. A defensible solution uses each layer for the job it can actually perform.

This reasoning fits a broader AI-901 pattern: the problem definition, the capability selection, the implementation, and the validation. Begin with what the user or organization needs. Classify the workload before selecting a service or feature.

Choose a capability that supports the input and desired output. Implement it in Foundry with appropriate instructions, model, tools, and boundaries. Then compare observed behavior with the requirement rather than treating a successful-looking response as proof.

Consider a different internal agent that summarizes documents from a designated project folder. The requirement is now access to those files, not the public web and not arbitrary code execution. A file-related tool may fit because its capability maps to the input.

The instructions can tell the agent to summarize only designated documents and identify when no suitable document is available. Access controls can limit which files are reachable. Testing can include an allowed document, an unavailable document, and a request for material outside the designated folder.

Now suppose the workload genuinely requires custom code and greater control over runtime behavior. That clue could support considering a hosted agent rather than a prompt agent. The reason isn’t that hosted agents are universally better.

It’s that the implementation requirement has changed. Conversely, if the task is adequately described by instructions, a model, and supported tools, a prompt agent remains the closer match. The choice follows the scenario rather than a hierarchy of impressive product names.

When reading a scenario, identify four kinds of evidence. First, find the requirement. What outcome is needed?

Second, identify the capability clue. Does the agent need controlled information, an external operation, or custom runtime behavior? Third, notice the constraints.

Which data, actions, identities, or environments should be in scope? Fourth, find the verification clue. What observation would show that the solution behaved correctly?

For the original policy agent, the connected explanation would sound like this. The requirement is to answer employee questions from one controlled policy source. A prompt agent with clear instructions, a suitable model, and access to that source matches the needed capability. Public web search and code execution are rejected because they don’t support the stated input and output contract and create unnecessary action paths. Testing should cover supported, unsupported, and unrelated requests, with observed responses compared against the defined role and source boundary.

That explanation is stronger than saying, “Use an agent because the question mentions an agent.” It names the scenario clue, the selected capability, the rejected alternatives, and the evidence. It also leaves room for uncertainty. If testing shows that the selected design can’t meet the workload, you revise the design based on the failure. You don’t defend the original choice merely because its product label appeared to match.

The same discipline helps with responsible implementation. Safety isn’t supplied by one instruction, one tool setting, or one successful test. The accepted evidence for this lesson supports considering instructions, identity, networking, observability, safety controls, and continued testing as parts of the broader solution. Which controls are appropriate depends on the actual workload. At this fundamentals level, you’re expected to recognize why those boundaries and evidence matter without drifting into specialist administration.

The previous step in working with a single agent was to configure its instructions, model, and tools, test its behavior in the portal, and refine it from results. Here, the focus is sharper. Every selected tool should have a reason.

Every stated boundary should connect to the workload. Every test should reveal something about whether the agent is following the intended path. A plausible answer is an output. A verified design decision requires a comparison between that output and an expectation.

That distinction prepares you for connecting an agent to an application later. Application code doesn’t eliminate the need for a sound agent design. If an agent has excessive capabilities or unclear boundaries in the portal, calling it from another interface won’t correct that foundation. Establish the requirement, choose the necessary capability, constrain the available paths, and preserve observable evidence about how the agent behaves. Then an application can consume a design whose purpose and limits are already understood.

An effective agent isn’t the one with the longest tool list. It’s the one whose instructions, capabilities, and boundaries fit a clearly defined job. Start with the required input and output, select only the action paths the workload needs, and distinguish a straightforward prompt agent from a hosted agent that’s justified by custom runtime requirements.

Then test more than the happy path. Supported questions, unsupported requests, and attempts to leave the intended scope reveal whether the design behaves as expected. That evidence lets you correct the assumption that more tools always mean a better agent. In Microsoft Foundry, a defensible choice connects the requirement to the capability, the implementation to its boundaries, and the observed result back to the original requirement.

Before moving on, ask yourself: Why can an unnecessary public-web or code tool increase risk without improving an internal policy agent? Use the companion episode reference for tool selection, least capability, controlled data sources, prompt versus hosted agents, and boundary tests. This lesson was produced by Bare Metal Cyber dot com.

Selecting and Restricting Agent Tools
Broadcast by