New to Claude Skills? Learn how to install them →

microsoft on GitHub

IRQL Query Composer

OfficialFree

Compose IRQL queries for cybersecurity investigations effortlessly.

by microsoft1.4k stars on microsoft/azure-skills
1 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What IRQL Query Composer does

The IRQL Query Composer skill allows users to create Incident Response Query Language (IRQL) pipelines specifically tailored for cybersecurity investigations. By leveraging a set of predefined functions, this skill translates natural language requests into structured IRQL queries that can be used to hunt for security threats. The skill focuses on simplifying the process of composing queries by providing building blocks such as selectors, extractors, and enrichers, enabling users to construct complex queries without needing to memorize the underlying Kusto Query Language (KQL) schemas.

IRQL is designed to unify disparate security data sources into a consistent schema, making it easier for analysts to perform investigations across different datasets. The skill supports the use of IRQL functions, which wrap raw KQL security tables, allowing users to express their queries in a more intuitive manner. This means that even those who may not be deeply familiar with KQL can still effectively conduct threat hunting and incident response tasks by using this skill to generate the necessary queries.

To utilize this skill, users must ensure that the target database has the required IRQL functions deployed. The skill provides a mechanism to verify the availability of these functions before attempting to generate a pipeline. If the necessary functions are not present, the skill will inform the user and suggest using raw KQL queries instead. This ensures that users are aware of the prerequisites for using IRQL effectively and can adjust their approach accordingly.

Overall, the IRQL Query Composer is ideal for cybersecurity analysts and incident responders who need to quickly compose queries for threat hunting and investigations, streamlining their workflow and enhancing their ability to respond to security incidents efficiently.

When to use it

Use this skill when you need to create IRQL queries for cybersecurity investigations or when you want to express natural language requests related to IRQL functions.

When not to use it

This skill is not suitable for general security queries that do not explicitly mention IRQL or its functions; for those, consider using a different KQL query generation tool.

What you can build with it

Hunting for Failed Logins

Use the skill to quickly compose an IRQL pipeline that identifies failed login attempts across your systems.

Investigating Phishing Attempts

Leverage the skill to create queries that extract and analyze email events related to suspected phishing activities.

Analyzing Lateral Movement

Build IRQL queries to track user actions and processes that indicate potential lateral movement within your network.

How to install IRQL Query Composer

View source

1. Install with the skills CLI

npx skills add microsoft/azure-skills/azure-kusto-irql --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by microsoft

IRQL -- Incident Response Query Language

Compose IRQL function pipelines from selector, extractor, and enricher building blocks. IRQL wraps raw KQL security tables behind intent-revealing, composable functions so analysts (and LLMs) can express hunts without memorizing schemas, cluster locations, or join keys.

Activation Triggers

Use this skill when the user:

  • Explicitly mentions IRQL, Get_*, Extract_*, or Enrich_* functions
  • Says "use IRQL" or "write an IRQL query"
  • Requests a composable hunting pipeline using known IRQL selectors

Do not activate for generic security queries (e.g. "find failed logins") unless the user explicitly asks for IRQL. Route those to azure-kusto instead.

Not a natural-language-to-IRQL converter. This skill composes IRQL function pipelines and may handle basic natural-language requests that map directly to known selectors and simple filters. For general NL-to-KQL or NL-to-IRQL conversion, use a dedicated query-generation skill (available separately).

IRQL Function Preflight

Before generating a pipeline, verify IRQL is available on the target database:

.show functions
| where Name startswith "Get_" or Name startswith "Extract_" or Name startswith "Enrich_"
| project Name

If no IRQL functions are found, inform the user that IRQL is not deployed on the target database and suggest using azure-kusto for raw KQL queries instead. IRQL functions are a prerequisite -- this skill does not deploy base IRQL selectors.

What IRQL Is

IRQL is a function-based dialect on top of KQL. It provides:

  1. Unified schema -- disparate security tables project into consistent column names regardless of the underlying data source
  2. Composability -- small functions chain via | invoke to build complex hunts from simple steps
  3. Portability -- the same IRQL pipeline works across different clusters/databases; only the Get_* primitives need re-pointing

IRQL is not a separate language. It's KQL functions you invoke. Any valid KQL works alongside IRQL functions.

Deploying IRQL

IRQL functions are stored KQL functions (.create-or-alter function). They must already be deployed to the target database before this skill can generate pipelines.

Public example cluster (functions pre-deployed):

  • Cluster: https://kc7001.eastus.kusto.windows.net
  • Databases: ValdyTimes, JoJosHospital

To port IRQL to a new cluster/database, create Get_* selectors that project your source tables into the unified schema (column names below), then deploy extractors and enrichers. The extractors and enrichers work unchanged as long as the input schema matches.

Function Catalog

1. Selectors -- Get_*

Return projected, schema-unified views of source tables. Use the minimal form by default; use _All when extra columns are needed.

FunctionColumns
Get_Event_AuthenticationEnvTime, Hostname, ClientIp, Username, Result
Get_Event_Authentication_All+ Description, UserAgent, PasswordHash
Get_EmailEnvTime, EmailSender, EmailRecipient, Subject, Url
Get_Email_All+ ReplyTo, Verdict
Get_EmployeesName, ClientIp, Email, Username, Hostname, Role
Get_Employees_All+ HireDate, UserAgent, Domain
Get_Event_FileCreationEnvTime, Hostname, Filename, Path
Get_Event_FileCreation_All+ Username, Sha256, ProcessName
Get_Event_NetworkInboundEnvTime, ClientIp, Url
Get_Event_NetworkInbound_All+ Method, UserAgent, StatusCode
Get_Event_NetworkOutboundEnvTime, ClientIp, Url
Get_Event_NetworkOutbound_All+ Method, UserAgent
Get_Dns_AllEnvTime, Domain, ClientIp
Get_Event_ProcessEnvTime, ProcessCommandLine, ProcessName, Hostname, Username
Get_Event_Process_All+ ParentProcessName, ParentProcessHash, ProcessHash
Get_SecurityAlerts_AllEnvTime, AlertType, Severity, Description, Indicators
Get_Network_Connection_AllEnvTime, SourceIp, SourcePort, DestinationIp, DestinationPort, Protocol, Bytes

2. Extractors -- Extract_*

Derive a new column from an existing one. Invoke after a selector.

FunctionInput ColumnAdds
Extract_Email_Sender_Domain(T)EmailSenderDomain
Extract_Employee_Firstname(T)NameFirstname
Extract_Event_Network_Domain(T)UrlDomainName

3. Enrichers -- Enrich_*

Left-join helpers that attach context from a related table.

FunctionKey ColumnEnriches With
Enrich_Event_Authentication_Username(T)UsernameAuth events for user
Enrich_Ip_Employee(T)ClientIpEmployee identity from IP
Enrich_Username_Employee(T)UsernameEmployee identity from username
Enrich_Ip_Domain(T)ClientIpDNS domains resolved to IP
Enrich_Ip_Event_NetworkOutbound(T)ClientIpOutbound network from IP
Enrich_Ip_Network_Connection(T)ClientIpNetwork flows from IP

4. External Enrichment

FunctionSourceRequirement
Enrich_Sha256_VirusTotal(T)VirusTotal file reportAPI key + callout policy
Get_CISA_KEV() / Enrich_CISA_KEV(T)CISA KEV catalogCallout policy

Composition Rules

Selector -> Extract -> Filter -> Enrich -> Summarize/Project
  1. Start with a Selector: Get_Event_Authentication, Get_Email, etc.
  2. Extract derived fields: | invoke Extract_Email_Sender_Domain()
  3. Filter to the signal: | where Result == "Failed Login"
  4. Enrich with context: | invoke Enrich_Username_Employee()
  5. Summarize / project the answer

Always pipe (|) between steps. Extractors and Enrichers use | invoke FunctionName().

Query Generation Guidelines

  • Use the minimal selector unless extra columns are needed -> then _All
  • Chain extractors before enrichers (extractors add columns enrichers may key on)
  • Place where filters as early as possible
  • Use summarize for aggregations, project for final column selection
  • End with order by + take to limit output

Examples

For additional prompts and worked examples, see references/EXAMPLES.md.

Brute-force detection

Get_Event_Authentication
| where Result == "Failed Login"
| summarize FailedCount = count() by Username
| where FailedCount > 19
| invoke Enrich_Username_Employee()
| project Username, Name, Role, Email, FailedCount
| order by FailedCount desc

Phishing triage by recipient seniority

Get_Email
| invoke Extract_Email_Sender_Domain()
| project EnvTime, EmailSender, Domain, Username = EmailRecipient, Subject, Url
| invoke Enrich_Username_Employee()
| extend Seniority = case(
    Role has_any ("CEO", "Chief", "Director", "VP", "President"), 3,
    Role has_any ("Manager", "Lead", "Senior"), 2,
    1)
| summarize
    TotalEmails = count(),
    SeniorityScore = sum(Seniority),
    Recipients = make_set(Name, 50),
    DistinctRecipients = dcount(Username)
  by Domain
| where DistinctRecipients >= 2
| order by SeniorityScore desc
| take 20

Post-exploitation pivot from an indicator

let victims =
    Get_Event_FileCreation_All
    | where Filename has "<INDICATOR>"
    | distinct Hostname;
Get_Event_Process
| where Hostname in (victims)
| where ProcessCommandLine has_any ("rundll32", "regsvr32", "powershell", "systeminfo")
| project EnvTime, Hostname, Username, ProcessName, ProcessCommandLine
| order by EnvTime asc

Suspicious outbound traffic enriched with identity

Get_Event_NetworkOutbound
| invoke Extract_Event_Network_Domain()
| where DomainName has_any ("<SUSPICIOUS_DOMAIN_1>", "<SUSPICIOUS_DOMAIN_2>")
| invoke Enrich_Ip_Employee()
| project EnvTime, Name, Role, DomainName, Url, ClientIp
| order by EnvTime desc

External IP authentication anomaly

Get_Event_Authentication_All
| where not(ClientIp startswith "10.") and not(ClientIp startswith "192.168.")
| summarize
    Attempts = count(),
    Failures = countif(Result == "Failed Login"),
    Users = make_set(Username)
  by ClientIp
| order by Failures desc
| take 20

MCP Tools Used

ToolPurpose
kusto_queryExecute IRQL pipelines against a Kusto database
kusto_table_schema_getDiscover available tables and columns
kusto_cluster_listList available ADX clusters
kusto_database_listList databases in a cluster

Opening Queries in Kusto Explorer (Windows Only)

Optional convenience feature. The default workflow is to output the KQL in chat and let the user copy it into Kusto Explorer or the VS Code Kusto extension manually. Auto-launch is opt-in only.

Always output the complete KQL query in the chat response with Step 1 (connect) and Step 2 (query) clearly labeled:

// Step 1: Connect to your cluster (skip if already connected)
// Example: uncomment to connect to the KC7 training cluster
// #connect cluster('kc7001.eastus.kusto.windows.net').database('ValdyTimes')
// Or replace with your own cluster:
// #connect cluster('<YOUR_CLUSTER>').database('<YOUR_DATABASE>')

// Step 2: Run the query below
<KQL_QUERY>

If the user asks to save or open in Kusto Explorer, follow the procedure in references/KUSTO_EXPLORER_LAUNCH.md. Key rules:

  • Use ask_user to confirm before writing files or launching executables
  • Display file contents in chat so the user can review before opening
  • Never use shell interpolation or here-strings — write files via Set-Content/Add-Content
  • Never encode queries into browser URLs
  • On macOS/Linux, save the .kql file and suggest the VS Code Kusto extension or ADX Web Explorer
  • For graph visualization from IRQL data, see azure-kusto-graph and azure-kusto-irql-graph

Frequently asked questions about IRQL Query Composer

Similar skills