It’s not uncommon for a criminal defendant in a white-collar case to cooperate with prosecutors in hopes of receiving a lenient sentence. But it is less common for a defendant to then seek to keep that cooperation secret out of fear of retaliation from those he named.

Yet that appears to have been the case with Eric Saldarriaga, a private investigator in New York who was sentenced on June 26 to serve up to three months in federal prison for hacking into dozens of personal email accounts.

A year before he pleaded guilty, Mr. Saldarriaga tried, in vain, to cooperate with federal authorities in a bid to avoid prison time. In the end, prosecutors decided the information he provided was not enough to pursue charges against anyone else, according to court filings in the case that were unsealed on Tuesday.

What seemed to trouble Mr. Saldarriaga the most in the weeks since his guilty plea was that the full extent of his efforts to help authorities might become public and prompt at least one of his former clients to possibly retaliate against him.