Agent skill

Azure APIM Policy Authoring

by thomast1906 in thomast1906/github-copilot-agent-skills

Generates Azure API Management policy XML for authentication, rate limiting, CORS, error handling and transformations, consulting Azure best-practice and documentation tools first.

MITAuto-check passedBackend & APIs

Install Azure APIM Policy Authoring

skills CLI
$ npx skills add thomast1906/github-copilot-agent-skills --skill apim-policy-authoring -a claude-code

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

GitHub CLI
$ gh skill install thomast1906/github-copilot-agent-skills apim-policy-authoring --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/thomast1906/github-copilot-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/apim-policy-authoring .claude/skills/apim-policy-authoring && 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
apim-policy-authoring
GitHub stars
202
Token cost
~1.5k tokens
SKILL.md length
308 words
Files
2 (incl. references)
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Generates Azure API Management policy XML for authentication, rate limiting, CORS, error handling and transformations, consulting Azure best-practice and documentation tools first.

  • Works in 7 steps: Call Best Practices FIRST → Search Documentation → JWT Validation with Entra ID → …
  • Securing an API in Azure API Management with JWT or OAuth validation
  • SKILL.md covers When to Use This Skill, Policy Templates, Policy Execution Flow and Important: MCP Tools (ALWAYS…, plus 4 more sections
  • Reaches login.microsoftonline.com

What it does

The agent writes API Management policies for OAuth 2.0, JWT validation and hybrid auth with subscription keys, per-user or per-subscription throttling, CORS for browser clients, standardized error responses with correlation IDs, header and body transformations and security headers. Three ready templates live in `references/POLICY_TEMPLATES.md`: hybrid authentication with a subscription key fallback for public APIs, OAuth only with Entra ID for internal APIs, and subscription key only for simple read-only APIs. Policies follow the inbound, backend, outbound and on-error flow.

Before writing any policy the agent must call an Azure MCP tool for best practices on the relevant topic, and it searches the Azure documentation for specific elements such as the validate-jwt reference. The skill shows snippets for JWT validation against an Entra ID OpenID configuration, per-user rate limiting keyed on the token subject, correlation ID generation and a standardized on-error response. The excerpt ends in the error-response example.

When your agent uses it

  • Securing an API in Azure API Management with JWT or OAuth validation
  • Adding per-user rate limiting to an API policy
  • Setting up CORS and security headers for a browser-facing API
  • Standardizing error responses with correlation IDs

Example prompts

  • “Write an APIM policy that validates Entra ID tokens and falls back to a subscription key.”
  • “Add per-user rate limiting to this API's inbound policy.”
  • “Give me a CORS policy for our single-page app calling this API.”
  • “Create an on-error section that returns a JSON error with a correlation ID.”

Requirements

  • Azure MCP tools for best practices and documentation
  • An Azure API Management service to apply the policies to

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Call Best Practices FIRST
  2. Search Documentation
  3. JWT Validation with Entra ID
  4. Per-User Rate Limiting
  5. Correlation ID Generation
  6. Standardized Error Response
  7. Security Headers

What it can do on your machine

Read from SKILL.md and the folder at commit 554ac0b. 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 (its code samples are xml).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • login.microsoftonline.com

    Also links to:

    • 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 APIM Policy Authoring loads about 1.5k tokens when it runs, and up to ~6k if it reads all its reference files. Until then it costs about 78 tokens; SKILL.md has 308 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6k

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 thomast1906/github-copilot-agent-skills at commit 554ac0b, republished under its MIT licence (© thomast1906). 308 words, ~1,488 tokens.

Download SKILL.mdSave it as .claude/skills/apim-policy-authoring/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
apim-policy-authoring
description
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
license
MIT
metadata.author
Thomas Thornton
metadata.version
1.0.0
metadata.last-updated
2026-05-19
metadata.azure-services
api-management

APIM Policy Authoring Skill

Generates production-ready Azure API Management policy XML with authentication, rate limiting, CORS, error handling, correlation IDs, and security headers.

When to Use This Skill

Activate this skill when users need:

  • Authentication policies: OAuth 2.0, JWT validation, hybrid auth with subscription keys
  • Rate limiting: Per-user or per-subscription throttling
  • CORS configuration: Cross-origin access for browser-based clients
  • Error handling: Standardized error responses with correlation IDs
  • Request/response transformation: Header manipulation, body transformations
  • Security headers: X-Content-Type-Options, X-Frame-Options, etc.

Policy Templates

See references/POLICY_TEMPLATES.md for complete production-ready XML templates:

  1. Hybrid Authentication - OAuth + subscription key fallback for public APIs
  2. OAuth Only - Internal corporate APIs with Entra ID
  3. Subscription Key Only - Simple public read-only APIs

Policy Execution Flow

INBOUND → BACKEND → OUTBOUND → ON-ERROR

1. INBOUND: Authentication, rate limiting, CORS, headers
2. BACKEND: Forwarding, retry, circuit breaker
3. OUTBOUND: Response transform, security headers, cleanup
4. ON-ERROR: Structured errors, logging, correlation ID

Important: MCP Tools (ALWAYS Use Before Writing Policies)

1. Call Best Practices FIRST

Before ANY policy generation, call:

Tool: mcp_azure_mcp_get_azure_bestpractices
Intent: "Azure API Management policy best practices for [authentication|rate-limiting|CORS|error-handling]"
2. Search Documentation

For specific policy elements:

Tool: mcp_azure_mcp_documentation search
Query: "APIM validate-jwt policy reference"
1. JWT Validation with Entra ID
xml
<validate-jwt header-name="Authorization">
    <openid-config url="https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration" />
    <audiences>
        <audience>api://{client-id}</audience>
    </audiences>
</validate-jwt>
2. Per-User Rate Limiting
xml
<set-variable name="userId" value="@(context.Request.Headers.GetValueOrDefault('Authorization','').AsJwt()?.Subject)" />
<rate-limit-by-key calls="1000" renewal-period="3600" counter-key="@((string)context.Variables['userId'])" />
3. Correlation ID Generation
xml
<set-variable name="correlationId" value="@(Guid.NewGuid().ToString())" />
<set-header name="X-Correlation-ID" exists-action="override">
    <value>@((string)context.Variables["correlationId"])</value>
</set-header>
4. Standardized Error Response
xml
<on-error>
    <set-body>@{
        return new JObject(
            new JProperty("error", new JObject(
                new JProperty("code", context.LastError.Source),
                new JProperty("message", context.LastError.Message),
                new JProperty("correlationId", context.Variables["correlationId"]),
                new JProperty("timestamp", DateTime.UtcNow.ToString("o"))
            ))
        ).ToString();
    }</set-body>
</on-error>
5. Security Headers
xml
<set-header name="X-Content-Type-Options" exists-action="override">
    <value>nosniff</value>
</set-header>
<set-header name="X-Frame-Options" exists-action="override">
    <value>DENY</value>
</set-header>
<set-header name="Strict-Transport-Security" exists-action="override">
    <value>max-age=31536000; includeSubDomains</value>
</set-header>

Authentication Decision Matrix

API TypeAuthenticationRate LimitUse Case
Public Read-OnlySubscription Keys500 req/hourWeather API, Public Holidays
Internal CorporateOAuth (Entra ID)10,000 req/hourEmployee Directory, HR Systems
Sensitive PublicOAuth (Entra External ID)1,000 req/hourPayment, Health Records
HybridOAuth + Keys Fallback1,000/500 req/hourAPIs with free/premium tiers

Policy Validation Checklist

Before deploying, verify:

  • Correlation ID: Generated in <inbound>, included in response + error
  • Authentication: JWT validation or subscription key check
  • Rate limiting: Configured with appropriate limits
  • Error handling: <on-error> block with structured JSON
  • Security headers: X-Content-Type-Options, X-Frame-Options, HSTS
  • Backend cleanup: Remove X-Powered-By, Server in <outbound>
  • XML validity: Well-formed, no unclosed tags
  • Testing: Valid/invalid tokens, rate limit exceeded

  • azure-apim-architecture - Understand architecture before policy authoring
  • api-security-review - Validate security after policy creation

Microsoft Documentation


Skill Version: 1.0
Last Updated: 29 January 2026
Primary Knowledge: APIM_PLATFORM_BASELINE_POLICIES.md, references/POLICY_TEMPLATES.md

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

Files

SKILL.md and 1 other file (references) in .github/skills/apim-policy-authoring of thomast1906/github-copilot-agent-skills.

  • SKILL.md
  • references/POLICY_TEMPLATES.md

Open the folder on GitHubat commit 554ac0b

Compare with similar skills

Azure APIM Policy Authoring 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 APIM Policy Authoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure APIM Policy Authoring this skillthomast1906/github-copilot-agent-skills202—~1.5kAutomated safety check: PassMIT
API Security Designvinayaklatthe/microsoft-security-skills175—~2.2kAutomated safety check: PassMIT
Frontmcp Configagentfront/frontmcp146—~7kAutomated safety check: PassApache-2.0
Discover APIrand/cc-polymath181—~1.5kAutomated safety check: PassMIT
Maui Authenticationdavidortinau/maui-skills175—~1.5kAutomated safety check: PassMIT
Frappe Core APIImpertio-Studio/Frappe_Claude_Skill_Package189—~3.2kAutomated safety check: PassMIT

Similar skills

  • 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
    Backend & APIsAuto-check passed
  • Frontmcp Config

    agentfront/frontmcp

    A skill your agent uses when configuring a FrontMCP server through frontmcp.config or the @FrontMcp options.

    146 GitHub stars~7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Discover API

    rand/cc-polymath

    Automatically discover API design skills when working with REST APIs, GraphQL schemas, API authentication, OAuth, JWT, rate limiting, API versioning, error handling, or endpoint design.

    181 GitHub stars~1.5k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Maui Authentication

    davidortinau/maui-skills

    Add authentication to .NET MAUI apps. An agent skill from davidortinau/maui-skills.

    175 GitHub stars~1.5k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Frappe Core API

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when building ERPNext/Frappe API integrations (v14/v15/v16) including REST API, RPC API, authentication, webhooks, and rate limiting.

    189 GitHub stars~3.2k tokensUpdated 23 days ago
    Backend & APIsAuto-check passed
  • Quarkus Security

    affaan-m/ECC

    Quarkus security implementation patterns: JWT and OIDC authentication, @RolesAllowed RBAC and SecurityIdentity checks, Bean Validation and custom validators, parameterized Panache queries, BCrypt…

    276k GitHub starsUsed in 1 repo~3.1k tokens
    Backend & APIsAuto-check passed

More from thomast1906/github-copilot-agent-skills

All 15 skills in this repo
  • Copilot Skill Creator

    thomast1906/github-copilot-agent-skills

    Guides creating, updating, reviewing and validating GitHub Copilot agent skills, from deciding whether a skill is the right tool to structuring bundled resources.

    202 GitHub stars~4.1k tokensUpdated 3 days ago
    Auto-check passed
  • Azure API Management Security Review

    thomast1906/github-copilot-agent-skills

    Audits an Azure API Management setup against the OWASP API Security Top 10 and Azure Security Benchmark, covering policies, network layout and identity.

    202 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check passed
  • APIOps Deployment for Azure APIM

    thomast1906/github-copilot-agent-skills

    Supplies Bicep and Terraform templates, CI/CD pipeline patterns and phased promotion plans for deploying Azure API Management with APIOps workflows.

    202 GitHub stars~3.6k tokensUpdated 3 days ago
    Auto-check passed
  • Azure Draw.io MCP Diagrams

    thomast1906/github-copilot-agent-skills

    Creates and edits architecture diagrams through the Draw.io MCP tool, with guidance for rendering Azure icons correctly and laying out network diagrams.

    202 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check passed
  • Azure Pricing Lookup

    thomast1906/github-copilot-agent-skills

    Looks up live Azure retail prices by SKU, service or region through the Azure MCP pricing tool, estimates template costs and compares regions, price types and savings plans.

    202 GitHub stars~4.9k tokensUpdated 3 days ago
    Auto-check passed
  • Excalidraw MCP Diagramming

    thomast1906/github-copilot-agent-skills

    Create and edit diagrams on a live Excalidraw canvas using the Excalidraw MCP server.

    202 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Azure APIM Policy Authoring

What does Azure APIM Policy Authoring do?

Generates Azure API Management policy XML for authentication, rate limiting, CORS, error handling and transformations, consulting Azure best-practice and documentation tools first. 0, JWT validation and hybrid auth with subscription keys, per-user or per-subscription throttling, CORS for browser clients, standardized error responses with correlation IDs, header and body transformations and security headers.md`: hybrid authentication with a subscription key fallback for public APIs, OAuth only with Entra ID for internal APIs, and subscription key only for simple read-only APIs.

When should I use Azure APIM Policy Authoring?

Azure APIM Policy Authoring fits situations like: securing an API in Azure API Management with JWT or OAuth validation; adding per-user rate limiting to an API policy; setting up CORS and security headers for a browser-facing API; standardizing error responses with correlation IDs.

How do I install Azure APIM Policy Authoring in Claude Code?

Run `npx skills add thomast1906/github-copilot-agent-skills --skill apim-policy-authoring -a claude-code`. Or copy the skill folder (.github/skills/apim-policy-authoring in thomast1906/github-copilot-agent-skills) into .claude/skills/apim-policy-authoring in your project. Claude Code loads it when a task matches its description.

How do I install Azure APIM Policy Authoring in Codex?

Run `npx skills add thomast1906/github-copilot-agent-skills --skill apim-policy-authoring -a codex`. Or copy the skill folder (.github/skills/apim-policy-authoring in thomast1906/github-copilot-agent-skills) into .agents/skills/apim-policy-authoring in your project. Codex loads it when a task matches its description.

Can I use Azure APIM Policy Authoring 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 thomast1906/github-copilot-agent-skills --skill apim-policy-authoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/apim-policy-authoring, .gemini/skills/apim-policy-authoring, .github/skills/apim-policy-authoring and .opencode/skills/apim-policy-authoring in your project.

What does Azure APIM Policy Authoring need to run?

SKILL.md names no scripts, command-line tools or credentials: Azure APIM Policy Authoring is instructions for the agent only. Our summary lists: Azure MCP tools for best practices and documentation; An Azure API Management service to apply the policies to.

Does Azure APIM Policy Authoring access the network?

SKILL.md names 2 domains. In commands or code: login.microsoftonline.com; the agent is likely to contact it when it follows the instructions. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Azure APIM Policy Authoring 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 APIM Policy Authoring use?

Azure APIM Policy Authoring 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 APIM Policy Authoring use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.

What are the alternatives to Azure APIM Policy Authoring?

Skills that share tags, products or a category with Azure APIM Policy Authoring: API Security Design (vinayaklatthe/microsoft-security-skills, 175 stars), Frontmcp Config (agentfront/frontmcp, 146 stars), Discover API (rand/cc-polymath, 181 stars) and Maui Authentication (davidortinau/maui-skills, 175 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure APIM Policy Authoring?

thomast1906 (a GitHub user) maintains it in thomast1906/github-copilot-agent-skills, which has 202 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 7, 2026.

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