It's probably a rock-borer, and blue-black suggests something like Echinometra lucunter, which as far as I know also comes in red and purple-ish hues, but blue-ish black seems to be the more common one in the trade. They also commonly show up as youngsters in LR shipments. However, that species guess is only based on statistics; other species do show up from time to time. Without a clear photo of the animal, a concrete ID is impossible.
Odds are the urchin will be "safe" in the sense of not harming other commonly kept organisms aside from coralline algae and other calcareous algaes like Halimeda, but Echinoderms do not always fare well in an unstable environment - so the tank may not be all that safe for it right now. If the rock is for a brand new tank and you want to keep the urchin, you will want to be more aggressive about keeping ammonia/nitrite in check during any cycling than would be the case otherwise, and you may also need to target feed it at some point if the rock gets stripped bare (easy for a growing urchin to do if there isn't much on the rock or with a small volume of rock).