With any sword regardless of how well made it is, the once perfect fit of the blade into the saya will start to loosen up. Repeated drawing and re-sheathing will wear away at the mouth of the saya (also called the koiguchi) resulting in a less than perfect fit against the habaki and a blade that could easily slide out under its own weight. Needless to say this is dangerous and requires you give it some attention.
Remove the blade from the saya and pop it somewhere safe. If you look at the mouth of the saya you will see the wider rear of the opening (the mune side) and the narrower front (the ha side).
Saya shimming, is the practice of affixing a thin piece of wood into the saya on either of these sides in order to fill any undesirable space that might be there and thus make a nice snug fit for the habaki. The sides of the habaki do not have to fit against the sides of the saya in the same way, as all the pressure is placed on the front and back like a two finger pinching grip.
Now, the easiest side to shim is the Ha side as you're only ever dealing with one flat side whereas the mune side can have two or more sides. With this in mind, that's the side I suggest trying. Taking a piece of soft wood strip, cut the wood to the shape and size of the flat surface on the inside of the koiguchi and fix this in place using a general purpose glue. Once the glue is dry, you can test the fit. If it's still not tight enough, you can use another shim, but often enough I find the first one is more than enough.
Be careful when trying the fit, you do not want to have to use too much force. If it feels too tight, remove the blade and set it safely aside again and taking a small file slowly file the shim down a little and try again. Take a little off at a time, it's easier to remove some more material than it is to add it. Repeat this until it seats correctly. A well shimmed saya should allow the blade to sit in the saya and not fall out should it be tipped upside down. I don't mean you should turn it upside down and shake the hell out of it. No, that way dragons lie. I just mean it should be snug. Be careful when testing the fit.