Skip to content
Skillpedia
General coding35k · #5859

implementing-data-loss-prevention-with-microsoft-purview

Teaches your AI agent to build APIs and back-end systems.

What it does

This tool helps set up rules to protect your company's important information, like personal or financial data, so it's not shared improperly via email, cloud storage, or other means. It also lets you classify documents with confidentiality labels.

When to use it

  • ✓When you need to stop sensitive data from leaving the company.
  • ✓When setting up labels to classify documents as 'Public', 'Confidential', etc.
  • ✓To investigate who accessed or tried to share sensitive data.

Example of what to ask your AI

“Set up a policy to block sending credit card numbers via email.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-data-loss-prevention-with-microsoft-purview/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-data-loss-prevention-with-microsoft-purview/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses special commands (PowerShell) and Microsoft APIs to create and manage data protection policies. These policies define what is considered sensitive and what to do when it's detected.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-data-loss-prevention-with-microsoft-purview

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/implementing-data-loss-prevention-with-microsoft-purview/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Implementing Data Loss Prevention with Microsoft Purview

When to Use

  • Deploying DLP policies to prevent sensitive data (PII, PHI, PCI, intellectual property) from leaving the organization through email, cloud storage, chat, or endpoint file operations
  • Configuring sensitivity labels with encryption, content marking, and auto-labeling to classify documents and emails by confidentiality level
  • Creating custom sensitive information types with regex patterns to detect organization-specific data formats (employee IDs, project codes, internal account numbers)
  • Deploying endpoint DLP to control copy-to-USB, print, upload-to-cloud, and copy-to-clipboard actions for labeled or sensitive content on managed devices
  • Investigating DLP incidents through Activity Explorer to analyze policy match events, user activity patterns, and false positive rates for policy tuning

Do not use without appropriate Microsoft 365 E5, E5 Compliance, or E5 Information Protection licensing. Do not deploy DLP policies directly to production enforcement mode without a simulation period. Do not configure endpoint DLP without coordinating with the endpoint management team responsible for device onboarding.

Prerequisites

  • Microsoft 365 E5 or E5 Compliance / E5 Information Protection add-on license assigned to target users
  • Global Administrator, Compliance Administrator, or Compliance Data Administrator role in the Microsoft Purview portal
  • Exchange Online PowerShell module (ExchangeOnlineManagement v3.x) and Security & Compliance PowerShell for policy automation
  • Devices onboarded to Microsoft Purview endpoint DLP through Microsoft Intune or Configuration Manager (Windows 10/11 21H2+, macOS 12+)
  • Data classification scan completed or content explorer populated to understand existing sensitive data distribution
  • Stakeholder agreement on sensitivity label taxonomy (classification levels, encryption requirements, scope)

Workflow

Step 1: Design the Sensitivity Label Taxonomy

Define the classification hierarchy that maps to organizational data handling requirements:

  • Establish label tiers: Create a label hierarchy reflecting data sensitivity levels. A standard enterprise taxonomy includes:
    Public           -> No protection, external sharing allowed
    General          -> No encryption, internal watermark "GENERAL"
    Confidential     -> Encryption (all employees), header/footer marking
      ├─ Confidential - All Employees
      ├─ Confidential - Finance
      └─ Confidential - HR
    Highly Confidential -> Encryption (specific users/groups), watermark, no forwarding
      ├─ Highly Confidential - Project X
      └─ Highly Confidential - Board Only
    
  • Define protection settings per label: For each label, configure encryption scope (all employees, specific groups, or custom permissions), content marking (headers, footers, watermarks), and auto-labeling conditions:
    # Connect to Security & Compliance PowerShell
    Connect-IPPSSession -UserPrincipalName admin@contoso.com
    
    # Create parent label
    New-Label -DisplayName "Confidential" `
      -Name "Confidential" `
      -Tooltip "Business data that could cause damage if disclosed to unauthorized parties" `
      -Comment "Apply to internal business documents, financial reports, and customer data"
    
    # Create sub-label with encryption
    New-Label -DisplayName "Confidential - Finance" `
      -Name "Confidential-Finance" `
      -ParentId (Get-Label -Identity "Confidential").Guid `
      -Tooltip "Financial data restricted to Finance department" `
      -EncryptionEnabled $true `
      -EncryptionProtectionType "Template" `
      -EncryptionRightsDefinitions "finance-group@contoso.com:VIEW,VIEWRIGHTSDATA,DOCEDIT,EDIT,PRINT,EXTRACT,OBJMODEL" `
      -ContentType "File, Email"
    
  • Configure content marking: Apply visual indicators that persist with the document:
    Set-Label -Identity "Confidential-Finance" `
      -HeaderEnabled $true `
      -HeaderText "CONFIDENTIAL - FINANCE" `
      -HeaderFontSize 10 `
      -HeaderFontColor "#FF0000" `
      -HeaderAlignment "Center" `
      -FooterEnabled $true `
      -FooterText "This document contains confidential financial information" `
      -WatermarkEnabled $true `
      -WatermarkText "CONFIDENTIAL" `
      -WatermarkFontSize 36
    

…

FAQ

Do I need to pay to use this?

Yes, you need specific Microsoft 365 licenses (like E5 Compliance or E5 Information Protection) to use this tool.

Can I set this up by myself?

You need administrator permissions in Microsoft Purview, and for some parts (like endpoint protection), you need to coordinate with the team managing the company's computers.

What are 'custom sensitive information types'?

These are patterns you create to identify specific company information not covered by general standards, like internal project codes or specific account numbers.

Details

Original description by the author

Implements DLP policies using Microsoft Purview PowerShell cmdlets and the Graph API to protect data across Exchange Online, SharePoint, OneDrive, Teams, endpoints, and Power BI, including sensitivity labels, custom sensitive information types with regex, endpoint DLP rules, and Activity Explorer monitoring. Use when stopping PII/PHI/PCI exfiltration, configuring sensitivity labels, or investigati

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5859
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills