Heroes always have it. Infils get it randomly. No one else gets the button.
Again, I don't think
always is accurate. It's been a while since my heroes were imprisoned, but I seem to remember not having the option 100% of my stay, with it sometimes not appearing at all.