The Trump administration is the leakiest in recent memory. This has infuriated the president, who has demanded that his Justice Department crack down on leakers of all kinds. These investigations raise a thorny question: When is it actually illegal for someone in the government to leak information to a reporter?

The answer, as a tour through the recent history of major leak investigations shows, is: It depends on who’s doing the leaking.