AI and Agent Defense
Enable External Threat Detection for Copilot Studio Agents
Register an Entra ID app with federated identity credentials, connect Copilot Studio agents to an external threat detection provider without secrets, and validate runtime protection in the Power Platform admin center.
Where it fits: lab 1 of 3
Defend AI and agents against attack. Protect Copilot Studio agents at runtime, understand and block prompt injection and harden the whole agentic estate.
- Enable External Threat Detection for Copilot Studio Agents 60 min
- Prompt Injection: End-to-End Concept and Live Demo 120 min
- Agentic Security Lab: Assess, Harden, Prove and Operate 4.5 h
What this lab covers
Copilot Studio custom agents include built-in protection against prompt injection attacks (both user-initiated and cross-domain). To further harden agents, organizations can configure external threat detection systems that monitor agent activity at runtime. These systems evaluate every tool invocation before execution and can block suspicious actions in real time. In this lab you will register a Microsoft Entra ID application, configure Federated Identity Credentials (FIC) for secretless authentication between Copilot Studio and your security provider, set up the threat detection integration in Power Platform admin center, and validate the end-to-end flow.
The enterprise scenario
A financial services company has deployed multiple Copilot Studio agents across departments - customer service, internal IT help desk, and compliance. Each agent invokes tools that access sensitive data: customer records, internal policies, and regulatory documents. Without external threat detection, a sophisticated prompt injection could manipulate an agent into exfiltrating data through a tool call. By integrating Microsoft Defender (or a third-party security provider) as an external threat detection system, the organization gains real-time evaluation of every tool invocation. Suspicious requests are blocked before execution, security incidents are logged for audit, and the SOC team receives alerts - all without disrupting legitimate agent interactions.
What you will learn
- Understand how Copilot Studio external threat detection works at runtime
- Register a Microsoft Entra ID application for the secure connection
- Base64-encode your tenant ID and threat detection endpoint URL
- Configure Federated Identity Credentials (FIC) for secretless authentication
- Construct the FIC subject string with the correct format
- Configure the threat detection system in Power Platform admin center
- Set error behavior policies (allow vs. block on timeout)
- Validate the end-to-end integration
Before you start
- Microsoft Entra ID tenant with permission to create application registrations
- Power Platform environment with at least one Copilot Studio custom agent deployed (generative orchestration required - classic agents are not supported)
- Power Platform Administrator role to configure threat detection at the environment or environment group level
- External threat detection service with a REST API endpoint - either Microsoft Defender, a third-party provider, or a custom-built service
- Base URL (endpoint) of the threat detection web service - provided by your security provider
- Windows PowerShell 5.1+ or PowerShell 7+ (for the automation script)
- Azure CLI ( az ) installed - required by the automation script ( install guide )
- Microsoft Graph PowerShell SDK ( Microsoft.Graph module) - only needed if you follow the manual PowerShell alternatives in the steps below
The 10 steps
- Gather Required Information
- Register the Microsoft Entra Application
- Base64 Encode the Tenant ID and Endpoint URL
- Construct the FIC Subject String
- Configure Federated Identity Credentials
- Authorize with Your Security Provider
- Configure Threat Detection in Power Platform Admin Center
- Validate the Integration
- Troubleshoot Common Issues
- Disconnect and Clean Up