If it's a loose rattling then it could be a small piece of debris inside the tube. I've seen this mostly in vintage tubes and it's usually harmless.
More commonly, a semi-rigid rattling is caused by the heater filament banging around inside of the cathode tube (more likely with bigger tubes). Some tubes are just worse than others, even of the same type & date. Generally not a big problem, as the filament should have adequate insulating coating and the filament wire itself is unlikely to break. However, with the less than stellar quality control of the russian and chinese tubes - there will always be some "bad apples" out there.
I've actually noticed the worst examples of this kind of rattling on some vintage Mullard EL34 and some nice old 5R4GY rectifiers - and never had any operational issues with those tubes.
Obviously, it's not advisable to shake & rattle such tubes like maracas for fun - you don't want to them any reasons to fail. However, most of these tubes (even new production) can survive untold horrors in shipping and keep on ticking...tubes are is many ways quite robust.
The short answer is that your tube in question is PROBABLY ok, as long as it tested fine before shipping. I stick with tubes for their sound, but on the flip side you're going to have to start dealing more in "probably"'s rather than pure "certainties". I've had 1 tube catastrophe so far...last year an EH KT90 shorted out on me, with sparks and smoke (toasted a resistor); there were no warning signs beforehand. Reliance on Russian power tubes is a reality for me, and from now on I'll be buying from sellers that burn them in for me.