Defining Rules and Constraints for AI Components
This lesson explains how to define and implement rules for Copilot Studio, Foundry and Foundry Tools components.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the categories of solution rules.
- Describe the controls that implement rules in Copilot Studio and Foundry.
- Recognize platform constraints that shape a design.
Rules the architect defines
Solution rules express the business's decisions about an AI component's behaviour. They should be written down in the design and then implemented in the platform, so that testers can verify them. Typical rules cover scope (which subjects the agent addresses and which it declines), grounding (whether it may answer from general knowledge or only from approved sources), actions (which tools it may call and which need confirmation or approval), tone and disclosure (how it presents itself and that users know they are talking to AI), and escalation (when it must hand over to a person).
Rules belong in several places at once, because instructions alone are not a security boundary. An instruction such as never discuss salaries can be undermined by a clever prompt, whereas removing salary data from the agent's knowledge cannot.
Implementing rules in Copilot Studio
Copilot Studio provides several controls that implement rules. The agent's instructions describe purpose, scope, tone and the order of steps. The Allow ungrounded responses setting decides whether the agent may answer without a knowledge source or tool; when it is off, an answer without grounding is blocked and the Fallback topic runs. Use information from the web decides whether Bing grounding is allowed. Content moderation settings control how strictly harmful content is filtered. Tools can require user confirmation before they run, and topics can force deterministic paths for regulated steps.
At the environment and tenant level, administrators enforce rules with data policies in the Power Platform admin center. Data policies classify connectors as Business, Non-business or Blocked, can block HTTP requests, specific channels, knowledge from public websites, unauthenticated chat and event triggers, and apply to every agent in the environment. Because MCP tools rely on Power Platform connectors, blocking those connectors also blocks the MCP tools.
Implementing rules in Microsoft Foundry and Foundry Tools
In Microsoft Foundry, rules are implemented through the agent's instructions, the tools attached to it, and guardrails, which apply content filters and Prompt Shields at intervention points such as user input and model output, and for agents also at tool calls and tool responses (preview). Model deployments carry their own constraints: a deployment type such as Global Standard or Data Zone Standard decides where data is processed, and quotas limit tokens per minute. Foundry Tools, such as Language, Speech or Document Intelligence, have per-resource rate limits, supported regions and supported languages, which constrain where and how much they can be used.
The following table summarizes constraints that frequently decide exam questions.
| Constraint | Example | Design response |
|---|---|---|
| Knowledge limits | Copilot Studio generative mode allows 25 public websites and 25 SharePoint URLs | Consolidate content or use Azure AI Search |
| Regional availability | A Foundry Tool or Copilot feature is not offered in the required region | Choose another capability or region that meets residency |
| Throughput | Tokens per minute quota on a model deployment | Request quota, use another deployment type, or route with model router |
| Licensing and capacity | Copilot Credits consumed per action or step | Plan capacity and set limits per environment |
| Authentication | Event triggers authenticate only with the maker's account | Grant the connection narrow permissions and review it |
Implementing a no-advice rule
A pension provider builds a Copilot Studio agent for members. Regulation forbids the agent from giving personal financial advice. It may explain scheme rules from approved documents and must offer a call with an adviser when a member asks what they should do. How should the rules be implemented?
The design combines several controls. Instructions define the scope and state that the agent explains rules but does not recommend choices. Allow ungrounded responses is turned off and web search is disabled, so every answer must come from the approved scheme documents. A topic triggered by requests for recommendations offers a call with an adviser and hands over through the escalation path. Content moderation is set to a strict level. Testing then includes prompts that try to obtain advice, so that the rule is verified rather than assumed.
Why is an instruction such as never discuss salaries not sufficient on its own?
Show answer
Instructions are not a security boundary; a crafted prompt can undermine them. Removing salary data from the agent's knowledge and tools enforces the rule.
Exam Tips
Remember for the exam
- Write rules for scope, grounding, actions, tone and disclosure, and escalation.
- Instructions are not a security boundary; remove data or tools the agent must not use.
- Turning off Allow ungrounded responses makes ungrounded answers trigger the Fallback topic.
- Data policies apply connector, channel and trigger rules to every agent in an environment.