A Dataverse plug-in that controls whether makers can create Copilot Studio agents in an environment. It can independently block:
- Standard Harness agents
- GitHub Copilot Harness agents, identified by a
bot.templatevalue beginning withcliagent
The plug-in runs synchronously during PreValidation of Create on the bot table, so blocked agents are rejected before they are created.
Important
Disclaimer: Although I work at Microsoft, this asset was created by me in a personal capacity and is not an official Microsoft product or supported Microsoft solution. Microsoft does not provide support for it. Treat this asset as a temporary workaround, evaluate it carefully for your environment, and replace it with a supported solution when one becomes available.
Warning
This plug-in only blocks agents created interactively (for example, manually in Copilot Studio). By default, agents that arrive through a solution import — including Microsoft first-party agents delivered through products such as Dynamics 365 — are detected via the ImportSolution execution context and are not blocked. You can opt in to blocking those too with the cpsb_BlockSolutionImportedAgents environment variable. If you provision agents through other automated paths, validate that they are not affected before enabling any blocking setting.
- System Administrator permissions in the target environment (specififcally check for )
- Download or obtain the managed solution ZIP from
solution. - Open the Power Apps maker portal and select the target environment.
- Go to Solutions, select Import solution, and upload the ZIP.
- Publish all customizations after the import completes.
- Configure the environment variable values described below.
Set current values for these environment variables in the imported or registered solution:
| Environment variable | Default | Purpose |
|---|---|---|
cpsb_BlockStandardHarnessAgents |
false |
Blocks Standard Harness agent creation when enabled. |
cpsb_BlockGitHubCopilotHarnessAgents |
false |
Blocks GitHub Copilot Harness agent creation when enabled. |
cpsb_BlockSolutionImportedAgents |
false |
When enabled, also blocks agents created through a solution import (including Microsoft first-party agents). Leave false to exempt solution-imported agents. |
cpsb_AgentCreationBlockedMessage |
Contact-administrator message | Appends custom guidance to the error shown to the maker. |
Both harness blocking settings default to false; importing or registering the solution does not block agent creation until at least one is enabled. Solution-imported agents are exempt unless cpsb_BlockSolutionImportedAgents is enabled.
When trying to save a "GitHub Copilot Harness" Agent for the first time this will be the error and the agent will not be saved.
When trying to create a "Standard Harness" Agent the creation process is blocked and this message will be displayed (need to expand to see the custom error)
src/CPSBlocker.Plugin- Dataverse plug-in sourcetools/RegisterPlugin- development registration utilitysolution- destination for the exported managed solution ZIP


