Lesson 1 of 3 Guardrails for Multi-Agent Solutions

Designing a Multi-Intervention Guardrail Strategy

This lesson explains Foundry guardrails and how to design a strategy that places controls at each point where harmful or manipulated content enters a multi-agent system, through users, documents and tools, or leaves it, through tool calls and responses.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how Foundry guardrails and controls are assigned.
  • Identify the four intervention points for agents.
  • Assign guardrails to agents according to their exposure.

Foundry guardrails and controls

In Microsoft Foundry, a guardrail is a named collection of controls that is assigned to model deployments and agents. Each control specifies a risk (harm categories such as hate, sexual, violence and self-harm with a severity threshold; user prompt attacks; indirect attacks; protected material for text and code; personally identifiable information; custom blocklists), the intervention points where it applies and an action (annotate, or annotate and block). A default guardrail applies to deployments that have no custom guardrail.

True or false

Guardrails and controls in Foundry

Exam skills 4.2.1

Check how Foundry guardrails are built from controls.

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

The four intervention points

Foundry guardrails for agents apply at four intervention points, which correspond to the four places where risk enters or leaves an agent.

Intervention pointWhat is checkedMain risks addressed
User inputMessages from the userJailbreaks, harmful requests
Tool call (preview)The tool the agent proposes to call and its argumentsData exfiltration, prohibited actions, harmful content sent to tools
Tool response (preview)Content returned by tools before it enters the agent's contextIndirect prompt injection, harmful content from external sources
OutputThe final response to the userHarmful content, protected material, sensitive data leakage

Checking only user input and output leaves the tool path unprotected, which is where indirect prompt injection arrives and where data can be sent out. A multi-intervention strategy enables controls at all four points, with thresholds appropriate to each.

The following diagram places the four intervention points.

The four guardrail intervention points for agents. User input is checked for jailbreaks and harmful requests. The tool call point checks the tool the agent proposes and its arguments, stopping data exfiltration and prohibited actions. The tool response point checks content returned by tools before it enters the context, stopping indirect prompt injection. Output is checked before it reaches the user. Checking only input and output leaves the tool path unprotected.
Protect the tool path as well as input and output.
Sort into groups

Which intervention point catches it?

Exam skills 4.2.1

Choose the intervention point where each risk is best caught.

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

Applying the strategy across agents

Agents in a team face different risks, so each receives a guardrail suited to its exposure. Agents that read external content (web, email, uploaded files) need strict indirect attack detection on tool responses. Agents with write tools need tool call checks and approval gates. Customer-facing agents need strict output controls and PII protection. Internal agents that only exchange structured data with other agents may need fewer content controls but still need validation. Guardrails are complemented by enforced limits in tools and middleware, because classifiers detect categories of content, not business rules.

Match the pairs

Guardrails by agent exposure

Exam skills 4.2.1

Match each kind of agent with the guardrail emphasis it needs most.

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

A browsing agent

A research agent browses supplier websites and passes findings to a purchasing agent that can place orders. Security testing shows that hidden text on a web page can make the purchasing agent order from an attacker's supplier.

Enable indirect attack detection at the tool response point for the research agent, so injected instructions are blocked before they enter its context; apply tool call checks and an approval requirement on the purchasing agent's order tool; and have the order tool validate the supplier against an approved list. Output filtering alone would act too late, after the order was placed.

Check yourself

At which intervention point does indirect prompt injection usually arrive, and where does data exfiltration leave?

Show answer

Injection arrives in tool responses, and exfiltration leaves through tool calls.

Exam Tips

Remember for the exam

  • Four points: user input, tool call (preview), tool response (preview), output.
  • Indirect injection arrives at tool responses; exfiltration leaves through tool calls.
  • Tailor guardrails per agent; combine with enforced limits in tools.