You can determine if a path is protected by SIP by checking the "com.apple.rootless" extended attribute. However, this can be misleading as the attribute doesn't exist for subfolders:
xattr /System/
com.apple.rootless
xattr /System/Library/
<nothing>
Additionally, some protected files and folders cannot be read at all, and there's no way to check for this. As example /private/var/db/KernelExtensionManagement
Topic:
Privacy & Security
SubTopic:
General
Tags: