Grants of immunity cannot be given unilaterally by a prosecutor. They have to be approved by the head of the DOJ Criminal Division as well as the AG/DAG.
Immunity comes with conditions and limitations that must be followed.
Once immunity is granted via the proper channels, can the government arbitrarily rescind immunity for no cause? Yes, but any information gathered under immunity cannot be used against the defendant. And that was the question.