Never keep your working library in a location that syncs to any type of cloud service, including iCloud, Dropbox, OneDrive etc. Nor should you run it from a USB drive, or a network drive. It is, however, safe to store a backup of your library in any of these locations. More info here.