Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks.

MITAuto-check passedLegal & Compliance

Install Azure Policy

skills CLI
$ npx skills add vinayaklatthe/microsoft-security-skills --skill azure-policy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vinayaklatthe/microsoft-security-skills azure-policy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vinayaklatthe/microsoft-security-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/azure-policy .claude/skills/azure-policy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-policy
GitHub stars
175
Token cost
~1.9k tokens
SKILL.md length
763 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks.

  • Works in 7 steps: Use built-in initiatives where they… → Author custom definitions only where… → Initiatives = grouped policies — Bundle… → …
  • Resource RBAC role choice (use azure-role-selector)
  • SKILL.md covers When to use, Pick the policy effect by goal, Approach and Guardrails, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Azure Policy is an agent skill from vinayaklatthe/microsoft-security-skills. Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks. Covers effects (Audit, Deny, Append, Modify, DeployIfNotExists, AuditIfNotExists), management group inheritance, audit-first rollout, parameterised reusable policies, and exclusion discipline. Powers Defender for Cloud regulatory compliance. WHEN: Azure Policy, governance guardrails, enforce compliance, policy initiative, deny resource…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Legal & Compliance, covering Regulatory compliance, Infrastructure as code and Authorization and RBAC. It works with Microsoft Azure, Microsoft Defender and Bicep. The repository describes itself as: Curated Microsoft Security skills for AI agents - Defender, Sentinel, Entra, Purview, Intune, Security Copilot. The licence is MIT.

When your agent uses it

  • Resource RBAC role choice (use azure-role-selector)
  • Defender posture only (use defender-for-cloud-hardening)
  • Bicep / IaC templating

