Reporters do that all the time.
A reporter will tell a politician Tell me AB& C or I might attach your name to D. But if you tell me AB&C, I will leave your name out of this.
They did it publicly. For all of the world to see.
Illegal.