https://en.wikipedia.org/wiki/Title_18_of_the_United_States_Code#Part_V%E2%80%94Immunity_of_Witnesses
Shoulda realized that there would be a whole section in 18USC.