Lesson 4 of 4 Securing Microsoft Copilot and AI Data

Enabling Real-Time Protection for Copilot Studio Agents

This lesson explains how tool calls are evaluated, and how to set protection up across two portals.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain when real-time protection acts.
  • Describe the division of work between administrators.
  • Explain the one-second default.
  • Describe how blocks are monitored.

Protecting the moment of action

A Copilot Studio agent with generative orchestration decides by itself which tools to use. If an attacker tricks the agent, the dangerous moment comes when the agent acts, for instance by sending data to an outside address. Real-time protection places a check at that moment. Each time the orchestrator considers invoking a tool, it sends the relevant data to a threat detection system, which returns a decision to allow or block.

If the call is blocked, the agent stops processing and notifies the user that the message was blocked. Protection applies only to agents that use generative orchestration, and it does not apply to classic agents, which follow fixed topics. Microsoft documents the Copilot Studio feature as external threat detection in preview, and Defender's coverage of Copilot Studio tool invocations is also marked as preview.

How the integration works

The design joins two administrative worlds, and this is the point on which scenarios focus. Microsoft Defender provides the detection, and a Power Platform administrator connects each environment to it. Authentication between the two relies on a Microsoft Entra application with a federated identity credential, so no secret is stored.

The prerequisites are that security for AI agents is enabled, including the Microsoft 365 app connector, that Copilot Studio is connected, that the organization is onboarded to Microsoft Agent 365, and that an administrator with at least the Security Administrator role works with a Power Platform administrator. The Microsoft 365 connector needs the components Microsoft Entra ID Management events and Microsoft 365 activities. If it is missing, Copilot Studio blocks still happen, but alerts do not appear in Defender.

Setting it up

The following sequence shows the division of work.

  1. Turn it on in Defender

    In the Defender portal, open Settings > Security for AI > Get started, select the Copilot Studio step, and turn on Real-time protection.

  2. Copy the endpoint

    Copy the URL under Enable Power Platform Integration, and pass it to the Power Platform administrator.

  3. Create the application

    Create a single-tenant Microsoft Entra application and a federated credential, either with the script Create-CopilotWebhookApp.ps1 or by hand.

  4. Connect the environment

    In the Power Platform admin center, open Security > Threat detection > Additional threat detection, select the environment, and supply the App ID and endpoint.

  5. Set the error behaviour

    Choose Allow the agent to respond or Block the query.

  6. Finish in Defender

    Enter the App ID, and confirm that the status changes from Not connected to Connected.

There is no tenant-wide switch for this: the setting is per environment, so each environment that hosts agents needs to be connected. A newly created environment is not automatically protected, so include this step in environment governance. To disable protection, clear the setting that allows Copilot Studio to share data with the provider.

Put in order

Connecting real-time protection

Exam skills 3.1.3

Put the steps of connecting real-time protection in order.

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

Timing and error behaviour

The check happens in the path of a live conversation, so it has to be fast. If the agent does not receive a decision within one second, it proceeds and allows the tool call by default. This is a fail-open default that favours availability. The error behaviour setting handles failures of the integration: Allow the agent to respond is the default, whereas Block the query favours security over availability.

Choosing the error behaviour

A high-risk agent that can reach sensitive systems is a candidate for Block the query, accepting that an outage of the detection service would stop the agent. A low-risk information agent can keep the default.

True or false

Timing and coverage

Exam skills 3.1.3

Check how real-time protection behaves.

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

Rules and monitoring

By default, a rule audits all agents. Custom rules, under Settings > Security for AI > Policies & rules > Real-time protection, can block selected detection types, such as malicious content propagation, secret exfiltration, evasion techniques and unsafe email domains. A sensible rollout begins in audit, reviews what would be blocked, and moves to blocking for the most serious types.

Blocks and audit events are recorded in the BehaviorInfo table in advanced hunting, and they appear as alerts in Defender when the connector is configured. Analysts can correlate them with the agent inventory and the user involved.

Scenario questions

Rules and alerts

Exam skills 3.1.3

Apply the rules and monitoring for real-time protection.

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

Missing alerts

An administrator enabled real-time protection, and a Power Platform administrator connected the production environment. A test prompt is correctly blocked by the agent, but no alert appears in Defender. A second environment created last week has no protection. What should you do?

A block that produces no alert points to the Microsoft 365 app connector, which needs Microsoft Entra ID Management events and Microsoft 365 activities. Blocks work without it, but alerts do not appear. For the second environment, a Power Platform administrator must connect it, since threat detection is set per environment.

Changing the error behaviour would affect what happens when the check fails, which is not the problem here. Turning on a tenant-wide setting is not possible, as none exists. A Conditional Access policy would not create an alert in this flow.

Check yourself

Does real-time protection cover classic agents that use fixed topics?

Show answer

No. It applies to agents with generative orchestration, which decide on tools themselves.

Exam Tips

Remember for the exam

  • The check runs at each tool invocation, for generative orchestration agents only.
  • Setup needs a Security Administrator and a Power Platform administrator.
  • Threat detection is per environment.
  • By default the agent proceeds after one second with no decision.