When drugs metabolize the metabolites they give off enter the scalp and leave a permanent record in hair follicles. The metabolites remain in the hair follicle and provide a permanent record of drug use. If you have a prescription for it then there is nothing you need to worry about if it is a drug test for a job. Just inform them that you are taking a prescribed medication (Xanax or Alprazolam) and if they need to you can provide a note from your doctor.