I know it makes no difference in the eyes of the law, but if you must get an illegal taxi, best to get one by a Brit worker.
Talking purely from a Brit tourist point of view here, but guess the same rule of thumb applies to Spaniards, French, Germans etc.
Agree price before you ride (and barter!), size up your driver and ascertain whether they are fit to drive before you get in the vehicle.
Some of the (illegal)immigrant workers will be on khat (and probably worse!) I'm not insinuating that British workers won't be, but you'll probably get a better feel for how suitable somebody is to drive.
Then at the end of your journey, if you are happy with the price and standard of driving get the driver's no and use them again instead of risking it with an unknown qty.
I'm not advocating the use of illegal taxis. I highly recommend using the real deal. But the reality is people won't. So - as with taking substances - the best method is harm reduction.