I think there are a couple reasons for this (which happens in Act III, Scene 2).
First of all, it seems likely that they are scared that they might themselves be accused of being witches. With the way the court is going, you never know who might be accused (especially by the girls) or for what reason. So you are better off not even having the court notice you.
The other thing is that (especially for Giles Corey's informant), they would be testifying against powerful people. Giles is accusing Putnam of a crime and Putnam is pretty powerful in the town. If Putnam finds out who the informant is, he might hurt him as well.