Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPS Agent Creation Blocker

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.template value beginning with cliagent

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.

Prerequisites

  • System Administrator permissions in the target environment (specififcally check for )

Install the managed solution

  1. Download or obtain the managed solution ZIP from solution.
  2. Open the Power Apps maker portal and select the target environment.
  3. Go to Solutions, select Import solution, and upload the ZIP.
  4. Publish all customizations after the import completes.
  5. Configure the environment variable values described below.

Configuration

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.

Environment variable configuration

Test Screenshots

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.

GitHub Copilot Harness agent creation blocked

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)

Standard Harness agent creation blocked

Repository layout

  • src/CPSBlocker.Plugin - Dataverse plug-in source
  • tools/RegisterPlugin - development registration utility
  • solution - destination for the exported managed solution ZIP

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages