The easiest way of making sure the taxi you're getting into is safe is to use a licensed taxi, which in London would be a black cab or a licensed mini-cab - a proper hire vehicle. Outside of London, use a licensed or reputable cab hire company. I think it's important that you check when you get in whether there is a driving license on display. If so, then the taxi is licensed and safe. It's also useful to check that the license plate and the cab plate on the vehicle are actually in place. I think it's important to plan ahead. If you know you're going to be using a cab to go home, make a note of a reputable company that you've used in the past before you go out. Put their telephone number in your mobile phone, if you have one, so that you're able to control which cab you get at the end of an evening rather than relying on potluck.