Microsoft Sentinel
Cloud and workloads

Generate playbooks using AI in Microsoft Sentinel

In brief

The generator is now documented as available to Microsoft Sentinel customers in the Defender portal without a separate Security Copilot license or Security Compute Units. Dedicated Security Copilot workspace setup was removed; Automation Playbooks Read and Write permissions are now required to generate and deploy playbooks.

What Defender admins need to know

Ensure the Sentinel workspace is onboarded to Defender and assign the required Automation Playbooks permissions to users who need this capability.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Generate playbooks using AI in Microsoft Sentinel

The SOAR playbook generator creates python based automation workflows coauthored through a conversational experience with Cline, an AI coding agent. You describe automation logic in natural language, and the system generates validated, code-based playbooks with complete documentation and visual flow diagrams. ThisThe playbook generation experience is powered by an embedded VS Code environment within the Defender portal, so you can author and refine playbooks without leaving the portal. Generated playbooks use alert data as input and dynamically generate the required API calls, as long as you configure the integration for the target provider.

This article describes how to generate playbooks by using AI, configure required integrations, and deploy your automation workflows.

The AI-powered playbook generator is available to Microsoft Sentinel customers in the Microsoft Defender portal. It doesn't require a separate Microsoft Security Copilot license or Security Compute Units.

Playbook generation provides the following capabilities:

  • Co-author with AI: Build playbooks through natural language conversations with Cline, an AI coding agent hosted in a VS Code environment embedded in the Defender portal.

Environment requirements

Required roles and permissions

You need the following permissions in Microsoft Defender unified role-based access control (RBAC):

  • To use the playbook generatorgenerate and deploy playbooks:

    • AuthorizationAutomation: Automation Playbooks (Read and settings: Detection tuning (manage)
    • Security operations: Security Copilot (read)Write)
  • To author automation rules:

    • Microsoft Sentinel Contributor role on the relevant Workspaces or Resource Groups containing them in Defender.

Key concepts

Before you generate a playbook, understand the following concepts that the playbook generator relies on.

  • Tenant-level application: Ensure consistency across multiple workspaces
  • Advanced conditions: Define granular criteria for triggering automation

The Enhanced Alert Trigger enables automatic execution of generated playbooks across your security ecosystem.

Generate a new playbook

An embedded Visual Studio Code environment opens with Cline.

:::image type="content" source="./media/generate-playbook/playbook-name.png" alt-text="Screenshot of the embedded Visual Studio Code environment with the playbook generator." lightbox="./media/generate-playbook/playbook-name.png":::

Work in Plan mode

  1. If the playbook generator requests approval to fetch documentation URLs, approve the request. This approval allows the playbook generator to access relevant API documentation to generate accurate code.

    :::image type="content" source="./media/generate-playbook/approval-request.png" alt-text="Screenshot of the approval request dialog in the embedded Visual Studio Code environment." lightbox="./media/generate-playbook/approval-request.png":::

  2. The playbook generator analyzes your request and might:

    • Ask clarifying questions
  3. When satisfied with the plan, follow instructions and switch to Act mode.

    :::image type="content" source="./media/generate-playbook/act-mode.png" alt-text="Screenshot of the embedded Visual Studio Code environment in Act mode with the playbook generator." lightbox="./media/generate-playbook/act-mode.png":::

Generate the playbook in Act mode

  1. After you switch the playbook generator session to Act mode, the playbook generator delivers:

    • The complete playbook code in Python
    • Code validation
    • Comprehensive documentation, including a visual flow diagram and description of the playbook in natural language
  2. The playbook generator asks the user for an Alert ID to run a test of the playbook. Before it executes the test, the playbook generator outlines the changes that will be applied to the environment and requests the user’s approval to proceed.

  3. The playbook generator might request approval for code generation. To enable automatic generation without approval prompts, select the Edit checkbox under Auto-approve.

    :::image type="content" source="./media/generate-playbook/auto-approve.png" alt-text="Screenshot of the Autoapprove checkbox in the embedded Visual Studio Code environment." lightbox="./media/generate-playbook/auto-approve.png":::

Validate and save your playbook

  1. To ensure correctness, manually review the generated code and documentation.

  2. To preview the documentation in Markdown format:

  3. Close the editor when finished.

    :::image type="content" source="./media/generate-playbook/preview.png" alt-text="Screenshot of the preview of an alert notification created with the playbook generator." lightbox="./media/generate-playbook/preview.png":::

