Yes, you need to hand the prescription over to someone else who will not allow you to take anymore. They will keep it from you until the "pill count" is restored, then you can go back on your prescribed dosage if needed. I am assuming you're not already dependent on it now, so you should be able to do this.
As much as I like benzos, I am the kind of person who doesn't like taking alprazolam very often, and if I did, 0.5mg would be the most I would take in a day. If I couldn't control myself with it, I would give them to someone who could hold onto them for me. It is really important to be able to hold onto this type of medication, because a benzo addiction can be horrifying. Having benzos in the future for when you need them the most (anxiety, insomnia, panic, etc.) is also really important as well.
Good luck with the pill counts with the doctor and everything.