Sensitivity labels¶
Sensitivity labels classify content by confidentiality — Public, Internal,
Confidential, Highly Confidential — and the classification travels with the
content. The Graph entry point is
client.security.data_security_and_governance.sensitivity_labels.
List sensitivity labels¶
Lists the labels published in the tenant, with priority and description on demand.
labels = client.security.data_security_and_governance.sensitivity_labels.get().execute_query()
for label in labels:
print(label.display_name, label.priority)
Requires the delegated permission InformationProtectionPolicy.Read.All
and the Compliance Administrator (or Global Administrator) role — the script
uses with_token_interactive with a require_role pre-flight guard.
See also¶
- Apply a sensitivity label to a SharePoint file —
../../sharepoint/sites/assign_sensitivity_label.py