Microsoft Defender for Endpoint
Endpoint protection

Configure Ai Agent Runtime Protection

In brief

The documentation now describes the PromptEvidenceCollection setting, PowerShell commands to manage it, required Defender Antivirus platform and engine versions, and managed-policy precedence.

What Defender admins need to know

Admins using prompt evidence collection should keep Defender Antivirus updated to the documented October 2026 versions or later. Local preferences do not override managed policy.

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.

After you enable runtime protection on a test device, run the AI agent runtime protection demonstration to confirm that Defender detects a benign prompt injection test string.

Configure prompt evidence collection

PromptEvidenceCollection enables or disables the collection of prompt evidence when AI agent runtime protection is configured. For feature defaults and privacy guidance, see Prompt evidence collection.

Prompt evidence collection requires the October 2026 Microsoft Defender Antivirus platform and engine updates or later: platform version family 4.18.26100.x and engine version family 1.1.26100.x. Keep both components up to date. To check the installed versions, run:

Get-MpComputerStatus | Select-Object AMProductVersion, AMEngineVersion

In an elevated PowerShell session, use the following commands:

  • To enable prompt evidence collection:

    Set-MpPreference -PromptEvidenceCollection $true
    
  • To disable prompt evidence collection:

    Set-MpPreference -PromptEvidenceCollection $false
    
  • To remove the locally configured preference:

    Remove-MpPreference -PromptEvidenceCollection
    

Removing the local preference doesn't remove a setting configured by managed policy. A policy configured through Intune or another management channel takes precedence over a local PowerShell preference.

To review all three device settings, run:

Get-MpPreference | Select-Object AiAgentProtection, AiAgentNetworkInspection, PromptEvidenceCollection

For parameter details, see Set-MpPreference, Get-MpPreference, and Remove-MpPreference.

Deploy settings throughout your organization with Microsoft Intune

Use a Microsoft Intune endpoint security Antivirus policy to deploy agent-native event inspectioninspection, network inspection, and prompt evidence collection to enrolled Windows devices. For detailed instructions, see Create endpoint security policies or Modify existing policies (links open new tabs in the Intune documentation).

When you create the policy, use these specific settings:

On the Configuration settings page, configure the settings you need:

SettingPurposeConfiguration
Ai Agent Protection by using one(AiAgentProtection)Inspect agent activity through supported agent-native event interfaces.Choose the audit or block mode you need. The default is disabled.
Ai Agent Network Inspection (AiAgentNetworkInspection)Inspect supported agent-to-LLM network traffic.Choose audit or block mode independently of the following values:

  • agent-native event inspection. The default is disabled.
DefaultPrompt Evidence Collection: Runtime (PromptEvidenceCollection)Collect prompt evidence when AI agent runtime protection is disabled. Defender doesn't inspect agent-native events for prompt injectionconfigured.Enable or block agent actions.
  • disable collection.
  • For each inspection method, Audit: Defender detects and reports prompt injection but allowswhile allowing the agent action to continue.

  • continue, and Block: Defender detects prompt injection and blocks detected threats at supported agent actions before they run.
  • inspection points. Leave a method disabled if you don't need it. You can enable either inspection method or both.

    Microsoft recommends that you initially assign the policy in audit mode to a limited device group. Review detections, and then change the settinginspection settings to block mode when you're ready to enforce protection. Choose whether to enable prompt evidence collection separately. Complete the policy wizard, assign the policy to the device groups you want to protect, and then create the policy.

    After the policy applies, verify the settingsettings on an enrolled device:

    1. In the Microsoft Defender portal, open the device page.
    2. On the Configuration management tab, select Effective settings.
    3. Find Ai Agent Protection,the agent protection, network inspection, and prompt evidence collection settings you configured, and confirm itstheir effective valuevalues and configuration source.sources. For more information, see Effective settings on the device entity page.

    Close any terminal windows used to run agents, and then open a new terminal window before starting the agent. Run the AI agent runtime protection demonstration to confirm that Defender detects a benign prompt injection test string.

    Note

    The Microsoft Defender AI agent runtime protection profile configures agent-native event inspection. To deploy network inspection with Intune, use a PowerShell platform script.

    Deploy network inspection with a PowerShell platform script

    To deploy network inspection to device groups:

    1. Create a PowerShell script that contains the following command:

      Set-MpPreference -AiAgentNetworkInspection Audit
      

      Replace Audit with Block when you're ready to enforce protection. To turn off network inspection, use Disabled.

    2. In the script settings, set Run this script using the logged on credentials to No. This setting runs the script in the system context so that it has permission to change Microsoft Defender Antivirus preferences.

    3. Use Microsoft Intune to deploy the script to target device groups. For detailed steps, see Use PowerShell scripts on Windows devices in Intune.

    4. To apply a different mode later, update the script or its policy so that Intune runs the script again.

    Intune normally runs a platform script once. It runs the script again only after you change the script or policy, or if a failed script is eligible for retry.

    Deploy settings throughout your organization with the Microsoft Defender portal

    If your organization manages endpoint security policies in the Microsoft Defender portal, use the Microsoft Defender AI agent runtime protection template to deploy agent-native event inspection.inspection, network inspection, and prompt evidence collection. The policy can apply to Intune-enrolled devices and devices managed through Defender for Endpoint security settings management.

    For detailed instructions, see Create an endpoint security policy or Edit an endpoint security policy (links open new tabs).

    • Select platform: Select Windows.
    • Select template: Select Microsoft Defender AI agent runtime protection.

    On the Configuration settings page, configure the settings you need:

    • Ai Agent Protection, which protects agents that expose vendor-supported agent (AiAgentProtection) for agent-native event interfaces. Select one of the following values:

      • Default: The protection method is disabled.inspection.
      • Ai Agent Network Inspection (AiAgentNetworkInspection) for supported agent-to-LLM network traffic.
      • Prompt Evidence Collection (PromptEvidenceCollection) to enable or disable collection of prompt evidence when AI agent runtime protection is configured.

      Configure each inspection method independently. Audit: Defender detects and reports prompt injection but allowswhile allowing the agent action to continue.

    • continue, and Block: Defender detects prompt injection and blocks detected threats at supported agent actions before they run.
    inspection points. Leave a method disabled if you don't need it.

    Microsoft recommends that you initially assign the policy in audit mode to a limited device group. Review detections, and then change the settinginspection settings to block mode when you're ready to enforce protection. Choose whether to enable prompt evidence collection separately. Complete the policy wizard, assign the policy to the device groups you want to protect, and then create the policy.

    Important

    For devices managed through Defender for Endpoint security settings management that aren't enrolled in Intune, assign the policy to Microsoft Entra device groups. User targeting isn't supported for these devices.

    After the policy applies, verify the settingsettings on a device:

    1. In the Microsoft Defender portal, open the device page.
    2. On the Configuration management tab, select Effective settings.
    3. Find Ai Agent Protection,the agent protection, network inspection, and prompt evidence collection settings you configured, and confirm itstheir effective valuevalues and configuration source.sources. For more information, see Effective settings on the device entity page.

    Close any terminal windows used to run agents, and then open a new terminal window before starting the agent. Run the AI agent runtime protection demonstration to confirm that Defender detects a benign prompt injection test string.