Enable and deploy your playbook

  data and adds the results as a comment to the related incident.
  • Create a playbook that blocks an AWS IAM user, assigns the alert to John, and adds a remediation comment when a high severity alert includes an IAM user entity.

.

  1. Limitations of AI-generated playbooks

    In the Create a new workspace dialog:

    1. EnableBe aware of the following privacy flags:limitations when working with generated playbooks:

      • Allow Microsoft to capture data to validate product performance
      • Allow Microsoft to capture and review data to build and validate Microsoft's security AI model
    2. Accept the Terms and Conditions.

    3. Under Capacity, select Create a new capacity.

      :::image type="content" source="./media/generate-playbook/create-new-capacity.png" alt-text="Screenshot of Create new workspace dialog with Create a new capacity link highlighted." lightbox="./media/generate-playbook/create-new-capacity.png":::

  2. Configure the new capacity:

    In the Create a Security capacity dialog:

    1. Choose your Azure subscription, resource group, and capacity name.

    2. Set Prompt evaluation location to United States or Europe. If you select a different location, check the box: If this location has too much traffic, allow Copilot to evaluate prompts anywhere in the world.

    3. Adjust compute units and allow overage settings. The playbook generator doesn't consume Security Compute Units (SCUs), but you need to configure the capacity to meet these technical requirements for playbook generation.

    4. Select Create.

:::image type="content" source="./media/generate-playbook/create-capacity.png" alt-text="Screenshot of the new capacity details." lightbox="./media/generate-playbook/create-capacity.png":::

Generated playbooks automatically use the dedicated Security Copilot workspace you created.

Key concepts

Before you generate a playbook, understand the following concepts that the playbook generator relies on.

  • Tenant-level application: Ensure consistency across multiple workspaces
  • Advanced conditions: Define granular criteria for triggering automation

This trigger mechanism enables automatic execution of generated playbooks across your security ecosystem.

Generate a new playbook

An embedded Visual Studio Code environment opens with Cline.

:::image type="content" source="./media/generate-playbook/playbook-name.png" alt-text="Screenshot of the embedded Visual Studio Code environment with the playbook generator." lightbox="./media/generate-playbook/playbook-name.png":::

Work in Plan mode

  1. If the playbook generator requests approval to fetch documentation URLs, approve the request. This approval allows the playbook generator to access relevant API documentation to generate accurate code.

:::image type="content" source="./media/generate-playbook/approval-request.png" alt-text="Screenshot of the approval request dialog in the embedded Visual Studio Code environment." lightbox="./media/generate-playbook/approval-request.png":::

  1. The playbook generator analyzes your request and might:

    • Ask clarifying questions
  2. When satisfied with the plan, follow instructions and switch to Act mode.

:::image type="content" source="./media/generate-playbook/act-mode.png" alt-text="Screenshot of the embedded Visual Studio Code environment in Act mode with the playbook generator." lightbox="./media/generate-playbook/act-mode.png":::

Generate the playbook in Act mode

  1. After you switch to Act mode, the playbook generator delivers:

    • The complete playbook code in Python
    • Code validation
    • Comprehensive documentation, including a visual flow diagram and description of the playbook in natural language
  2. The playbook generator asks the user for an Alert ID to run a test of the playbook. Before it executes the test, the playbook generator outlines the changes that will be applied to the environment and requests the user’s approval to proceed.

  3. The tool might request approval for code generation. To enable automatic generation without approval prompts, select the Edit checkbox under Auto-approve.

:::image type="content" source="./media/generate-playbook/auto-approve.png" alt-text="Screenshot of the Autoapprove checkbox in the embedded Visual Studio Code environment." lightbox="./media/generate-playbook/auto-approve.png":::

Validate and save your playbook

  1. To ensure correctness, manually review the generated code and documentation.

  2. To preview the documentation in Markdown format:

  3. Close the editor when finished.

:::image type="content" source="./media/generate-playbook/preview.png" alt-text="Screenshot of the preview of an alert notification created with the playbook generator." lightbox="./media/generate-playbook/preview.png":::

Enable and deploy your playbook

  data and adds the results as a comment to the related incident.
  • Create a playbook that blocks an AWS IAM user, assigns the alert to John, and adds a remediation comment when a high severity alert includes an IAM user entity.

Limitations

Be aware of the following limitations when working with generated playbooks: