ricmmartins/azure-sre-agent-skills/08-ai-foundry-posture

Claude Code and agent skill by ricmmartins/azure-sre-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Assess security, reliability, and cost posture of Azure OpenAI and Microsoft Foundry deployments. Detects critical anti-patterns: API keys instead of Managed Identity, public endpoints without firewall, disabled content filtering, missing diagnostic settings, deprecated model versions, over-provisioned PTU, absence of AI Gateway (APIM) for rate limiting, shared dev/prod deployments, quota exhaustion risk, 429 throttling rates, runaway token consumption, and single-region deployment. Use when asked about AI workload security, OpenAI best practices, Foundry health check, model deployment review, AI cost optimization, quota monitoring, or throttling analysis.

Install

npx vskill@latest install ricmmartins/azure-sre-agent-skills/08-ai-foundry-posture

SKILL.md

AI Foundry & OpenAI Posture Check

Purpose

Assess the security, reliability, and cost efficiency of Azure OpenAI and Microsoft Foundry deployments. Detects the most common anti-patterns that startups make when building AI-powered products — from exposed endpoints to runaway token costs.

Based on the Azure Well-Architected Framework for AI workloads and Microsoft Foundry operational best practices.

When to use this skill

  • User asks "is our OpenAI deployment secure?"
  • User asks about AI cost optimization or token consumption
  • Review before going to production with an AI feature
  • User asks about content filtering, model versions, or rate limiting
  • Periodic AI workload health check

Pre-check

Confirm with the user:

  • Which Azure OpenAI / Cognitive Services accounts to assess (or "all in subscription")
  • Whether they use PTU (Provisioned Throughput) or Standard deployments
  • Whether they have production AI workloads already live

Assessment procedure

Step 0: Discover AI resources
bash
az cognitiveservices account list \
--subscription <sub-id> \
--query "[?kind=='OpenAI' || kind=='AIServices'].{name:name, kind:kind, rg:resourceGroup, location:location, sku:sku.name}" \
-o table

If no results, try:

bash
az cognitiveservices account list \
--subscription <sub-id> \
--query "[].{name:name, kind:kind, rg:resourceGroup, location:location}" \
-o table

If no Cognitive Services accounts exist, report "No Azure OpenAI or AI Foundry resources found" and end assessment.

For each account found, run the following checks:


🔐 CATEGORY 1 — Security (Critical)

Check 1.1 — Managed Identity enabled (not API keys only)

bash
az cognitiveservices account show \
--name <account> --resource-group <rg> \
--query "{identity:identity.type, disableLocalAuth:properties.disableLocalAuth}" \
-o json
FindingSeverityScore
identity.type = SystemAssigned/UserAssigned AND disableLocalAuth = true✅ Pass12 pts
identity.type set but disableLocalAuth = false⚠️ Partial6 pts
identity.type = None or null❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity

Check 1.2 — Network isolation (firewall or private endpoint)

bash
az cognitiveservices account show \
--name <account> --resource-group <rg> \
--query "{publicAccess:properties.publicNetworkAccess, defaultAction:properties.networkAcls.defaultAction, privateEndpoints:properties.privateEndpointConnections}" \
-o json
FindingSeverityScore
publicNetworkAccess = Disabled + private endpoints exist✅ Pass13 pts
defaultAction = Deny + IP/VNet rules configured✅ Pass13 pts
defaultAction = Allow (open to internet)❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/cognitive-services-virtual-networks

Check 1.3 — Content filtering (RAI policies)

bash
az rest --method get \
--url "https://management.azure.com/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<account>/raiPolicies?api-version=2024-10-01"

Then check deployments have a policy assigned:

bash
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> \
--query "[].{name:name, model:properties.model.name, raiPolicy:properties.raiPolicyName}" \
-o table
FindingSeverityScore
All deployments have RAI policy assigned with filters enabled✅ Pass10 pts
Some deployments missing policy or using minimal filters⚠️ Partial5 pts
No RAI policies or content filtering disabled❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/content-filters
⚙️ CATEGORY 2 — Reliability & Operations

Check 2.1 — Model version pinned and not deprecated

bash
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> \
--query "[].{name:name, model:properties.model.name, version:properties.model.version}" \
-o table

Cross-reference with available models:

bash
az cognitiveservices account list-models \
--name <account> --resource-group <rg> \
--query "[].{model:model.name, version:model.version, lifecycle:model.lifecycleStatus}" \
-o table
FindingSeverityScore
All deployments on GA versions with explicit version pinned✅ Pass7 pts
Deployments on versions nearing retirement (< 3 months)⚠️ Attention3 pts
Deployments on Legacy/Deprecated versions❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/model-retirements

Check 2.2 — Diagnostic settings enabled

bash
# Get resource ID
RESOURCE_ID=$(az cognitiveservices account show \
--name <account> --resource-group <rg> --query "id" -o tsv)
az monitor diagnostic-settings list --resource $RESOURCE_ID -o json
FindingSeverityScore
Diagnostic settings sending RequestResponse + Audit to Log Analytics✅ Pass7 pts
Diagnostic settings exist but incomplete (only metrics, no logs)⚠️ Partial3 pts
No diagnostic settings at all❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/monitoring

Check 2.3 — Resource Lock on production account

bash
az lock list --resource-group <rg> \
--query "[?contains(id, '<account>')].{name:name, level:level}" \
-o table
FindingSeverityScore
CanNotDelete lock exists on the OpenAI account✅ Pass5 pts
Lock exists on RG but not specifically on account⚠️ Partial3 pts
No locks❌ Fail0 pts
📖 https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources

Check 2.4 — Multi-region resilience (failover capability)

Check if OpenAI accounts exist in more than one region (disaster recovery / latency optimization):

bash
az cognitiveservices account list \
--subscription <sub-id> \
--query "[?kind=='OpenAI' || kind=='AIServices'].{name:name, location:location, rg:resourceGroup}" \
-o table

Group by location and count unique regions:

FindingSeverityScore
OpenAI accounts in 2+ different regions✅ Pass5 pts
All OpenAI accounts in a single region⚠️ Risk2 pts
Only 1 OpenAI account total (single point of failure)❌ Risk0 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/business-continuity-disaster-recovery
Context from the field: Customers with single-region deployments face outages during regional capacity events. Multi-region + APIM load balancing (Check 4.1) is the recommended pattern for production AI workloads.

Check 2.5 — 429 throttling rate (last 24 hours)

Requires diagnostic settings sending logs to Log Analytics (Check 2.2). If diagnostics are not configured, skip and note dependency.

kusto
AzureDiagnostics
| where TimeGenerated > ago(24h)
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where Category == "RequestResponse"
| summarize
TotalRequests = count(),
ThrottledRequests = countif(resultSignature_d == 429),
ThrottleRate = round(100.0 * countif(resultSignature_d == 429) / count(), 2)
by Resource, properties_s
| order by ThrottleRate desc

Use execute_kusto_query with the Log Analytics workspace connected to the OpenAI account's diagnostic settings.

FindingSeverityScore
Throttle rate < 1% in last 24h✅ Pass6 pts
Throttle rate 1–10% (occasional bursts)⚠️ Attention3 pts
Throttle rate > 10% (active capacity problem)❌ Fail0 pts
No diagnostic data available (Check 2.2 failed)⚠️ Skip0 pts — flag dependency
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/quota
Context from the field: Customers assume PTU eliminates throttling — it does not. Bursty traffic and concurrency limits can cause 429s even on PTU. Check APIM retry/spillover pattern (Check 4.1) as mitigation.

💰 CATEGORY 3 — Cost & Efficiency

Check 3.1 — Rate limits configured per deployment (not max)

bash
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> \
--query "[].{name:name, model:properties.model.name, sku:sku.name, capacity:sku.capacity}" \
-o table
FindingSeverityScore
Each deployment has explicit TPM capacity set (not maximum)✅ Pass5 pts
Single deployment consuming all available quota⚠️ Risk2 pts
Unable to determine (no deployments)N/A5 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/quota

Check 3.2 — Model selection diversity (not GPT-4o for everything)

bash
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> \
--query "[].{name:name, model:properties.model.name}" \
-o table
FindingSeverityScore
Mix of models (e.g., gpt-4o + gpt-4o-mini, or batch deployments)✅ Pass3 pts
Only premium models deployed (no cost-efficient alternative)⚠️ Info1 pt
Single deployment onlyN/A3 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models

Check 3.3 — PTU utilization (if applicable)

Only check if PTU/Provisioned deployments exist:

bash
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> \
--query "[?sku.name=='ProvisionedManaged'].{name:name, capacity:sku.capacity}" \
-o table

If PTU deployments exist, check utilization via metrics:

bash
az rest --method get \
--url "https://management.azure.com<resource-id>/providers/microsoft.insights/metrics?api-version=2019-07-01&metricnames=ProvisionedManagedUtilizationV2&timespan=P7D&interval=PT1H&aggregation=Average"
FindingSeverityScore
PTU utilization 70–85% average (well-sized)✅ Pass7 pts
PTU utilization < 50% (over-provisioned — burning money)⚠️ Waste2 pts
PTU utilization > 95% (under-provisioned — users getting 429s)⚠️ Risk4 pts
No PTU deployments (using Standard — fine for most startups)N/A7 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/provisioned-throughput

Check 3.4 — Quota utilization (TPM used vs limit)

bash
az cognitiveservices account list-usage \
--name <account> --resource-group <rg> \
-o json

Alternative if the above returns empty (common for newer deployments):

bash
az rest --method get \
--url "https://management.azure.com/subscriptions/<sub-id>/providers/Microsoft.CognitiveServices/locations/<location>/usages?api-version=2024-10-01"
FindingSeverityScore
Quota usage < 70% of limit across all models✅ Pass5 pts
Quota usage 70–90% (nearing limit — plan increase)⚠️ Attention3 pts
Quota usage > 90% (at risk of rejection — request increase NOW)❌ Risk0 pts
Unable to retrieve usage data⚠️ Info3 pts
📖 https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits
Context from the field: Approved TPM quotas sometimes don't appear in Foundry due to subscription/project mismatches or the new Global/Data Zone quota pooling model. If usage data looks incorrect, verify the quota was assigned to the correct subscription and region.

Check 3.5 — Token consumption trend (tokens per day per deployment)

Requires diagnostic settings sending logs to Log Analytics (Check 2.2). If diagnostics are not configured, skip and note dependency.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
70
Repository forks
13
7-day trend score
21

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ricmmartins/azure-sre-agent-skills/08-ai-foundry-posture/badge)](https://verified-skill.com/skills/ricmmartins/azure-sre-agent-skills/08-ai-foundry-posture)

Something wrong with this skill or its page? Tell us.