Top guard rails should be on both sides of the top bunk. All gaps should be narrower than 3 1/2 inches wide.
The mattress should be at least 5 inches below the top of the top guard rail. This will prevent you from falling off the bunk beds in your sleep.
The top rail on the side next to the wall does not have to run completely from one end to the other, unless it is taller than 30 inches. However, the distance between the end of the rail and the end of the bed should not be larger than 15 inches for all sized bunk beds.
Edges and corners should be round so you don't hurt yourself if you accidentally hit your head or another part of your body part on it.
The top rails should be tight and secure. Tug on them gently and make sure they do not move.