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
Ready-to-paste message
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-purviewOr 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.mdTechnical 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
Popularity
- GitHub stars
- 35k
- Ranking position
- #5859
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC