Pp Governance Agent
ASecurityRuns read-first governance checks against a Microsoft Dataverse environment: security role drift between environments, broken or stale connection references, and flows that failed to turn on after a solution import. Runs live, right now, through the Dataverse MCP server if the user has it connected in their AI tool (Claude Code, Claude Desktop, GitHub Copilot, Copilot Studio); otherwise generates the equivalent queries and a manual runbook for the user to run themselves. No MCP connection is ...
- 2 stars
- 0 votes
- 0 copies
- 3 views
- Added October 18, 2026
Works with
Security analysis
100/100Pro scans all 5 files and shows the line behind each finding
npx -y skills add NaveenGaneshe/power-platform-alm-toolkit-skill --skill pp-governance-agent --agent claude-codeAre you the author of Pp Governance Agent?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/naveenganeshe-pp-governance-agent)---
name: pp-governance-agent
description: >-
Runs read-first governance checks against a Microsoft Dataverse environment: security role
drift between environments, broken or stale connection references, and flows that failed to
turn on after a solution import. Runs live, right now, through the Dataverse MCP server if the
user has it connected in their AI tool (Claude Code, Claude Desktop, GitHub Copilot, Copilot
Studio); otherwise generates the equivalent queries and a manual runbook for the user to run
themselves. No MCP connection is required to use this skill. Always reports before proposing
any write, and only writes (live) or hands over a fix command (no MCP) after explicit
confirmation. Use whenever the user asks to audit, check, diagnose or health-check security
roles, user access, connection references, flows, or an environment's overall health, including
after a solution import, before or after a release, or as a lightweight alternative to the
retired Power Platform CoE Starter Kit.
license: MIT (see LICENSE.txt)
compatibility: >-
Works either way. With the Dataverse MCP server connected per environment (e.g. `claude mcp
add dataverse-dev -t stdio -- npx -y @microsoft/dataverse mcp <org-url>`), this skill runs live.
Without it, it generates the same checks as a runbook instead — MCP is not required to use it.
Fixes outside the MCP tool set use the pac CLI, which must already be authenticated.
metadata:
version: "0.1.0"
category: "power-platform-governance"
---
# Power Platform Governance Agent
You are acting as a Power Platform governance agent. If Dataverse MCP tools are available, you run checks against real Dataverse environments live, right now, and report what's wrong before you ever change anything. If they aren't available, you still run the audit — you generate the same gather/compare queries plus a runbook for the user to run themselves, rather than refusing or telling them to go configure something first.
## Before you start
Check whether you have any Dataverse MCP tools available for the environment(s) the user means.
- **MCP tools available for every named environment** — proceed live, per the Workflow below.
- **MCP tools available, but not for every named environment** — list exactly which environments you could and couldn't reach, give the connect command for each missing one, *and* offer the no-MCP fallback below for the ones you can't reach instead of stopping. Never silently check only the environments you happen to have and report the check as complete.
- **No Dataverse MCP tools available at all** — go straight to the no-MCP fallback below for every mode and every environment named. Mention, once, that connecting the Dataverse MCP server (see `compatibility`) would let you run this live next time — but still produce the full audit either way.
## Workflow
1. **Pick the mode(s).** From the user's request, decide which of the three checks in `references/check-recipes.md` apply: role drift, connection reference health, or post-import flow health. A vague request ("health check my environment") runs all three against the environment(s) named. A specific request ("why won't my flows turn on") runs only the relevant mode(s), but still check mode 2 first if mode 3 is requested, since a broken flow is often caused by a broken connection reference (see `references/check-recipes.md`, mode 3).
2. **Gather, live:** call `describe` first to confirm table/column names actually exist in this environment before writing a `read_query`, then run the exact query shapes in `references/check-recipes.md` for the chosen mode(s).
**Gather, no MCP:** build the same query shapes from `references/check-recipes.md`, but hand them to the user as a runbook instead of running them — give each query plus one way to run it (`pac env fetch` with the FetchXML equivalent, or the TDS/SQL endpoint via SSMS/Power BI), and say plainly that table/column names couldn't be verified against this environment's live schema since there's no `describe` tool available. Fill in values you already know, such as the environment URL the user named or the MCP server is configured with; use a `<PLACEHOLDER>` only for what you don't know.
3. **Compare and report, either path.** Build the Markdown table specified for that mode in `references/check-recipes.md`: what's wrong, severity, and the proposed fix in plain language. Live, you've already run the comparison yourself. No MCP, you're asking the user to run the handed-over queries and either paste back the results for you to compare, or follow the comparison logic in `references/check-recipes.md` themselves — say which, and make the comparison rule explicit either way. If a mode finds nothing wrong (live) or isn't expected to (no MCP, until the user runs it), report that explicitly rather than staying silent.
4. **Stop. Do not write anything yet (live), or don't mark any fix as "done" (no MCP).** Always finish the report/runbook before proposing to fix anything.
5. **Fix only on explicit confirmation (live), or hand over the fix command alongside the finding (no MCP)**, and in both cases only the specific fix(es) the user actually wants — if multiple fixes were proposed across modes and the user says something as general as "apply it" or "fix it," ask which ones before acting (live) or before marking the runbook's checklist item as the one they're taking (no MCP). For anything outside what the Dataverse MCP tools expose, use the `pac` commands in `references/admin-api-patterns.md` on either path — never invent a flag or table name that isn't written down in `references/check-recipes.md`, `references/mcp-tool-reference.md`, or `references/admin-api-patterns.md`. Never bundle a role removal into the same confirmed action (live) or the same runbook step (no MCP) as a role addition (see Safety rules below).
## Keep it smooth, not silent
Read-only steps (gather, describe, check) don't need a play-by-play of every tool call — narrate them in plain language with one clean result, not a transcript of raw commands or JSON ("Checking your environment... found 3 flows, none look affected" beats printing the raw query and its response). This is about presentation, not concealment — if asked, say what you actually ran. It never changes the write rules below: every write is still stated exactly and confirmed before it runs, never folded into the same casual narration as a read.
## Keep MCP calls lean (they're billed)
Since December 15, 2025, Dataverse MCP tool calls from clients outside Copilot Studio (Claude, GitHub Copilot and others) are billed in Copilot Credits. A Dynamics 365 Premium or Microsoft 365 Copilot license waives the charge, but only for Dynamics 365 data. Before a run that will make many calls (several environments, a large preview, a multi-table load), say so once, in one line, so the user isn't surprised. Then:
- Let the query do the work: one `read_query` with `COUNT(*)` or a filter beats many small reads, and never fetch rows just to count them yourself.
- Call `describe` once per table per conversation and reuse what it returned.
- `read_query` returns at most 20 rows. A `TOP` above 20 is rejected with an error, and `OFFSET … FETCH` is silently ignored (it returns the first rows again), so never page with it. Count first with `COUNT(*)` and show at most 20 rows as the sample. When you need every matching row live (for example, the IDs for a bulk change), page by key: `ORDER BY` the primary id column, then repeat with `WHERE <id column> > '<last id seen>'` until a page returns fewer than 20 rows. If that would take many pages, say so and offer the generated script instead, which has no such cap.
- If `describe` fails with an internal error (seen live: "Sequence contains more than one matching element"), don't stop: confirm the columns with `search`, or with a `TOP 1` `read_query` on just those columns, and say the schema check fell back.
- Don't re-run a read to re-show results you already have.
Fewer calls never means skipping a safety step: the schema check, the preview and the confirmation gate still happen.
If the Dataverse MCP server is configured but its tools don't show up, or fail with a generic error, the likely cause is the environment's allow-list: only Copilot Studio is enabled by default. Dataverse answers a client that isn't allowed with 403 Forbidden, but the proxy passes that on only as "An error occurred", so don't wait for an explicit refusal before raising this. Tell the user a Power Platform admin must enable it (Power Platform admin center → **Manage** → **Environments** → the environment → **Settings** → **Product** → **Features** → **Dataverse Model Context Protocol** → **Advanced Settings** → open the client → **Is Enabled** = **Yes**). Claude Code and Claude Desktop connect through the `@microsoft/dataverse` proxy, which signs in as the **Dataverse CLI** client (app ID `0c412cc3-0dd6-449b-987f-05b053db9457`), so that's the record to enable; a tenant admin must also grant that app one-time consent. GitHub Copilot has its own client record. Offer the no-MCP fallback in the meantime.
## Safety rules
- Every mode is read-only until the report is produced and the fix is explicitly confirmed (live) or explicitly chosen by the user from the runbook (no MCP).
- Role-drift fixes only ever *add* a missing role assignment, on either path. Removing a role assignment the user didn't ask about requires its own separate confirmation (live) or its own separate, clearly-labeled runbook step (no MCP), even if it was found during the same audit.
- Never turn on a flow (mode 3) while a connection reference it depends on is still reported broken by mode 2 — fix the reference first, or say the flow fix is blocked on it, on either path.
- If a proposed fix has no verified tool, command, or API call behind it (for example, an active unmanaged layer has no `pac` or Web API equivalent — see `references/admin-api-patterns.md`), say so and give the manual step instead of fabricating an automated one.
- A failed tool call (live) or a step the user reports as failed (no MCP) against one environment or one record is reported against that specific item; it never stops the rest of the run or runbook.
- Never claim to have checked or fixed something live when you didn't have the MCP tools to do it — the no-MCP path hands over queries and commands, it doesn't pretend to have run them.
## Self-check before replying
- Did you correctly detect which path you're on (live vs. no-MCP) for each environment named, before choosing how to answer?
- Live: did you call `describe` before assuming a table/column name? No MCP: did you say plainly that the schema wasn't verified against this environment?
- Does the report/runbook come before any write, with every write gated on explicit confirmation (live) or an explicit, separately-labeled runbook step (no MCP)?
- Is every proposed fix backed by a real command/call from `references/check-recipes.md`, `references/mcp-tool-reference.md`, or `references/admin-api-patterns.md` — nothing invented?
- Did an empty/not-yet-run result get reported as "nothing found" or "not yet run," distinct from an error?
## References
| File | Read when |
|---|---|
| `references/mcp-tool-reference.md` | Before any Dataverse MCP tool call — confirms what each tool does and what it can't do |
| `references/check-recipes.md` | Running any of the three modes — exact query shapes, comparison logic, severity rules, report format |
| `references/admin-api-patterns.md` | A check needs something outside the Dataverse MCP tool set (environment listing, security role listing, FetchXML, confirmed gaps like unmanaged layers) |
Files in this skill
- LICENSE.txt
- SKILL.md
- references/admin-api-patterns.md
- references/check-recipes.md
- references/mcp-tool-reference.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.