Bucky Katt: "I didn't follow this mess too closely. Who promised him the immunity? Was it the legal system, MLB, or both?"
Since Giambi, Bonds, Sheffield, et al. weren't the target or implicated in the BALCO case, any testimony they make is sealed and they are given immunity. In Grand Jury testimonies, a witness can say he did anything: murder, larson, steriods, etc. and you can't go back afterwards and prosecute him/her.
The only way you could go after said witness after the fact is if he lies to the Grand Jury, or if his name is Bill Clinton, in which case you can pull your pants down & take a shit in front of the Grand Jury and nothing will happen to you .. but that's a story for another day.
Giambi's testimony should never, ever have been leaked to the public. That's as illegal as illegal gets .. but for legal matters, Giambi's testimony doesn't exist. That's why he hasn't made such an admission in public .. if he admits to steroids in a public manner, the Yanks can go after his contract.