Building and customizing solutions using Microsoft 365 Copilot APIs and tools
There is no single documented API that returns a normalized violation record—agent, category, severity, detection time, environment/project, and remediation status—across both Copilot Studio and Microsoft Foundry; use Agent 365/Graph for identity and inventory, then correlate Defender, Copilot Studio governance, Power Platform, Foundry, and Purview records by agent identifiers.
Recommended architecture
| Requirement | Primary source | What it provides |
|---|---|---|
| Cross-platform agent inventory | Agent 365 Registry through Microsoft Graph | Tenant-wide agent list and detailed metadata |
| Security posture, risky tools, configuration, authentication/access | Defender AgentsInfo and related Advanced Hunting tables |
Agent configuration, identities, permissions, tools, risk indicators, recommendations, alerts |
| Copilot Studio governance cases | Copilot Agent Kit Compliance Hub in Dataverse | Violation threshold, risk level, SLA, enforcement action, remediation lifecycle |
| Copilot Studio environment/connectors | Power Platform Inventory API or Admins V2 connector | Environment-specific inventory and connector usage |
| Copilot Studio DLP failures | Copilot Studio policy diagnostics and Compliance Hub | DLP violation type and blocked connector information |
| Foundry project configuration | Foundry REST APIs and Foundry monitoring | Agent definitions, project scope, alerts, health, activity |
| Runtime security detections | Defender incidents, alerts, behaviors, and observability | Suspicious activity, tool invocation investigations, timestamps and severity |
| Data compliance and audit | Microsoft Purview | Audit, DLP, data security, and compliance signals |
1. Build the authoritative inventory with Agent 365 and Graph
Agent 365 is the cross-platform control plane. Its registry includes Copilot Studio and Foundry agents; published Foundry agents synchronize into the registry, while Copilot Studio agents register automatically.^1^ ^2^
Use these Microsoft Graph endpoints:
GET https://graph.microsoft.com/v1.0/copilot/admin/catalog/packages
Authorization: Bearer {token}
GET https://graph.microsoft.com/v1.0/copilot/admin/catalog/packages/{id}
Authorization: Bearer {token}
The APIs require an Agent 365 license and CopilotPackages.Read.All for delegated or application access. Administrative use requires AI Administrator or Global Administrator.^3^ ^4^
Treat Graph as the inventory and metadata API, not as the complete violation feed. Also note that the package-list API does not return Power Platform connectors.^5^
2. Use Defender Advanced Hunting as the closest unified security query layer
After enabling Defender security for AI agents and its Microsoft 365 connector, Defender covers agents from Copilot Studio, Foundry, Microsoft 365, supported external platforms, and endpoint discovery. The portal path is Microsoft Defender → Assets → AI agents.^6^
For programmatic analysis, query AgentsInfo:
AgentsInfo
| summarize arg_max(Timestamp, *) by AgentId
| where LifecycleStatus != "Deleted"
| project Timestamp, AgentId, AgentName, Platform,
EntraAgentId, PublishedStatus, LifecycleStatus,
ToolsAuthenticationType, Permissions,
DeclaredTools, McpServers, Guardrails, Endpoints
AgentsInfo supplies the common identifiers and security-relevant properties needed to correlate platforms: AgentId, SourceAgentId, EntraAgentId, Platform, authentication model, permissions, tools, MCP servers, owners, status, and timestamps.^7^
It does not by itself represent every row as a violation. Correlate it with:
-
AlertInfoandAlertEvidencefor detection category, severity, timestamp, and affected entity. -
BehaviorInfoandBehaviorEntitiesfor suspicious or blocked behavior. - Defender security recommendations and active risk indicators for configuration and exposure findings.
Defender can correlate Agent 365 observability data with alerts and behaviors, including tool invocations and anomalous execution patterns.^8^
3. Add Copilot Studio governance and remediation state
For policy-defined Copilot Studio violations, deploy Copilot Agent Kit Agent Inventory, followed by Compliance Hub. Compliance Hub writes findings to Dataverse:
-
Agent Details: agent and environment metadata -
Threshold Config: violated attribute/value and assigned risk -
Compliance Case: case lifecycle, SLA, and remediation state -
Action Policy: manual, quarantine, or delete enforcement
Scans normally run daily and create or update compliance cases. Administrators can also select Run Compliance Scan from the Compliance Hub dashboard.^9^
The Agent Details table includes the Copilot Studio agent ID, name, environment name, and environment ID, which should be retained in the correlation model.^10^
For broader Copilot Studio inventory and connector discovery, use the Power Platform Inventory API or Power Platform for Admins V2 → Query Power Platform resources. This interface currently requires delegated-user authentication; service principals and managed identities receive HTTP 403.^11^
DLP publishing errors can expose raw JSON containing fields such as violationType and errorDescription, including BlockedConnector; this is a product diagnostic rather than a documented tenant-wide unified violations API.^12^
4. Add Foundry-specific project and operational data
Use the Foundry REST API for the native agent definition, project endpoint, metadata, and RAI configuration.^13^ Use Foundry → Operate → Assets → Agents for project/subscription monitoring; individual agent details expose policy, security, and evaluation alerts by severity, plus health and activity.^14^
Foundry activity reaches Agent 365 only after licensing, tenant activation/terms acceptance, and applicable telemetry configuration. Hosted-agent telemetry requires explicit SDK configuration and Entra permissions.^1^
Normalized reporting model
Store the joined results in Sentinel, Log Analytics, a data lake, or another reporting store with fields such as:
-
AgentId,SourceAgentId,EntraAgentId -
Platform,EnvironmentId,FoundryProject -
FindingSource -
Category,Severity,DetectedDateTime -
ToolOrPermission -
CaseOrAlertId -
RemediationStatus,SlaDueDate,EnforcementAction
Use EntraAgentId where available, then platform-native IDs as fallback correlation keys. “Remediation status” must come from the owning system—Compliance Hub case state, Defender recommendation/incident state, or the relevant Foundry alert—not from one universal Agent 365 field.
References
- Microsoft Agent 365 integration with Foundry
- Agent registry integration for Copilot Studio
- Graph API for agent registry and agent details
- Get Copilot package details (graph-v1)
- List packages (graph-v1)
- Discover AI agents and assess security posture using Microsoft Defender
- AgentsInfo
- Detect and investigate threats to AI agents using Microsoft Defender (Preview)
- Set up and configure Copilot Agent Kit Compliance Hub
- Agent Inventory data source
- Power Platform inventory
- Troubleshoot data policy enforcement for Copilot Studio
- Microsoft Foundry
- Monitor agent health and performance across your fleet