Example prompts

  • “/azure-policy”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Use built-in initiatives where they exist — **Microsoft Cloud Security Benchmark
  2. Author custom definitions only where built-ins don't exist — Custom policy as ARM
  3. Initiatives = grouped policies — Bundle related policies (e.g. "Enterprise security
  4. Scope at management group — Assign at management group for inheritance across
  5. Roll out: Audit → review → Deny — Assign as Audit first. Wait 14-30 days, pull
  6. Remediate existing resources with remediation tasks — DeployIfNotExists and
  7. Monitor + integrate with Defender for Cloud — Compliance state is the daily dashboard.

What it can do on your machine

Read from SKILL.md and the folder at commit 15f16df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure Policy loads about 1.9k tokens when it runs. Until then it costs about 210 tokens; SKILL.md has 763 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~210
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vinayaklatthe/microsoft-security-skills at commit 15f16df, republished under its MIT licence (© vinayaklatthe). 763 words, ~1,923 tokens.

Download SKILL.mdSave it as .claude/skills/azure-policy/SKILL.md (or your agent's skills folder).
name
azure-policy
description
Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks. Covers effects (Audit, Deny, Append, Modify, DeployIfNotExists, AuditIfNotExists), management group inheritance, audit-first rollout, parameterised reusable policies, and exclusion discipline. Powers Defender for Cloud regulatory compliance. WHEN: Azure Policy, governance guardrails, enforce compliance, policy initiative, deny resource, audit configuration, remediation task, deployIfNotExists, management group policy, security baseline enforcement, MCSB initiative, regulatory compliance Azure. DO NOT USE for resource RBAC role choice (use azure-role-selector), Defender posture only (use defender-for-cloud-hardening), or Bicep / IaC templating.
license
MIT
metadata.author
Microsoft
metadata.version
0.1.0

Azure Policy

Azure Policy enforces organisational standards and assesses compliance at scale, auditing or preventing non-compliant resource configurations and remediating drift automatically. It's the preventive control plane for an Azure estate and the engine behind Defender for Cloud regulatory compliance.

When to use

Implementing preventive and detective governance / security guardrails across subscriptions and management groups. Use this skill to pick effects, design initiatives, and roll out safely.

Do not use this skill for RBAC role choice (azure-role-selector), Defender posture (defender-for-cloud-hardening), or Bicep / IaC templating.

Pick the policy effect by goal

GoalEffectNotes
Surface non-compliant resources without blockingAuditReporting only; default starting point
Block creation / update of non-compliant resourcesDenyPreventive; test in Audit first
Add a required tag / property automaticallyModify (or Append)Mutates the request
Deploy a missing related resource (e.g. diagnostic settings)DeployIfNotExists (DINE)Managed identity required
Surface a missing related resourceAuditIfNotExists (AINE)Reporting only
Conditional logic across many resourcesInitiativeGroup multiple policies
Block guest user creation / specific SKUsDeny + parameterParameterise allowed SKUs
Enforce Defender for Cloud baselineBuilt-in MCSB initiativeDon't author your own

Rule of thumb: start with Audit on every new policy for 14-30 days. Review compliance. Move critical controls to Deny. Use DeployIfNotExists for things that should "just be there" (diagnostic settings, defender agents). Never start with Deny tenant-wide.

Approach

  1. Use built-in initiatives where they exist — Microsoft Cloud Security Benchmark (MCSB) is the default. Add regulatory initiatives (CIS, ISO 27001, NIST 800-53, PCI DSS, HIPAA) per compliance scope. Verify: MCSB initiative assigned at root management group; compliance state visible in Defender for Cloud.

  2. Author custom definitions only where built-ins don't exist — Custom policy as ARM JSON: policyRule (condition + effect), parameters (reusable inputs), metadata (category). Keep policies single-purpose; group via initiatives.

  3. Initiatives = grouped policies — Bundle related policies (e.g. "Enterprise security baseline" initiative containing 30 policies). Assign initiatives, not individual policies, for manageability.

  4. Scope at management group — Assign at management group for inheritance across child subscriptions. Use exclusions sparingly with documented justification. Verify: assignment scope visible in policy compliance; child subscriptions inherit.

  5. Roll out: Audit → review → Deny — Assign as Audit first. Wait 14-30 days, pull non-compliance list, work with workload owners to remediate or document exceptions. Then switch the assignment to Deny. Verify: non-compliance count down to acceptable baseline before the Deny switch; workload owners notified.

  6. Remediate existing resources with remediation tasks — DeployIfNotExists and Modify policies only act on new / updated resources. Use remediation tasks to bring existing resources into compliance. The policy assignment's managed identity performs the change. Verify: remediation task created post-assignment; success rate > 95%; failures triaged.

  7. Monitor + integrate with Defender for Cloud — Compliance state is the daily dashboard. Defender for Cloud uses policies for its recommendations - failing recommendation = failing policy.

Show full SKILL.md (304 more words)Show less

Guardrails

  • Test Deny policies in audit first - a broad Deny can block legitimate deployments and pipelines. First Deny at midnight = production deployment blocked at 09:00.
  • Use parameters to make policies reusable across environments. Hard-coded regions / SKUs / tag values = one policy per environment, drift guaranteed.
  • Don't over-exclude; each exclusion weakens the guardrail and should be justified. Exclusions are an exception list - document the why, expire them.
  • DeployIfNotExists needs a managed identity with the right role. Without the right RBAC on the assignment's identity, remediation silently fails.
  • Don't author what's already built in. MCSB / regulatory initiatives are maintained; custom copies drift from Microsoft guidance.
  • Policy != RBAC. Policy controls resource configuration; RBAC controls who can act. Both layers needed.

Common anti-patterns

  • "Deploy Deny tenant-wide on day one" - First production deployment fails. Audit first.
  • "One policy per environment, copy-paste" - Hard-coded params, maintenance hell. Parameterise + one assignment per env.
  • "Skip the MCSB initiative - we have our own" - Yours drifts; MCSB is Microsoft- maintained.
  • "Exclude the subscription that fails compliance" - Hides the problem. Fix or formally accept the risk.
  • "DeployIfNotExists without remediation task" - Existing resources stay non-compliant forever; only new ones get the configuration.
  • "Custom JSON without testing" - First assignment of a syntax-error policy = no effect, no warning. Test in a sandbox subscription first.

Example prompts

  • Create an Azure Policy initiative to enforce a security baseline at the management group scope.
  • How do I deny non-compliant resources and auto-remediate with DeployIfNotExists?
  • Apply governance guardrails at the management group scope with inheritance.
  • Audit resource configuration before switching policies to Deny.
  • Parameterise an allowed-locations policy for reuse across dev / test / prod.
  • Build a remediation task to bring existing resources into compliance.

Microsoft Learn

© vinayaklatthe, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/azure-policy of vinayaklatthe/microsoft-security-skills.

Open the folder on GitHubat commit 15f16df

Compare with similar skills

Azure Policy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure Policy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Policy this skillvinayaklatthe/microsoft-security-skills175—~1.9kAutomated safety check: PassMIT
Azure Validatemicrosoft/GitHub-Copilot-for-Azure2551 repos~880Automated safety check: PassMIT
Apex Azure Rbacjonathan-vella/apex217—~1.8kAutomated safety check: PassMIT
Writing Bicep Templatesmicrosoft-foundry/foundry-agent-webapp127—~1.2kAutomated safety check: PassMIT
Apex Entra App Registrationjonathan-vella/apex217—~1.3kAutomated safety check: PassMIT
Azure Cache RedisMicrosoftDocs/Agent-Skills776—~2.9kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Azure Validate

    microsoft/GitHub-Copilot-for-Azure

    Official

    Pre-deployment validation for Azure readiness. An agent skill from microsoft/GitHub-Copilot-for-Azure.

    255 GitHub starsUsed in 1 repo~880 tokens
    DevOps & CloudAuto-check passed
  • Apex Azure Rbac

    jonathan-vella/apex

    ANALYSIS SKILL — Find the right Azure RBAC role for an identity with least-privilege access; generate CLI, Bicep, and Terraform code to assign it.

    217 GitHub stars~1.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Writing Bicep Templates

    microsoft-foundry/foundry-agent-webapp

    Provides Bicep coding standards for Azure infrastructure in this repository.

    127 GitHub stars~1.2k tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • Apex Entra App Registration

    jonathan-vella/apex

    WORKFLOW SKILL — Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration.

    217 GitHub stars~1.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Azure Cache Redis

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Cache for Redis development including troubleshooting, best practices, decision making, architecture & design patterns, security, configuration, and deployment.

    776 GitHub stars~2.9k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • Azure Enclave

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Enclave development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, and deployment.

    776 GitHub stars~2.7k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed

More from vinayaklatthe/microsoft-security-skills

All 50 skills in this repo
  • API Security Design

    vinayaklatthe/microsoft-security-skills

    Guidance for designing secure APIs on Azure - authentication, authorization, gateway controls, input validation, rate limiting, secret management, and runtime threat detection - aligned to OWASP API…

    175 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure App Service Security

    vinayaklatthe/microsoft-security-skills

    Guidance for securing Azure App Service web apps and APIs — managed identity, Easy Auth with Microsoft Entra ID, network isolation via private endpoints + VNet integration, HTTPS / TLS hardening…

    175 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Arc

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure Arc — projecting on-premises, multicloud (AWS/GCP), and edge servers, Kubernetes, and data services into Azure Resource Manager for unified governance, security, and management.

    175 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Bastion Jit

    vinayaklatthe/microsoft-security-skills

    Guidance for secure remote VM management in Azure using Azure Bastion combined with Defender for Cloud just-in-time (JIT) VM access.

    175 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Confidential Computing

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure Confidential Computing — protecting data in use through hardware-based Trusted Execution Environments (TEEs).

    175 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Azure Ddos Protection

    vinayaklatthe/microsoft-security-skills

    Guidance for Azure DDoS Protection — Network Protection (per-VNet) and IP Protection (per public IP) tiers built on the same always-on Microsoft platform.

    175 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Azure Policy

What does Azure Policy do?

Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks. Azure Policy is an agent skill from vinayaklatthe/microsoft-security-skills. Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks.

When should I use Azure Policy?

Azure Policy fits situations like: resource RBAC role choice (use azure-role-selector); defender posture only (use defender-for-cloud-hardening); bicep / IaC templating.

How do I install Azure Policy in Claude Code?

Run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-policy -a claude-code`. Or copy the skill folder (skills/azure-policy in vinayaklatthe/microsoft-security-skills) into .claude/skills/azure-policy in your project. Claude Code loads it when a task matches its description.

How do I install Azure Policy in Codex?

Run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-policy -a codex`. Or copy the skill folder (skills/azure-policy in vinayaklatthe/microsoft-security-skills) into .agents/skills/azure-policy in your project. Codex loads it when a task matches its description.

Can I use Azure Policy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vinayaklatthe/microsoft-security-skills --skill azure-policy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-policy, .gemini/skills/azure-policy, .github/skills/azure-policy and .opencode/skills/azure-policy in your project.

What does Azure Policy need to run?

SKILL.md names no scripts, command-line tools or credentials: Azure Policy is instructions for the agent only.

Does Azure Policy access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Azure Policy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure Policy use?

Azure Policy is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure Policy use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Azure Policy?

Skills that share tags, products or a category with Azure Policy: Azure Validate (microsoft/GitHub-Copilot-for-Azure, 255 stars), Apex Azure Rbac (jonathan-vella/apex, 217 stars), Writing Bicep Templates (microsoft-foundry/foundry-agent-webapp, 127 stars) and Apex Entra App Registration (jonathan-vella/apex, 217 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Policy?

vinayaklatthe (a GitHub user) maintains it in vinayaklatthe/microsoft-security-skills, which has 175 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on June 18, 2026.

Source: vinayaklatthe/microsoft-security-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.