- Home
- Skills
- DevOps & Cloud
- Azure Policy Effect and Existence Reviewer
Azure Policy Effect and Existence Reviewer
Export your definitions with the az CLI (or point at an ARM template) and ask your agent to run this skill.
$9.99
What it does
- Reads policy definitions from az policy output, portal exports, value lists and ARM templates
- Flags missing details, deployment templates, remediation roles and modify operations as blockers
- Warns when an existenceCondition is missing or always true, so a policy can never report
- Flags Owner and User Access Administrator remediation roles, and warns about Contributor
- Checks effect parameters: defaults outside allowedValues, Disabled defaults and unknown effects
- Warns about unused or undefined parameters, empty default lists, no type check and the wrong mode
Who it's for
Governance engineers
A pre-assignment review of effect and existence logic
Try asking: “Review these policy definitions before I assign them”
Security reviewers
A list of policies that never report or run as Owner
Try asking: “Which of these policies would remediate as Owner?”
Azure Policy Effect and Existence Reviewer
Example session with this skill installed
python3 scripts/review_policy_definitions.py examples/dirty/policies.json --hide-info
- Read your context and instructions
- Compiled the azure policy effect
The sample has an audit policy with no existence condition, a deploy policy with an always-true condition, an Owner role and no template, a modify policy with no role or operations, an empty default location list, an undefined parameter and a wrong mode.
[WARN] policies.json: policy 'Audit diagnostic settings': effect defaults to Disabled, so it does nothing until an assignment overrides it
[WARN] policies.json: policy 'Audit diagnostic settings': no existenceCondition, so any related 'Microsoft.Insights/diagnosticSettings' resource counts as compliant
[WARN] policies.json: policy 'Audit diagnostic settings': parameter 'logAnalytics' is defined but never used in the rule
[WARN] policies.json: policy 'Deploy diagnostic settings for vaults': existenceCondition is always true for the related resource (type match or like '*')
[BLOCKER] policies.json: policy 'Deploy diagnostic settings for vaults': remediation role is Owner; use the narrowest role that can make the change
[WARN] policies.json: policy 'Deploy diagnostic settings for vaults': remediation role is Contributor; use the narrowest role that can make the change
[BLOCKER] policies.json: policy 'Deploy diagnostic settings for vaults': remediation role is User Access Administrator; use the narrowest role that can make the change
[BLOCKER] policies.json: policy 'Deploy diagnostic settings for vaults': details.deployment has no template
[BLOCKER] policies.json: policy 'Tag modify': effect default 'Audit' is not in allowedValues
[BLOCKER] policies.json: policy 'Tag modify': roleDefinitionIds is missing; remediation has no permissions
[BLOCKER] policies.json: policy 'Tag modify': modify has no operations
[WARN] policies.json: policy 'Tag modify': the if condition has no type check, so it is evaluated against every resource
[WARN] policies.json: policy 'Allowed locations': the if condition has no type check, so it is evaluated against every resource
[WARN] policies.json: policy 'Allowed locations': 'listOfAllowedLocations' defaults to an empty list, so notIn matches every resource until an assignment sets it
[WARN] policies.json: policy 'Require tag on resource groups': mode is Indexed but the rule targets resource groups or subscriptions, which need mode All
[BLOCKER] policies.json: policy 'Require tag on resource groups': the rule uses parameter 'tagName', which is not defined
[WARN] policies.json: policy 'Deny with existence details': effect 'block' is not a recognised policy effect
[WARN] policies.json: policy 'Deny with existence details': details with a type are ignored by Deny and Audit; they only apply to existence effects
[BLOCKER] policies.json: policy 'Audit database auditing': details.type equals the type in if, so details.name is required (use field('name'))
Summary: 8 blocker(s), 11 warning(s), 8 policy(ies), 1 file(s)
Command: python3 scripts/review_policy_definitions.py examples/clean
The clean sample has real existence conditions, defaults inside allowedValues, a narrow tag role, type checks and a non-empty location list, and returns exit code 0:
Summary: 0 blocker(s), 0 warning(s), 4 policy(ies), 1 file(s)
Connects securely to your tools. The creator never sees your data.
About this skill
Azure Policy definitions can look right and still do nothing, or do too much. An audit policy with no existence condition never reports, a deploy policy without a role cannot fix anything, and a remediation role of Owner hands out far more access than needed. These mistakes are easy to miss in a long JSON file.
Export your definitions with the az CLI (or point at an ARM template) and ask your agent to run this skill. It reads the files on your machine, never contacts Azure, and returns blockers to fix first, warnings to review and notes. Every line names the policy and says what to change.
It also checks effect parameters, unused or undefined parameters, empty default lists and the policy mode. Example definitions with expected results are included so you can see it work before you use your own.
- It reads definition JSON only; it cannot see assignments, exemptions, parameters set at assignment time or what resources exist.
- It does not evaluate the rule against real resources; a condition that looks fine can still miss them.
- Only the fixed checks are made; aliases and field names are not validated against the provider.
- Initiatives (policy sets) are not reviewed; export and scan each definition.
- Reports and explains; it never edits definitions.
A single standard-library Python script. It makes no network calls and never writes files. Give it files or directories; it reads .json. Accepted input: az policy definition show or list output, portal exports with a properties object, an object with a value list, or an ARM template with policyDefinitions resources. Effect: a literal effect or [parameters('effect')] with allowedValues and defaultValue. Checks: default outside allowedValues, Disabled default, no default, unknown effect names. Existence effects (AuditIfNotExists, DeployIfNotExists): details and details.type present; existenceCondition present and not always true; details.name required when details.type equals the type in if. Remediation (DeployIfNotExists, Modify): roleDefinitionIds present (Owner and User Access Administrator are blockers, Contributor a warning); deployment template present; Modify operations present. Rule: a type check in if; Indexed mode with a resource group or subscription type; parameters used but undefined, defined but unused; array parameters with an empty default used in in or notIn. Exit codes: 0 no blockers, 1 blockers found, 2 bad arguments. Options: --format json, --hide-info.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
Permissions
What's inside
Frequently Asked Questions
New in DevOps & Cloud
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.