You are absolutely right that sensitivity label metadata is embedded within the file itself, and it makes sense to expect that reading it might be possible without contacting the cloud. However, based on the current capabilities of the Microsoft Information Protection (MIP) SDK, it is unfortunately not possible to use the SDK in C++ to read sensitivity labels from a file without first authenticating to the Microsoft 365 cloud.
Why the SDK Still Needs Cloud Authentication
Even though the label is stored locally in the file, the Microsoft Information Protection (MIP) SDK is architected to always work within the context of a user and a policy, both of which require initial authentication to Azure Active Directory (AAD).
The SDK performs actions like:
- Downloading the label policy tied to a user/tenant.
- Resolving label names, descriptions, and hierarchy.
- Enforcing policy rules based on label settings.
So, without that initial authenticated context, the SDK cannot be initialized - and as a result, even basic operations like reading the label ID aren’t supported.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
Thank you.